]> git.donarmstrong.com Git - debhelper.git/blob - Debian/Debhelper/Buildsystem/perl_makemaker.pm
Implement source directory switching support (Closes: #530597).
[debhelper.git] / Debian / Debhelper / Buildsystem / perl_makemaker.pm
1 # A buildsystem plugin for handling Perl MakeMaker based projects.
2 #
3 # Copyright: © 2008-2009 Joey Hess
4 #            © 2008-2009 Modestas Vainius
5 # License: GPL-2+
6
7 package Debian::Debhelper::Buildsystem::perl_makemaker;
8
9 use strict;
10 use base 'Debian::Debhelper::Buildsystem::makefile';
11
12 sub DESCRIPTION {
13         "Perl ExtUtils::MakeMaker (Makefile.PL)"
14 }
15
16 sub check_auto_buildable {
17         my $this=shift;
18         my ($step)=@_;
19
20         # Handles configure, install; the rest - next class
21         if ($step eq "install" || $step eq "configure") {
22                 return -e $this->get_sourcepath("Makefile.PL");
23         }
24         else {
25                 return 0;
26         }
27 }
28
29 sub new {
30         my $class=shift;
31         my $this=$class->SUPER::new(@_);
32         $this->enforce_in_source_building();
33         return $this;
34 }
35
36 sub configure {
37         my $this=shift;
38         # If set to a true value then MakeMaker's prompt function will
39         # # always return the default without waiting for user input.
40         $ENV{PERL_MM_USE_DEFAULT}=1;
41         # This prevents  Module::Install from interactive behavior.
42         $ENV{PERL_AUTOINSTALL}="--skipdeps";
43
44         $this->doit_in_sourcedir("perl", "Makefile.PL", "INSTALLDIRS=vendor",
45             "create_packlist=0",
46             @_);
47 }
48
49 sub install {
50         my $this=shift;
51         my $destdir=shift;
52         $this->SUPER::install($destdir, "PREFIX=/usr", @_);
53 }
54
55 1;