-
Notifications
You must be signed in to change notification settings - Fork 6
/
Copy pathMakefile.PL
69 lines (55 loc) · 1.63 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
use strict;
use warnings;
use ExtUtils::MakeMaker;
WriteMakefile
(
NAME => 'GUIDeFATE',
VERSION_FROM => 'lib/GUIDeFATE.pm',
AUTHOR => 'Saif Ahmed <saiftynet { at } gmail.com>',
ABSTRACT_FROM => 'man/GUIDeFATE.pod',
LICENSE => 'Perl',
PREREQ_PM => {
},
BUILD_REQUIRES => {
},
TEST_REQUIRES => {
'Test::More' => 1.001014,
},
dist => {
COMPRESS => 'bzip2 -f',
SUFFIX => 'bz2'
},
realclean => {FILES => "*.old *.bak *.tar.bz2 *.tar *.tar.gz *.spec Makefile debian/changelog"},
test => {TESTS => 't/*.t'},
);
# Specific part of the Makefile.
package MY;
sub dist_core {
my $dist = shift->SUPER::dist_core(@_);
$dist =~ s/^(\S.* :.*)/$1 perl-GUIDeFATE.spec debian\/changelog/mg;
$dist
}
sub dist_basics {
my $dist_basics = shift->SUPER::dist_basics(@_);
$dist_basics =~ s/^(manifest :)/$1 perl-GUIDeFATE.spec debian\/changelog/mg;
$dist_basics
}
sub postamble {
my $string = <<EOF;
debian/changelog :: debian/changelog.in
\tsed -e 's/__VERSION__/\$(VERSION)/' < \$< > \$@
perl-GUIDeFATE.spec :: perl-GUIDeFATE.spec.in
\tsed -e 's/__VERSION__/\$(VERSION)/' < \$< > \$@
deb :: dist
\tmkdir -p /tmp/scdeb
\tmv \$(NAME)-\$(VERSION).tar.bz2 /tmp/scdeb
\tcd /tmp/scdeb && tar -xvzf \$(NAME)-\$(VERSION).tar.bz2
\tcd /tmp/scdeb/\$(NAME)-\$(VERSION) && dpkg-buildpackage -rfakeroot -us -uc
\techo "Debian packages are available in /tmp/scdeb"
\trm -rf /tmp/scdeb/\$(NAME)-\$(VERSION)
rpm :: dist
\trpmbuild -tb --target noarch \$(NAME)-\$(VERSION).tar.bz2
srpm :: dist
\trpmbuild -ts --target noarch --nodeps \$(NAME)-\$(VERSION).tar.bz2
EOF
}