line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
1
|
|
|
|
|
|
|
# $Id: Dot.pm 6 2007-09-13 10:22:19Z asksol $ |
2
|
|
|
|
|
|
|
# $Source: /opt/CVS/Getopt-LL/inc/Module/Build/Getopt/LL.pm,v $ |
3
|
|
|
|
|
|
|
# $Author: asksol $ |
4
|
|
|
|
|
|
|
# $HeadURL: https://class-dot.googlecode.com/svn/class-dot/inc/Module/Build/Class/Dot.pm $ |
5
|
|
|
|
|
|
|
# $Revision: 6 $ |
6
|
|
|
|
|
|
|
# $Date: 2007-09-13 12:22:19 +0200 (Thu, 13 Sep 2007) $ |
7
|
|
|
|
|
|
|
package Module::Build::Debian; |
8
|
|
|
|
|
|
|
|
9
|
1
|
|
|
1
|
|
25913
|
use strict; |
|
1
|
|
|
|
|
3
|
|
|
1
|
|
|
|
|
50
|
|
10
|
1
|
|
|
1
|
|
6
|
use warnings; |
|
1
|
|
|
|
|
2
|
|
|
1
|
|
|
|
|
32
|
|
11
|
1
|
|
|
1
|
|
845
|
use version; our $VERSION = qv('1.0.0'); |
|
1
|
|
|
|
|
2769
|
|
|
1
|
|
|
|
|
9
|
|
12
|
|
|
|
|
|
|
|
13
|
1
|
|
|
1
|
|
104
|
use Carp qw(croak); |
|
1
|
|
|
|
|
2
|
|
|
1
|
|
|
|
|
92
|
|
14
|
1
|
|
|
1
|
|
864
|
use FindBin qw($Bin); |
|
1
|
|
|
|
|
1136
|
|
|
1
|
|
|
|
|
169
|
|
15
|
1
|
|
|
1
|
|
1140
|
use English qw( -no_match_vars ); |
|
1
|
|
|
|
|
5130
|
|
|
1
|
|
|
|
|
11
|
|
16
|
|
|
|
|
|
|
|
17
|
|
|
|
|
|
|
my $DEFAULT_DH_MAKE_PERL = '/usr/bin/dh-make-perl'; |
18
|
|
|
|
|
|
|
|
19
|
|
|
|
|
|
|
my @CLEAN_FILES = qw( |
20
|
|
|
|
|
|
|
build-stamp |
21
|
|
|
|
|
|
|
install-stamp |
22
|
|
|
|
|
|
|
debian |
23
|
|
|
|
|
|
|
); |
24
|
|
|
|
|
|
|
|
25
|
|
|
|
|
|
|
my %EXPORT = ( |
26
|
|
|
|
|
|
|
ACTION_debian => \&ACTION_debian, |
27
|
|
|
|
|
|
|
ACTION_debianclean => \&ACTION_debianclean, |
28
|
|
|
|
|
|
|
); |
29
|
|
|
|
|
|
|
|
30
|
|
|
|
|
|
|
sub import { |
31
|
2
|
|
|
2
|
|
4687
|
my $this_class = shift; |
32
|
2
|
|
|
|
|
17
|
my $call_class = caller; |
33
|
|
|
|
|
|
|
|
34
|
2
|
|
|
|
|
14
|
while (my ($method_name, $coderef) = each %EXPORT) { |
35
|
1
|
|
|
1
|
|
650
|
no strict 'refs'; ## no critic |
|
1
|
|
|
|
|
2
|
|
|
1
|
|
|
|
|
521
|
|
36
|
4
|
|
|
|
|
14
|
my $fqdn = join q{::}, $call_class, $method_name; |
37
|
4
|
|
|
|
|
5
|
*{ $fqdn } = $coderef; |
|
4
|
|
|
|
|
32
|
|
38
|
|
|
|
|
|
|
} |
39
|
|
|
|
|
|
|
|
40
|
2
|
|
|
|
|
149891
|
return; |
41
|
|
|
|
|
|
|
} |
42
|
|
|
|
|
|
|
|
43
|
|
|
|
|
|
|
sub _set_debauthor { |
44
|
0
|
|
|
0
|
|
|
my ($self) = @_; |
45
|
|
|
|
|
|
|
|
46
|
|
|
|
|
|
|
# Set author name and email for the debian package. |
47
|
0
|
|
|
|
|
|
my $author_name; |
48
|
|
|
|
|
|
|
my $author_mail; |
49
|
0
|
|
|
|
|
|
my $dist_author = $self->dist_author->[0]; |
50
|
0
|
0
|
|
|
|
|
if ($dist_author =~ m/ \s*(.+?)\s* < (.+?) >/xms) { |
51
|
0
|
0
|
|
|
|
|
$author_name = defined $1 ? $1 : $dist_author; |
52
|
0
|
0
|
|
|
|
|
$author_mail = defined $2 ? $2 : q{}; |
53
|
|
|
|
|
|
|
} |
54
|
0
|
|
0
|
|
|
|
$ENV{DEBFULLNAME} ||= $author_name; |
55
|
0
|
|
0
|
|
|
|
$ENV{DEBEMAIL} ||= $author_mail; |
56
|
|
|
|
|
|
|
|
57
|
0
|
|
|
|
|
|
return; |
58
|
|
|
|
|
|
|
} |
59
|
|
|
|
|
|
|
|
60
|
|
|
|
|
|
|
sub ACTION_debian { |
61
|
0
|
|
|
0
|
1
|
|
my $self = shift; |
62
|
|
|
|
|
|
|
|
63
|
|
|
|
|
|
|
CLEANFILE: |
64
|
0
|
|
|
|
|
|
for my $file (@CLEAN_FILES) { |
65
|
0
|
0
|
0
|
|
|
|
if (-f $file || -d _) { |
66
|
0
|
|
|
|
|
|
$self->ACTION_debianclean(); |
67
|
0
|
|
|
|
|
|
last CLEANFILE; |
68
|
|
|
|
|
|
|
} |
69
|
|
|
|
|
|
|
} |
70
|
|
|
|
|
|
|
|
71
|
0
|
|
0
|
|
|
|
my $dh_make_perl = $self->notes('dh_make_perl') || $DEFAULT_DH_MAKE_PERL; |
72
|
|
|
|
|
|
|
|
73
|
0
|
0
|
0
|
|
|
|
if (! -f $dh_make_perl && -x _) { |
74
|
0
|
|
|
|
|
|
croak "Can't find dh-make-perl ($dh_make_perl): $OS_ERROR. " . |
75
|
|
|
|
|
|
|
"Please configure the 'dh_make_perl' option\n"; |
76
|
|
|
|
|
|
|
} |
77
|
|
|
|
|
|
|
|
78
|
|
|
|
|
|
|
# Create the shell command for dh-make-perl. |
79
|
0
|
|
|
|
|
|
my @cmd = ($dh_make_perl, '--build', $Bin); |
80
|
0
|
|
|
|
|
|
my $cmd_string = join q{ }, @cmd; |
81
|
|
|
|
|
|
|
|
82
|
0
|
|
|
|
|
|
_set_debauthor($self); |
83
|
|
|
|
|
|
|
|
84
|
0
|
|
|
|
|
|
$self->log_info(">>> Creating debian package with dh-make-perl [$cmd_string]\n"); |
85
|
|
|
|
|
|
|
|
86
|
0
|
|
|
|
|
|
system @cmd; |
87
|
|
|
|
|
|
|
|
88
|
0
|
|
|
|
|
|
return; |
89
|
|
|
|
|
|
|
} |
90
|
|
|
|
|
|
|
|
91
|
|
|
|
|
|
|
sub ACTION_debianclean { |
92
|
0
|
|
|
0
|
1
|
|
my $self = shift; |
93
|
|
|
|
|
|
|
|
94
|
0
|
|
|
|
|
|
for my $file (@CLEAN_FILES) { |
95
|
0
|
|
|
|
|
|
$self->delete_filetree($file); |
96
|
|
|
|
|
|
|
} |
97
|
|
|
|
|
|
|
|
98
|
0
|
|
|
|
|
|
return; |
99
|
|
|
|
|
|
|
} |
100
|
|
|
|
|
|
|
|
101
|
|
|
|
|
|
|
|
102
|
|
|
|
|
|
|
1; |
103
|
|
|
|
|
|
|
|
104
|
|
|
|
|
|
|
__END__ |