-
Notifications
You must be signed in to change notification settings - Fork 3
/
build-latest-spamassassin.sh
executable file
·51 lines (41 loc) · 1.55 KB
/
build-latest-spamassassin.sh
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
#!/bin/sh -e
DATE=`date +"%Y%m%d"`
DATE_822=`822-date`
if [ ! -f "Mail-SpamAssassin-3.0.0-cvs.tar.gz.$DATE" ]; then
echo -n "Downloading archive: "
wget http://spamassassin.apache.org/released/Mail-SpamAssassin-3.0.0-rc1.tar.bz2 2> /dev/null
mv Mail-SpamAssassin-3.0.0-rc1.tar.bz2 Mail-SpamAssassin-3.0.0-cvs.tar.bz2.$DATE
echo "done."
fi
if [ ! -d "Mail-SpamAssassin-3.0.0_$DATE" ]; then
echo -n "Unpacking archive: "
tar xjf Mail-SpamAssassin-3.0.0-cvs.tar.bz2.$DATE
mv Mail-SpamAssassin-3.0.0 Mail-SpamAssassin-3.0.0_$DATE
echo "done."
fi
echo -n "Preparing package: "
cd Mail-SpamAssassin-3.0.0_$DATE
REV=`rgrep -e 'EXTRA_VERSION.*$LastChangedRevision' . | grep -v strlen | sed -e 's@.*: @@' -e 's@ \$.*@@'`
mkdir ../spamassassin-3.0.0-r$REV ../spamassassin-3.0.0-r$REV.orig
find | cpio -p ../spamassassin-3.0.0-r$REV 2> /dev/null
find | cpio -p ../spamassassin-3.0.0-r$REV.orig 2> /dev/null
cd ../spamassassin-3.0.0-r$REV
cp -r ../.debian .
mv .debian debian
cat <<EOF > debian/changelog.new
spamassassin (3.0.0-r$REV-1) unstable; urgency=low
* New upstream release - CVS version of new devel tree ($DATE).
-- Turbo Fredriksson <turbo@debian.org> $DATE_822
EOF
cat debian/changelog >> debian/changelog.new
mv debian/changelog.new debian/changelog
echo "done."
echo -n "Building package: "
debuild -uc -us -sa > ../spamassassin-3.0.0-r$REV.build 2>&1
echo "done."
cd ..
DEB=`echo *$REV*.deb` ; CHANGES=`echo spamassassin_*$REV*.changes`
echo
echo "Directory: Mail-SpamAssassin-3.0.0_$DATE"
echo "Revision: $REV"
echo "DEB pkgs: $DEB"