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';
15 "Perl Module::Build (Build.PL)"
18 sub check_auto_buildable {
19 my ($this, $step) = @_;
22 my $ret = -e $this->get_sourcepath("Build.PL");
23 if ($step ne "configure") {
24 $ret &&= -e $this->get_sourcepath("Build");
31 $this->doit_in_sourcedir("perl", @_);
36 my $this= $class->SUPER::new(@_);
37 $this->enforce_in_source_building();
44 $ENV{PERL_MM_USE_DEFAULT}=1;
45 if ($ENV{CFLAGS} && ! compat(8)) {
46 push @flags, "config=optimize=$ENV{CFLAGS} $ENV{CPPFLAGS}";
48 if ($ENV{LDFLAGS} && ! compat(8)) {
49 push @flags, "config=ld=$Config{ld} $ENV{LDFLAGS}";
51 $this->do_perl("Build.PL", "installdirs=vendor", @flags, @_);
56 $this->do_perl("Build", @_);
61 $this->do_perl("Build", "test", @_);
67 $this->do_perl("Build", "install", "destdir=$destdir", "create_packlist=0", @_);
72 if (-e $this->get_sourcepath("Build")) {
73 $this->do_perl("Build", "--allow_mb_mismatch", 1, "distclean", @_);