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