]> git.ipfire.org Git - thirdparty/squid.git/blame - mkrelease.sh
ext_session_acl: cope with new logformat inputs
[thirdparty/squid.git] / mkrelease.sh
CommitLineData
cccb93e3 1#!/bin/sh -ex
a151895d 2#
2cd0bda2 3## Copyright (C) 1996-2017 The Squid Software Foundation and contributors
a151895d
AJ
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
cd6a9da6
AJ
63RELEASE=`echo $VERSION | cut -d. -f1,1 | cut -d- -f1`
64NOTES_VERSION=`grep "$VERSION" doc/release-notes/release-${RELEASE}.sgml`
d88bcf6b 65if test "x$NOTES_VERSION" = "x"; then
0bd5370a 66 echo "ERROR! Release Notes HTML version numbers do not match!"
d88bcf6b
AJ
67 exit 1
68fi
a6093a2d 69ed -s configure.ac <<EOS
39e4ea99 70g/${VERSION}-BZR/ s//${VERSION}/
95468954 71w
72EOS
73ed -s configure <<EOS
39e4ea99 74g/${VERSION}-BZR/ s//${VERSION}/
95468954 75w
76EOS
f5386c09 77ed -s include/version.h <<EOS
78g/squid_curtime/ s//${RELEASE_TIME}/
79w
80EOS
95468954 81
4eb85b7a 82./configure --silent --enable-translation
58b4f0d6 83make dist-all
95468954 84
85cd $startdir
d2eaa7f2 86inst() {
87rm -f $2
88cp -p $1 $2
89chmod 444 $2
90}
91inst $tmpdir/${name}.tar.gz $dst/${name}.tar.gz
92inst $tmpdir/${name}.tar.bz2 $dst/${name}.tar.bz2
93inst $tmpdir/CONTRIBUTORS $dst/CONTRIBUTORS.txt
94inst $tmpdir/COPYING $dst/COPYING.txt
78dd48ca 95inst $tmpdir/README $dst/README.txt
d2eaa7f2 96inst $tmpdir/CREDITS $dst/CREDITS.txt
bdb40e33 97inst $tmpdir/SPONSORS $dst/SPONSORS.txt
d2eaa7f2 98inst $tmpdir/ChangeLog $dst/ChangeLog.txt
cccb93e3 99if [ -f $tmpdir/doc/release-notes/release-$RELEASE.html ]; then
d2eaa7f2 100 cat $tmpdir/doc/release-notes/release-$RELEASE.html | sed -e '
101 s/"ChangeLog"/"ChangeLog.txt"/g;
102 ' > $tmpdir/RELEASENOTES.html
103 touch -r $tmpdir/doc/release-notes/release-$RELEASE.html $tmpdir/RELEASENOTES.html
104 inst $tmpdir/RELEASENOTES.html $dst/${name}-RELEASENOTES.html
105 ln -sf ${name}-RELEASENOTES.html $dst/RELEASENOTES.html
cccb93e3 106fi
f2cc7004 107if [ -f $dst/changesets/.update ]; then
108 rm -f $dst/changesets/$tag.html
109 $dst/changesets/.update
b84e7b4c 110fi