-
Notifications
You must be signed in to change notification settings - Fork 8
/
Copy pathbuild
executable file
·56 lines (49 loc) · 885 Bytes
/
build
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
#!/bin/bash
set +x
f="cpan2rpm"
v=$(./$f -V)
#
# makes sure we've documented changes before building
#
grep -q "^$v" Changes || {
echo "No Changes entry for version $v"
exit
}
#
# makes the man page
#
pod2html $f --title $f > man.pod
perl -e '
$/ = undef;
$_ = <>;
s|<LI><A HREF="#name">NAME</A></LI>||;
s/<H1><A NAME="name">NAME.*?<HR>//s;
#s/<!-- INDEX BEGIN -->/<H1>cpan2rpm - A Perl module packager<\/H1>/;
print;
' man.pod | perl -e '
@f = <>;
for ($i = 12; $i < scalar(@f) - 4; $i++) {
print $f[$i];
};
' > man.html
rm -f man.pod pod2htm?.*
# [[ -e META.yml ]] && rm -f META.yml
#
# create the makefile
#
perl Makefile.PL
#
# run the makefile, create distribution package
#
make
make dist
#
# build rpm from tarball
#
tarball="$f-$v.tar.gz"
[[ -e $tarball ]] || {
echo "No tarball made!"
exit -1
}
rpmbuild --sign -ta $tarball
echo "Done"