1 # A buildsystem plugin 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;
11 use base 'Debian::Debhelper::Buildsystem::makefile';
14 "support for building Perl MakeMaker based packages (in-source only)"
17 sub is_auto_buildable {
18 my ($self, $action)=@_;
20 # Handles configure, install; the rest - next class
21 if ($action eq "install") {
22 # This hack is needed to keep full 100% compatibility with previous
24 # XXX JEH perl_makemaker comes before makefile, so
25 # couldn't it instead just test for Makefile.PL?
27 system('grep -q "generated automatically by MakeMaker" Makefile') == 0) {
31 # XXX JEH why test for configure here? If building or cleaning, and
32 # a Makefile.PL exists, we know this class can handle those
33 # actions -- it does so by inheriting from the makefile class.
34 elsif ($action eq "configure") {
35 return -e "Makefile.PL";
44 my $self=$cls->SUPER::new(@_);
45 $self->enforce_in_source_building();
51 # If set to a true value then MakeMaker's prompt function will
52 # # always return the default without waiting for user input.
53 $ENV{PERL_MM_USE_DEFAULT}=1;
54 doit("perl", "Makefile.PL", "INSTALLDIRS=vendor", @_);
60 # XXX JEH this test seems redundant with the one in
61 # is_auto_buildable, if we get here we know that one succeeded.
63 system('grep -q "generated automatically by MakeMaker" Makefile') == 0) {
64 $self->SUPER::install($destdir, "PREFIX=/usr", @_);
67 $self->SUPER::install($destdir, @_);