Enter namespaces before context setup.
[util-vserver.git] / mkrelease
1 #!/bin/bash
2
3 proj="util-vserver"
4 rwroot="svn+ssh://svn.linux-vserver.org/var/svn/${proj}"
5 roroot="http://svn.linux-vserver.org/svn/${proj}"
6
7 usage() {
8         echo "Usage: mkrelease"
9 }
10
11 die() {
12         echo $1
13         exit ${2:-1}
14 }
15
16 TMP=`mktemp -d`
17 cd "$TMP"
18 svn co ${roroot}/trunk || die "svn co failed"
19 cd trunk
20
21 ver=`grep AC_INIT configure.ac | awk '{ print $2 }'`
22 ver=${ver/,}
23
24 echo ">>> create release tag"
25
26 svn copy ${rwroot}/trunk ${rwroot}/tags/release-${ver} \
27         -m "Tagging the ${ver} release of the ${proj} project" || die "svn copy failed"
28
29
30 echo ">>> bootstrap sources"
31
32 make -f Makefile.svn || die "make failed"
33
34 echo ">>> create release tarball"
35
36 ./configure --sysconfdir=/etc --prefix=/usr --localstatedir=/var || die "configure failed"
37 make dist || die "make dist failed"
38
39 for i in *.tar.bz2; do
40         gpg --detach-sign --armor $i || die "signing failed"
41 done
42
43 echo ">>> uploading tarball and signature"
44
45 scp -p *.tar.bz2* ftp.linux-vserver.org:/var/ftp/pub/utils/util-vserver || die "scp failed"
46
47 cd /
48 rm -fr "$TMP"