]> git.donarmstrong.com Git - debhelper.git/blobdiff - Debian/Debhelper/Buildsystem/perl_makemaker.pm
perl_makemaker: Re-add fix for #496157, lost in rewrite.
[debhelper.git] / Debian / Debhelper / Buildsystem / perl_makemaker.pm
index 702458c5a6e42f258679a2e88c70a7c384826e6c..e109be5711e4aa96669ddef40bfd5e78a5afacbf 100644 (file)
@@ -58,7 +58,17 @@ sub configure {
 sub install {
        my $this=shift;
        my $destdir=shift;
-       $this->SUPER::install($destdir, "PREFIX=/usr", @_);
+
+       # Special case for Makefile.PL that uses
+       # Module::Build::Compat. PREFIX should not be passed
+       # for those; it already installs into /usr by default.
+       my $makefile=$this->get_sourcepath("Makefile");
+       if (system(qq{grep -q "generated automatically by MakeMaker" $makefile}) != 0) {
+               $this->SUPER::install($destdir, @_);
+       }
+       else {
+               $this->SUPER::install($destdir, "PREFIX=/usr", @_);
+       }
 }
 
 1