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;
11 B<perl_build> - Perl Module::Build (Build.PL)
15 B<dh_auto_*> [B<--buildsystem>=I<perl_build>] ...
19 Module::Build is a system for building, testing, and installing Perl modules.
20 It does not require a C<make> on your system - most of the Module::Build code is
21 pure-perl and written in a very cross-platform way. Its only prerequisites are
22 modules that are included with perl 5.6.0. Typically, Module::Build build system
23 can be identified by presence of the F<Build.PL> script in the source
28 Out of source tree building is not supported. C<MODULEBUILDRC=/dev/null>
29 environment variable is exported in each building step.
36 use base 'Debian::Debhelper::Buildsystem';
39 "Perl Module::Build (Build.PL)"
42 sub check_auto_buildable {
43 my ($this, $step) = @_;
46 my $ret = -e $this->get_sourcepath("Build.PL");
47 if ($step ne "configure") {
48 $ret &&= -e $this->get_sourcepath("Build");
55 $ENV{MODULEBUILDRC} = "/dev/null";
56 $this->doit_in_sourcedir("perl", @_);
61 my $this= $class->SUPER::new(@_);
62 $this->enforce_in_source_building();
72 Execute C<perl Build.PL> passing C<installdirs=vendor> parameter by default.
73 Environment variable C<PERL_MM_USE_DEFAULT> is set before running the script.
75 =item I<Auto-selection>
77 If F<configure>, F<Makefile.PL>, F<setup.py> do not exist, but F<Build.PL>
78 exists in the source directory.
85 $ENV{PERL_MM_USE_DEFAULT}=1;
86 $this->do_perl("Build.PL", "installdirs=vendor", @_);
95 Execute C<perl Build>.
97 =item I<Auto-selection>
99 If F<Makefile>, F<makefile>, F<GNUmakefile> (build directory) and F<setup.py>
100 (source directory) do not exist, but F<Build.PL> and F<Build> files exist in
101 the source directory.
108 $this->do_perl("Build", @_);
117 Execute C<perl Build test>.
119 =item I<Auto-selection>
121 If F<Makefile>, F<makefile>, F<GNUmakefile> (build directory) and F<setup.py>
122 (source directory) do not exist, but F<Build.PL> and F<Build> files exist in
123 the source directory.
130 $this->do_perl("Build", "test", @_);
139 Execute C<perl Build install destdir=$destdir create_packlist=0>. $destdir is
140 the path to the temporary installation directory (see L<dh_auto_install(1)>).
142 =item I<Auto-selection>
144 If F<Makefile>, F<makefile>, F<GNUmakefile> (build directory) and F<setup.py>
145 (source directory) do not exist, but F<Build.PL> and F<Build> files exist in
146 the source directory.
154 $this->do_perl("Build", "install", "destdir=$destdir", "create_packlist=0", @_);
163 Execute C<perl Build --allow_mb_mismatch 1 distclean>.
165 =item I<Auto-selection>
167 If F<Makefile>, F<makefile>, F<GNUmakefile> (build directory) and F<setup.py>
168 (source directory) do not exist, but F<Build.PL> and F<Build> files exist in
169 the source directory.
176 $this->do_perl("Build", "--allow_mb_mismatch", 1, "distclean", @_);
185 Joey Hess <joeyh@debian.org>
186 Modestas Vainius <modestas@vainius.eu>