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
25 system('grep -q "generated automatically by MakeMaker" Makefile') == 0) {
29 elsif ($action eq "configure") {
30 return -e "Makefile.PL";
39 my $self=$cls->SUPER::new(@_);
40 $self->enforce_in_source_building();
46 # If set to a true value then MakeMaker's prompt function will
47 # # always return the default without waiting for user input.
48 $ENV{PERL_MM_USE_DEFAULT}=1;
49 doit("perl", "Makefile.PL", "INSTALLDIRS=vendor", @_);
55 # XXX JEH This is a really unfortunate breaking of the
56 # encapsulation of the perl_makefile module. Perhaps it would be
57 # better for that module to contain some hack that injects that
59 # XXX MDX Solved. perl_makemaker will need come before makefile in
60 # @BUILDSYSTEMS. See also hack in is_auto_buildable().
61 # This is a safety check needed to keep 100% compatibility with
62 # earlier debhelper behaviour. This if is very unlikely to be false.
64 system('grep -q "generated automatically by MakeMaker" Makefile') == 0) {
65 $self->SUPER::install($destdir, "PREFIX=/usr", @_);
67 $self->SUPER::install($destdir, @_);