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