1 # A build system class 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 qw(compat);
11 use base 'Debian::Debhelper::Buildsystem';
14 "Perl Module::Build (Build.PL)"
17 sub check_auto_buildable {
18 my ($this, $step) = @_;
21 my $ret = -e $this->get_sourcepath("Build.PL");
22 if ($step ne "configure") {
23 $ret &&= -e $this->get_sourcepath("Build");
30 $this->doit_in_sourcedir("perl", @_);
35 my $this= $class->SUPER::new(@_);
36 $this->enforce_in_source_building();
43 $ENV{PERL_MM_USE_DEFAULT}=1;
44 if ($ENV{CFLAGS} && ! compat(8)) {
45 push @flags, "config=optimize=$ENV{CFLAGS}";
47 $this->do_perl("Build.PL", "installdirs=vendor", @flags, @_);
52 $this->do_perl("Build", @_);
57 $this->do_perl("Build", "test", @_);
63 $this->do_perl("Build", "install", "destdir=$destdir", "create_packlist=0", @_);
68 if (-e $this->get_sourcepath("Build")) {
69 $this->do_perl("Build", "--allow_mb_mismatch", 1, "distclean", @_);