]> git.ipfire.org Git - thirdparty/squid.git/blob - mkrelease.sh
NoNewGlobals for Adaptation::Config::metaHeaders (#1747)
[thirdparty/squid.git] / mkrelease.sh
1 #!/bin/sh -ex
2 #
3 ## Copyright (C) 1996-2023 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
10 if [ $# -ne 1 -a $# -ne 2 ]; then
11 echo "Usage: $0 revision [destination]"
12 exit 1
13 fi
14
15 # infer tags from command line details
16 package=squid
17 rev=`echo $1 | sed -e "s/^${package}-//"`
18 name=${package}-${rev}
19 tag=`echo ${name} | tr a-z.- A-Z__`
20 startdir=$PWD/
21 dst=${2:-$PWD}/
22 RELEASE_TIME=`date +%s`
23
24 # DPW 2007-08-30
25 #
26 # check that $rev has the right syntax
27 #
28 checkrev=`expr $rev : '\([0-9]\.[0-9]\(\.[0-9\.]\)*\)'`
29 if test "$rev" != "$checkrev" ; then
30 echo "revision '$rev' has incorrect syntax. Should be like '3.1.0.1'"
31 exit 1;
32 fi
33
34 po2html=`which po2html`
35 if test -z "$po2html" ; then
36 echo "cannot find po2html"
37 exit 1
38 fi
39 po2txt=`which po2txt`
40 if test -z "$po2txt" ; then
41 echo "cannot find po2txt"
42 exit 1
43 fi
44
45
46 tmpdir=${TMPDIR:-${PWD}}/${name}-mkrelease
47
48 rm -rf $name.tar.gz $tmpdir
49 trap "rm -rf $tmpdir" 0
50
51 mkdir ${tmpdir}
52 (git archive --format=tar HEAD | tar -xC ${tmpdir}) || exit 1
53
54 if [ ! -f $tmpdir/bootstrap.sh ]; then
55 echo "ERROR! Tag $tag not found"
56 fi
57
58 cd $tmpdir
59 ./bootstrap.sh
60 eval `grep "^ *PACKAGE_VERSION=" configure | sed -e 's/-VCS//' | sed -e 's/PACKAGE_//'`
61 eval `grep "^ *PACKAGE_TARNAME=" configure | sed -e 's/_TARNAME//'`
62 if [ ${name} != ${PACKAGE}-${VERSION} ]; then
63 echo "ERROR! The tag and configure version numbers do not match!"
64 echo "${name} != ${PACKAGE}-${VERSION}"
65 exit 1
66 fi
67 RELEASE=`echo $VERSION | cut -d. -f1,1 | cut -d- -f1`
68 ed -s configure.ac <<EOS
69 g/${VERSION}-VCS/ s//${VERSION}/
70 w
71 EOS
72 ed -s configure <<EOS
73 g/${VERSION}-VCS/ s//${VERSION}/
74 w
75 EOS
76 ed -s include/version.h <<EOS
77 g/squid_curtime/ s//${RELEASE_TIME}/
78 w
79 EOS
80
81 ./configure --silent --enable-translation
82 make dist-all
83
84 cd $startdir
85 inst() {
86 rm -f $2
87 cp -p $1 $2
88 chmod 444 $2
89 }
90 inst $tmpdir/${name}.tar.gz $dst/${name}.tar.gz
91 inst $tmpdir/${name}.tar.bz2 $dst/${name}.tar.bz2
92 inst $tmpdir/ChangeLog $dst/ChangeLog.txt
93 if [ -f $tmpdir/doc/release-notes/release-$RELEASE.html ]; then
94 inst $tmpdir/RELEASENOTES.html $dst/${name}-RELEASENOTES.html
95 ln -sf ${name}-RELEASENOTES.html $dst/RELEASENOTES.html
96 fi