blob: b681c3e892afb53bc0e83c4252cb014b49c743fa [file] [log] [blame]
Patrick Williamsc124f4f2015-09-15 14:41:29 -05001From 914948f026efce02cf0abff8b0312aaad96592ed Mon Sep 17 00:00:00 2001
2From: Brendan O'Dea <bod@debian.org>
3Date: Tue, 8 Mar 2005 19:30:38 +1100
4Subject: Fiddle with *PREFIX and variables written to the makefile
5
6Fiddle with *PREFIX and variables written to the makefile so that
7install directories may be changed when make is run by passing
8PREFIX= to the "make install" command (used when packaging
9modules).
10
11Patch-Name: debian/prefix_changes.diff
Brad Bishopd7bf8c12018-02-25 22:55:05 -050012Upstream-Status: Pending
Patrick Williamsc124f4f2015-09-15 14:41:29 -050013---
14 cpan/ExtUtils-MakeMaker/lib/ExtUtils/MM_Any.pm | 12 ++++++------
15 cpan/ExtUtils-MakeMaker/lib/ExtUtils/MM_Unix.pm | 3 +--
16 cpan/ExtUtils-MakeMaker/t/INST.t | 4 +---
17 cpan/ExtUtils-MakeMaker/t/INST_PREFIX.t | 10 +++++-----
18 4 files changed, 13 insertions(+), 16 deletions(-)
19
20diff --git a/cpan/ExtUtils-MakeMaker/lib/ExtUtils/MM_Any.pm b/cpan/ExtUtils-MakeMaker/lib/ExtUtils/MM_Any.pm
21index 4c00129..1ea2035 100644
22--- a/cpan/ExtUtils-MakeMaker/lib/ExtUtils/MM_Any.pm
23+++ b/cpan/ExtUtils-MakeMaker/lib/ExtUtils/MM_Any.pm
24@@ -902,8 +902,6 @@ all POD files in MAN1PODS and MAN3PODS.
25 sub manifypods_target {
26 my($self) = shift;
27
28- my $man1pods = '';
29- my $man3pods = '';
30 my $dependencies = '';
31
32 # populate manXpods & dependencies:
33@@ -919,7 +917,7 @@ END
34 foreach my $section (qw(1 3)) {
35 my $pods = $self->{"MAN${section}PODS"};
36 my $p2m = sprintf <<CMD, $] > 5.008 ? " -u" : "";
37- \$(NOECHO) \$(POD2MAN) --section=$section --perm_rw=\$(PERM_RW)%s
38+ \$(NOECHO) \$(POD2MAN) --section=\$(MAN${section}EXT) --perm_rw=\$(PERM_RW)%s
39 CMD
40 push @man_cmds, $self->split_command($p2m, map {($_,$pods->{$_})} sort keys %$pods);
41 }
42@@ -1875,9 +1873,11 @@ sub init_INSTALL_from_PREFIX {
43 $self->{SITEPREFIX} ||= $sprefix;
44 $self->{VENDORPREFIX} ||= $vprefix;
45
46- # Lots of MM extension authors like to use $(PREFIX) so we
47- # put something sensible in there no matter what.
48- $self->{PREFIX} = '$('.uc $self->{INSTALLDIRS}.'PREFIX)';
49+ my $p = $self->{PREFIX} = $self->{PERLPREFIX};
50+ for my $t (qw/PERL SITE VENDOR/)
51+ {
52+ $self->{"${t}PREFIX"} =~ s!^\Q$p\E(?=/|$)!\$(PREFIX)!;
53+ }
54 }
55
56 my $arch = $Config{archname};
57diff --git a/cpan/ExtUtils-MakeMaker/lib/ExtUtils/MM_Unix.pm b/cpan/ExtUtils-MakeMaker/lib/ExtUtils/MM_Unix.pm
58index 391dc22..4a8e14c 100644
59--- a/cpan/ExtUtils-MakeMaker/lib/ExtUtils/MM_Unix.pm
60+++ b/cpan/ExtUtils-MakeMaker/lib/ExtUtils/MM_Unix.pm
61@@ -3077,8 +3077,7 @@ sub prefixify {
62 warn " prefixify $var => $path\n" if $Verbose >= 2;
63 warn " from $sprefix to $rprefix\n" if $Verbose >= 2;
64
65- if( $self->{ARGS}{PREFIX} &&
66- $path !~ s{^\Q$sprefix\E\b}{$rprefix}s )
67+ if( $path !~ s{^\Q$sprefix\E\b}{$rprefix}s && $self->{ARGS}{PREFIX} )
68 {
69
70 warn " cannot prefix, using default.\n" if $Verbose >= 2;
71diff --git a/cpan/ExtUtils-MakeMaker/t/INST.t b/cpan/ExtUtils-MakeMaker/t/INST.t
72index 91058bb..e399ced 100644
73--- a/cpan/ExtUtils-MakeMaker/t/INST.t
74+++ b/cpan/ExtUtils-MakeMaker/t/INST.t
75@@ -65,9 +65,7 @@ isa_ok( $mm, 'ExtUtils::MakeMaker' );
76 is( $mm->{NAME}, 'Big::Dummy', 'NAME' );
77 is( $mm->{VERSION}, 0.01, 'VERSION' );
78
79-my $config_prefix = $Config{installprefixexp} || $Config{installprefix} ||
80- $Config{prefixexp} || $Config{prefix};
81-is( $mm->{PERLPREFIX}, $config_prefix, 'PERLPREFIX' );
82+is( $mm->{PERLPREFIX}, '$(PREFIX)', 'PERLPREFIX' );
83
84 is( !!$mm->{PERL_CORE}, !!$ENV{PERL_CORE}, 'PERL_CORE' );
85
86diff --git a/cpan/ExtUtils-MakeMaker/t/INST_PREFIX.t b/cpan/ExtUtils-MakeMaker/t/INST_PREFIX.t
87index e8de7c6..3fb3f12 100644
88--- a/cpan/ExtUtils-MakeMaker/t/INST_PREFIX.t
89+++ b/cpan/ExtUtils-MakeMaker/t/INST_PREFIX.t
90@@ -10,7 +10,7 @@ BEGIN {
91 }
92
93 use strict;
94-use Test::More tests => 52;
95+use Test::More tests => 47;
96 use MakeMaker::Test::Utils;
97 use MakeMaker::Test::Setup::BFD;
98 use ExtUtils::MakeMaker;
99@@ -62,16 +62,16 @@ like( $stdout->read, qr{
100 (?:Writing\ MYMETA.yml\ and\ MYMETA.json\n)?
101 }x );
102
103-is( $mm->{PREFIX}, '$(SITEPREFIX)', 'PREFIX set based on INSTALLDIRS' );
104+#is( $mm->{PREFIX}, '$(SITEPREFIX)', 'PREFIX set based on INSTALLDIRS' );
105
106 isa_ok( $mm, 'ExtUtils::MakeMaker' );
107
108 is( $mm->{NAME}, 'Big::Dummy', 'NAME' );
109 is( $mm->{VERSION}, 0.01, 'VERSION' );
110
111-foreach my $prefix (qw(PREFIX PERLPREFIX SITEPREFIX VENDORPREFIX)) {
112- unlike( $mm->{$prefix}, qr/\$\(PREFIX\)/ );
113-}
114+#foreach my $prefix (qw(PREFIX PERLPREFIX SITEPREFIX VENDORPREFIX)) {
115+# unlike( $mm->{$prefix}, qr/\$\(PREFIX\)/ );
116+#}
117
118
119 my $PREFIX = File::Spec->catdir('foo', 'bar');