]> git.donarmstrong.com Git - debhelper.git/blob - Debian/Debhelper/Buildsystem/perl_makemaker.pm
use $this rather than $self
[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 Debian::Debhelper::Dh_Lib;
11 use base 'Debian::Debhelper::Buildsystem::makefile';
12
13 sub DESCRIPTION {
14         "support for building Perl MakeMaker based packages (in-source only)"
15 }
16
17 sub check_auto_buildable {
18         my $this=shift;
19         my ($action)=@_;
20
21         # Handles configure, install; the rest - next class
22         if ($action eq "install" || $action eq "configure") {
23                 return -e "Makefile.PL";
24         }
25         else {
26                 return 0;
27         }
28 }
29
30 sub new {
31         my $class=shift;
32         my $this=$class->SUPER::new(@_);
33         $this->enforce_in_source_building();
34         return $this;
35 }
36
37 sub configure {
38         my $this=shift;
39         # If set to a true value then MakeMaker's prompt function will
40         # # always return the default without waiting for user input.
41         $ENV{PERL_MM_USE_DEFAULT}=1;
42         doit("perl", "Makefile.PL", "INSTALLDIRS=vendor", @_);
43 }
44
45 sub install {
46         my $this=shift;
47         my $destdir=shift;
48         $this->SUPER::install($destdir, "PREFIX=/usr", @_);
49 }
50
51 1;