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