1 # A debhelper build system class for handling Perl MakeMaker based projects.
3 # Copyright: © 2008-2009 Joey Hess
4 # © 2008-2009 Modestas Vainius
7 package Debian::Debhelper::Buildsystem::perl_makemaker;
10 use Debian::Debhelper::Dh_Lib qw(compat);
11 use base 'Debian::Debhelper::Buildsystem::makefile';
14 "Perl ExtUtils::MakeMaker (Makefile.PL)"
17 sub check_auto_buildable {
21 # Handles everything if Makefile.PL exists. Otherwise - next class.
22 if (-e $this->get_sourcepath("Makefile.PL")) {
23 if ($step eq "configure") {
27 return $this->SUPER::check_auto_buildable(@_);
35 my $this=$class->SUPER::new(@_);
36 $this->enforce_in_source_building();
42 # If set to a true value then MakeMaker's prompt function will
43 # # always return the default without waiting for user input.
44 $ENV{PERL_MM_USE_DEFAULT}=1;
45 # This prevents Module::Install from interactive behavior.
46 $ENV{PERL_AUTOINSTALL}="--skipdeps";
48 $this->doit_in_sourcedir("perl", "Makefile.PL", "INSTALLDIRS=vendor",
49 # if perl_build is not tested first, need to pass packlist
50 # option to handle fallthrough case
51 (compat(7) ? "create_packlist=0" : ()),
59 # Special case for Makefile.PL that uses
60 # Module::Build::Compat. PREFIX should not be passed
61 # for those; it already installs into /usr by default.
62 my $makefile=$this->get_sourcepath("Makefile");
63 if (system(qq{grep -q "generated automatically by MakeMaker" $makefile}) != 0) {
64 $this->SUPER::install($destdir, @_);
67 $this->SUPER::install($destdir, "PREFIX=/usr", @_);