1 # A buildsystem plugin for handling Perl Build based projects.
3 # Copyright: © 2008-2009 Joey Hess
4 # © 2008-2009 Modestas Vainius
7 package Debian::Debhelper::Buildsystem::perl_build;
10 use Debian::Debhelper::Dh_Lib;
11 use base 'Debian::Debhelper::Dh_Buildsystem_Basic';
14 "support for building Perl Build.PL based packages (in-source only)"
17 sub is_auto_buildable {
18 my ($self, $action) = @_;
21 my $ret = -e "Build.PL";
22 # XXX JEH what happens here if they run dh_auto_build,
23 # forgetting dh_auto_configure? I think it will just
24 # think it's not auto buildable and, assuming no other buildsystems
25 # succeed, silently do nothing. Perhaps it would be better, then,
26 # to omit the test below. Then, it would try to run ./Build
27 # which doesn't exist, which should result in a semi-useful error.
28 if ($action ne "configure") {
36 $ENV{MODULEBUILDRC} = "/dev/null";
42 my $self= $cls->SUPER::new(@_);
43 $self->enforce_in_source_building();
49 $ENV{PERL_MM_USE_DEFAULT}=1;
50 $self->do_perl("Build.PL", "installdirs=vendor", @_);
55 $self->do_perl("Build", @_);
60 $self->do_perl("Build", "test", @_);
66 $self->do_perl("Build", "install", "destdir=$destdir", "create_packlist=0", @_);
71 $self->do_perl("Build", "--allow_mb_mismatch", 1, "distclean", @_);