]> git.donarmstrong.com Git - debhelper.git/blob - Debian/Debhelper/Buildsystem/perl_build.pm
74106d9bf3cd0a85a071570ae64f21bb1eb97a04
[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 Debian::Debhelper::Dh_Buildsystem_Bases;
12 use base 'Debian::Debhelper::Dh_Buildsystem_Basic';
13
14 sub DESCRIPTION {
15         "support for building Perl Build.PL based packages (in-source only)"
16 }
17
18 sub is_buildable {
19         my ($self, $action) = @_;
20         my $ret = (-e "Build.PL");
21         if ($action ne "configure") {
22                 $ret &= (-e "Build");
23         }
24         return $ret;
25 }
26
27 sub invoke_impl {
28         my $self=shift;
29         $ENV{MODULEBUILDRC} = "/dev/null";
30         return $self->SUPER::invoke_impl(@_);
31 }
32
33 sub new {
34         my $cls=shift;
35         my $self= $cls->SUPER::new(@_);
36         $self->enforce_in_source_building();
37         return $self;
38 }
39
40 sub configure_impl {
41         my $self=shift;
42         $ENV{PERL_MM_USE_DEFAULT}=1; # Module::Build can also use this.
43         doit("perl", "Build.PL", "installdirs=vendor", @_);
44 }
45
46 sub build_impl {
47         my $self=shift;
48         doit("perl", "Build", @_);
49 }
50
51 sub test_impl {
52         my $self=shift;
53         doit(qw/perl Build test/, @_);
54 }
55
56 sub install_impl {
57         my $self=shift;
58         my $destdir=shift;
59         doit("perl", "Build", "install", "destdir=$destdir", "create_packlist=0", @_);
60 }
61
62 sub clean_impl {
63         my $self=shift;
64         doit("perl", "Build", "--allow_mb_mismatch", 1, "distclean", @_);
65 }
66
67 1;