-
Notifications
You must be signed in to change notification settings - Fork 1
/
make_release.sh
executable file
·72 lines (60 loc) · 2.25 KB
/
make_release.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
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
#!/bin/sh
KEYID=91987C36
MAKEROOT=/home/build/tunnel
DIST=lenny
REPOSITORY=/opt/surfnetids/repositories/surfids
CHROOTBUILD=$MAKEROOT/chrootimg/$DIST.tgz
CHROOTTEST=$MAKEROOT/chrootimg/$DIST_test.tgz
MIRROR=http://ftp.nl.debian.org/debian
PACKAGE=surfids-tunnel
# Clean up previous build
cd $MAKEROOT
rm ${PACKAGE}_*
# Update or create the chroot environment
if [ -e $CHROOTBUILD ]
then
sudo pbuilder --update --basetgz $CHROOTBUILD --distribution $DIST --mirror $MIRROR
else
sudo pbuilder --create --basetgz $CHROOTBUILD --distribution $DIST --mirror $MIRROR
fi
## Update to latest version
# If this fails, please checkout the sensor trunk:
# cd $MAKEROOT
# svn co http://svn.ids.surfnet.nl/surfids/logserver/trunk
svn export http://svn.ids.surfnet.nl/surfids/tunnel/trunk $MAKEROOT/trunk/
cd $MAKEROOT/trunk
rm -rf $MAKEROOT/$PACKAGE/opt/surfnetids/
mkdir -p $MAKEROOT/$PACKAGE/opt/surfnetids/
mkdir -p $MAKEROOT/$PACKAGE/etc/surfnetids/
cp -R ./* $MAKEROOT/$PACKAGE/opt/surfnetids/
mv $MAKEROOT/$PACKAGE/opt/surfnetids/dhclient.conf $MAKEROOT/$PACKAGE/etc/surfnetids/
mv $MAKEROOT/$PACKAGE/opt/surfnetids/surfnetids-tn.conf $MAKEROOT/$PACKAGE/etc/surfnetids/
mv $MAKEROOT/$PACKAGE/opt/surfnetids/surfnetids-tn-apache.conf $MAKEROOT/$PACKAGE/etc/surfnetids/
mv $MAKEROOT/$PACKAGE/opt/surfnetids/scripts/surfnetids-dhclient.dist $MAKEROOT/$PACKAGE/opt/surfnetids/scripts/surfnetids-dhclient
chmod -x $MAKEROOT/$PACKAGE/etc/surfnetids/dhclient.conf
chmod -x $MAKEROOT/$PACKAGE/etc/surfnetids/surfnetids-tn-apache.conf
chmod -x $MAKEROOT/$PACKAGE/opt/surfnetids/openvpn-server.conf
chmod -x $MAKEROOT/$PACKAGE/opt/surfnetids/crontab.tn
rm -rf $MAKEROOT/trunk
cd $MAKEROOT/$PACKAGE
# Increment changelog entry
dch -i -m
#svn commit
## create the package
pdebuild -- --basetgz $CHROOTBUILD
#dpkg-deb --build $PACKAGE
### Test the package
#if [ -s $CHROOTTEST ]
#then
# sudo piuparts -b $CHROOTTEST -d $DIST *.deb -m $MIRROR
#else
# sudo piuparts -s $CHROOTTEST -d $DIST *.deb -m $MIRROR
# # check exit code
#fi
# Collect results and sign
cd $MAKEROOT
sudo mv /var/cache/pbuilder/result/${PACKAGE}_* .
debsign -k$KEYID ${PACKAGE}_*_i386.changes
# add package to repository
cd $REPOSITORY
sudo reprepro --keepunreferencedfiles include $DIST $MAKEROOT/$PACKAGE_*_i386.changes