-
Notifications
You must be signed in to change notification settings - Fork 2
/
Makefile.PL
executable file
·82 lines (69 loc) · 2 KB
/
Makefile.PL
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
use ExtUtils::MakeMaker;
use Getopt::Std;
getopts('d:rv:');
$opt_v ||= 1;
@scripts = grep {-f } glob("scripts/*");
# incantation to enable MY::pm_to_blib later on
if ($^O eq 'MSWin32')
{
@extras = (dist => { 'TO_UNIX' => 'perl -Mtounix -e "tounix(\"$(DISTVNAME)\")"' });
}
if ($^O eq 'linux')
{
*MY::postamble = sub
{
my ($self) = @_;
my ($res);
my ($package) = lc($self->{'NAME'});
my ($pversion) = $self->{'VERSION'};
my ($sha) = `git rev-parse --short HEAD`;
my ($sign) = '--auto-debsign' if ($opt_r);
my ($fpackage);
$sha =~ s/\s//g;
$package =~ s/::/-/g;
$package = "lib${package}-perl";
$pversion .= "+$sha" unless ($opt_r);
$fpackage = "$package-$pversion";
$res = <<"EOT";
deb-base: dist
rm -fr $self->{'DISTVNAME'}
rm -fr $fpackage
tar xvzf $self->{'DISTVNAME'}.tar.gz
mv $self->{'DISTVNAME'} $fpackage
tar cfz "${package}_$pversion.orig.tar.gz" $fpackage
cp -a debian $fpackage
cd $fpackage && find . -name .svn | xargs rm -rf
# make deb builds an interim deb from svn source for release
deb: deb-base
EOT
foreach $d (split(' ', $opt_d))
{
$res .= <<"EOT";
mkdir -p dists/$d
dch -D $d -v $pversion-$opt_v -m -b -c $fpackage/debian/changelog "Auto build from perl for $d"
cd $fpackage && pdebuild --buildresult ../dists/$d -- --basetgz /var/cache/pbuilder/base-$d.tgz $pbuilderopts{$d}
EOT
}
return $res;
}
}
WriteMakefile (
NAME => "Text::PDF",
VERSION_FROM => "lib/Text/PDF.pm",
# VERSION => "0.30",
EXE_FILES => \@scripts,
AUTHOR => "martin_hosken\@sil.org",
ABSTRACT => "PDF Manipulation and generation",
PREREQ_PM => {'Compress::Zlib' => 0},
META_MERGE => {
'meta-spec' => { version => 2 },
resources => {
repository => {
type => 'git',
url => 'https://github.com/silnrsi/text-pdf.git',
web => 'https://github.com/silnrsi/text-pdf',
}
}
},
@extras
);