From: Joey Hess Date: Sat, 23 Aug 2008 02:18:10 +0000 (-0400) Subject: dh_auto_install: Improve check for MakeMaker, to avoid passing PREFIX if the Makefile... X-Git-Tag: 7.0.17~1 X-Git-Url: https://git.donarmstrong.com/?p=debhelper.git;a=commitdiff_plain;h=cae2e136065a0925ed10e7122b098cf5f3ed4905 dh_auto_install: Improve check for MakeMaker, to avoid passing PREFIX if the Makefile was generated by Module::Build::Compat. Closes: #496157 --- diff --git a/debian/changelog b/debian/changelog index ddbe4ee..6df4a4f 100644 --- a/debian/changelog +++ b/debian/changelog @@ -6,6 +6,8 @@ debhelper (7.0.17) UNRELEASED; urgency=low [ Joey Hess ] * dh_gencontrol: Drop the Homepage field from udebs. Closes: #492719 * Typo. Closes: #493062 + * dh_auto_install: Improve check for MakeMaker, to avoid passing PREFIX + if the Makefile was generated by Module::Build::Compat. Closes: #496157 -- Per Olofsson Wed, 23 Jul 2008 10:52:14 +0200 diff --git a/dh_auto_install b/dh_auto_install index fa21a01..8e7ab90 100755 --- a/dh_auto_install +++ b/dh_auto_install @@ -63,10 +63,13 @@ $destdir=cwd()."/".$destdir; if (-e "Makefile" || -e "makefile" || -e "GNUmakefile") { $ENV{MAKE}="make" unless exists $ENV{MAKE}; my @params="DESTDIR=$destdir"; - # Special case for MakeMaker. - if (-e "Makefile.PL") { + + # Special case for MakeMaker generated Makefiles. + if (-e "Makefile" && + system('grep -q "generated automatically by MakeMaker" Makefile') == 0) { push @params, "PREFIX=/usr"; } + foreach my $target (qw{install}) { # Use make -n to check to see if the target would do # anything. There's no good way to test if a target exists.