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