]> git.donarmstrong.com Git - debhelper.git/blob - Debian/Debhelper/Buildsystem/perl_build.pm
Merge branch 'master' into buildsystems
[debhelper.git] / Debian / Debhelper / Buildsystem / perl_build.pm
1 # A buildsystem plugin for handling Perl Build 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_build;
8
9 use strict;
10 use Debian::Debhelper::Dh_Lib;
11 use base 'Debian::Debhelper::Buildsystem';
12
13 sub DESCRIPTION {
14         "Perl Module::Build (Build.PL)"
15 }
16
17 sub check_auto_buildable {
18         my ($this, $action) = @_;
19
20         # Handles everything
21         my $ret = -e "Build.PL";
22         if ($action ne "configure") {
23                 $ret &&= -e "Build";
24         }
25         return $ret;
26 }
27
28 sub do_perl {
29         my $this=shift;
30         $ENV{MODULEBUILDRC} = "/dev/null";
31         doit("perl", @_);
32 }
33
34 sub new {
35         my $class=shift;
36         my $this= $class->SUPER::new(@_);
37         $this->enforce_in_source_building();
38         return $this;
39 }
40
41 sub configure {
42         my $this=shift;
43         $ENV{PERL_MM_USE_DEFAULT}=1;
44         $this->do_perl("Build.PL", "installdirs=vendor", @_);
45 }
46
47 sub build {
48         my $this=shift;
49         $this->do_perl("Build", @_);
50 }
51
52 sub test {
53         my $this=shift;
54         $this->do_perl("Build", "test", @_);
55 }
56
57 sub install {
58         my $this=shift;
59         my $destdir=shift;
60         $this->do_perl("Build", "install", "destdir=$destdir", "create_packlist=0", @_);
61 }
62
63 sub clean {
64         my $this=shift;
65         $this->do_perl("Build", "--allow_mb_mismatch", 1, "distclean", @_);
66 }
67
68 1;