1 # A debhelper build system class for handling Perl MakeMaker based projects.
3 # Copyright: © 2008-2009 Joey Hess
4 # © 2008-2009 Modestas Vainius
7 package Debian::Debhelper::Buildsystem::perl_makemaker;
11 B<perl_makemaker> - Perl ExtUtils::MakeMaker (Makefile.PL)
15 B<dh_auto_*> [B<--buildsystem>=I<perl_makemaker>] ...
19 Perl ExtUtils::MakeMaker utility is designed to write a Makefile for an
20 extension module from a Makefile.PL (at configure step). The rest of build
21 process is handled by C<make>. Typically, ExtUtils::MakeMaker build system can
22 be identified by presence of the F<Makefile.PL> script in the source directory.
26 Out of source tree building is not supported.
33 use base 'Debian::Debhelper::Buildsystem::makefile';
36 "Perl ExtUtils::MakeMaker (Makefile.PL)"
39 sub check_auto_buildable {
43 # Handles everything if Makefile.PL exists. Otherwise - next class.
44 if (-e $this->get_sourcepath("Makefile.PL")) {
45 if ($step eq "install" || $step eq "configure") {
49 # This is backwards compatible (with << 7.3) until build, test and
50 # clean steps are not reimplemented in the backwards compatibility
51 # breaking way. However, this is absolutely necessary for
52 # enforce_in_source_building() to work in corner cases in build,
53 # test and clean steps as the next class (makefile) does not
55 return $this->SUPER::check_auto_buildable(@_);
63 my $this=$class->SUPER::new(@_);
64 $this->enforce_in_source_building();
74 Execute C<Makefile.PL> script passing C<INSTALLDIRS=vendor> and
75 C<create_packlist=0> parameters. Environment variables C<PERL_MM_USE_DEFAULT=1>
76 and C<PERL_AUTOINSTALL=--skipdeps> are exported before running the script.
78 =item I<Auto-selection>
80 If F<Makefile.PL> file exists but F<configure> does not exist in the source
88 # If set to a true value then MakeMaker's prompt function will
89 # # always return the default without waiting for user input.
90 $ENV{PERL_MM_USE_DEFAULT}=1;
91 # This prevents Module::Install from interactive behavior.
92 $ENV{PERL_AUTOINSTALL}="--skipdeps";
94 $this->doit_in_sourcedir("perl", "Makefile.PL", "INSTALLDIRS=vendor",
105 Execute C<make> in the build directory. See I<makefile> build system
106 documentation for more information.
108 =item I<Auto-selection>
110 Both F<Makefile.PL> and F<Makefile> exist in the source directory.
120 Execute C<make test> in the source directory. See I<makefile> build system
121 documentation for more information.
123 =item I<Auto-selection>
125 Both F<Makefile.PL> and F<Makefile> exist in the source directory.
137 Execute C<make install DESTDIR=$destdir PREFIX=/usr> in the source directory
138 with $destdir set to the appropriate temporary installation directory. See
139 I<makefile> build system documentation for more information.
141 =item I<Auto-selection>
143 Both F<Makefile.PL> and F<Makefile> exist in the source directory.
151 $this->SUPER::install($destdir, "PREFIX=/usr", @_);
160 Execute C<make distclean> in the source directory. See I<makefile> build system
161 documentation for more information.
163 =item I<Auto-selection>
165 Both F<Makefile.PL> and F<Makefile> exist in the source directory.
171 L<dh_auto_makefile(7)>
177 Joey Hess <joeyh@debian.org>
178 Modestas Vainius <modestas@vainius.eu>