]> git.donarmstrong.com Git - debhelper.git/commitdiff
dh_auto_install: Improve check for MakeMaker, to avoid passing PREFIX if the Makefile...
authorJoey Hess <joey@kodama.kitenet.net>
Sat, 23 Aug 2008 02:18:10 +0000 (22:18 -0400)
committerJoey Hess <joey@kodama.kitenet.net>
Sat, 23 Aug 2008 02:18:10 +0000 (22:18 -0400)
debian/changelog
dh_auto_install

index ddbe4ee3fb09e3a80667956608495d1a817d9990..6df4a4f3769b3121348e3decafadcc99b8228151 100644 (file)
@@ -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 <pelle@debian.org>  Wed, 23 Jul 2008 10:52:14 +0200
 
index fa21a010be71a7df7f15b5d0ee6b472afca5f3b1..8e7ab907ae8b5123fb6753db73b00285a65726d7 100755 (executable)
@@ -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.