]>
Commit | Line | Data |
---|---|---|
cccb93e3 | 1 | #!/bin/sh -ex |
a4572994 | 2 | if [ $# -ne 1 -a $# -ne 2 ]; then |
3 | echo "Usage: $0 revision [destination]" | |
95468954 | 4 | exit 1 |
f373d962 | 5 | fi |
39e4ea99 | 6 | # VCS details |
e14c0072 | 7 | module=squid3 |
39e4ea99 HN |
8 | BZRROOT=${BZRROOT:-/bzr} |
9 | ||
10 | # infer tags from command line details | |
11 | package=squid | |
95468954 | 12 | rev=`echo $1 | sed -e "s/^${package}-//"` |
13 | name=${package}-${rev} | |
14 | tag=`echo ${name} | tr a-z.- A-Z__` | |
a4572994 | 15 | startdir=$PWD/ |
16 | dst=${2:-$PWD}/ | |
f5386c09 | 17 | RELEASE_TIME=`date +%s` |
95468954 | 18 | |
fe4990f7 | 19 | # DPW 2007-08-30 |
20 | # | |
21 | # check that $rev has the right syntax | |
22 | # | |
7ed34ab7 | 23 | checkrev=`expr $rev : '\([0-9]\.[0-9]\.[0-9\.]*\)'` |
fe4990f7 | 24 | if test "$rev" != "$checkrev" ; then |
7ed34ab7 | 25 | echo "revision '$rev' has incorrect syntax. Should be like '3.1.0.1'" |
fe4990f7 | 26 | exit 1; |
27 | fi | |
28 | ||
bf97dee2 | 29 | tmpdir=${TMPDIR:-${PWD}}/${name}-mkrelease |
95468954 | 30 | |
95468954 | 31 | rm -rf $name.tar.gz $tmpdir |
32 | trap "rm -rf $tmpdir" 0 | |
33 | ||
7ed34ab7 AJ |
34 | # AYJ 2008-03-31: add the named tag for use below. |
35 | bzr tag $tag | |
36 | bzr export -r tag:$tag $tmpdir || exit 1 | |
37 | # | |
38 | # AYJ: 2008-03-31: initial export attempt dies on 'not a branch' error. | |
39 | # bzr export $tmpdir $BZRROOT/$module/tags/$tag || exit 1 | |
40 | # | |
41 | #bzr export $tmpdir $BZRROOT/$module/tags/$tag || exit 1 | |
42 | if [ ! -f $tmpdir/bootstrap.sh ]; then | |
e14c0072 | 43 | echo "ERROR! Tag $tag not found in $module" |
95468954 | 44 | fi |
45 | ||
46 | cd $tmpdir | |
7ed34ab7 | 47 | ./bootstrap.sh |
156251e6 AJ |
48 | eval `grep "^ *PACKAGE_VERSION=" configure | sed -e 's/-BZR//' | sed -e 's/PACKAGE_//'` |
49 | eval `grep "^ *PACKAGE_TARNAME=" configure | sed -e 's/_TARNAME//'` | |
95468954 | 50 | if [ ${name} != ${PACKAGE}-${VERSION} ]; then |
39e4ea99 | 51 | echo "ERROR! The tag and configure version numbers do not match!" |
95468954 | 52 | echo "${name} != ${PACKAGE}-${VERSION}" |
53 | exit 1 | |
54 | fi | |
cccb93e3 | 55 | RELEASE=`echo $VERSION | cut -d. -f1,2 | cut -d- -f1` |
c41fdab9 | 56 | ed -s configure.ac <<EOS |
39e4ea99 | 57 | g/${VERSION}-BZR/ s//${VERSION}/ |
95468954 | 58 | w |
59 | EOS | |
60 | ed -s configure <<EOS | |
39e4ea99 | 61 | g/${VERSION}-BZR/ s//${VERSION}/ |
95468954 | 62 | w |
63 | EOS | |
f5386c09 | 64 | ed -s include/version.h <<EOS |
65 | g/squid_curtime/ s//${RELEASE_TIME}/ | |
66 | w | |
67 | EOS | |
95468954 | 68 | |
69 | ./configure --silent | |
58b4f0d6 | 70 | make dist-all |
95468954 | 71 | |
72 | cd $startdir | |
d2eaa7f2 | 73 | inst() { |
74 | rm -f $2 | |
75 | cp -p $1 $2 | |
76 | chmod 444 $2 | |
77 | } | |
78 | inst $tmpdir/${name}.tar.gz $dst/${name}.tar.gz | |
79 | inst $tmpdir/${name}.tar.bz2 $dst/${name}.tar.bz2 | |
80 | inst $tmpdir/CONTRIBUTORS $dst/CONTRIBUTORS.txt | |
81 | inst $tmpdir/COPYING $dst/COPYING.txt | |
82 | inst $tmpdir/COPYRIGHT $dst/COPYRIGHT.txt | |
83 | inst $tmpdir/CREDITS $dst/CREDITS.txt | |
fa013f30 | 84 | inst $tmpdir/SPONSORS $dst/SPONSORS.txt |
d2eaa7f2 | 85 | inst $tmpdir/ChangeLog $dst/ChangeLog.txt |
cccb93e3 | 86 | if [ -f $tmpdir/doc/release-notes/release-$RELEASE.html ]; then |
d2eaa7f2 | 87 | cat $tmpdir/doc/release-notes/release-$RELEASE.html | sed -e ' |
88 | s/"ChangeLog"/"ChangeLog.txt"/g; | |
89 | ' > $tmpdir/RELEASENOTES.html | |
90 | touch -r $tmpdir/doc/release-notes/release-$RELEASE.html $tmpdir/RELEASENOTES.html | |
91 | inst $tmpdir/RELEASENOTES.html $dst/${name}-RELEASENOTES.html | |
92 | ln -sf ${name}-RELEASENOTES.html $dst/RELEASENOTES.html | |
cccb93e3 | 93 | fi |
f2cc7004 | 94 | if [ -f $dst/changesets/.update ]; then |
95 | rm -f $dst/changesets/$tag.html | |
96 | $dst/changesets/.update | |
b84e7b4c | 97 | fi |