]> git.ipfire.org Git - thirdparty/squid.git/blame - mksnapshot.sh
Maintenance: remove unused asnAclInitialize declaration (#1633)
[thirdparty/squid.git] / mksnapshot.sh
CommitLineData
d128f8ab 1#!/bin/sh -e
a151895d 2#
b8ae064d 3## Copyright (C) 1996-2023 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
5b0e4b91 10echo "RUN: $0"
79d7c801 11if [ $# -lt 1 ]; then
7aef1654 12 echo "Usage: $0 [branch]"
8ed2615f 13 echo "Where [branch] is the name of the branch to snapshot."
7aef1654 14 exit 1
15fi
8ed2615f
AJ
16
17# generate a tarball name from the branch ($1)
18branch=${1:-master}
c79c8240 19startdir=${PWD}
10f7190b 20date=`env TZ=GMT date +%Y%m%d`
7aef1654 21
8ed2615f 22tmpdir=${TMPDIR:-${PWD}}/squid-${branch}-mksnapshot/
7aef1654 23
c79c8240 24rm -rf ${tmpdir}
9c1550be 25trap "echo FAIL-BUILD_${VERSION} ; rm -rf ${tmpdir}" 0
8ed2615f 26mkdir ${tmpdir}
7aef1654 27
8ed2615f
AJ
28rm -f ${branch}.out
29(git archive --format=tar ${branch} | tar -xC ${tmpdir}) || exit 1
a6093a2d 30if [ ! -f ${tmpdir}/configure ] && [ -f ${tmpdir}/configure.ac ]; then
c79c8240 31 sh -c "cd ${tmpdir} && ./bootstrap.sh"
045442b0 32fi
c79c8240 33if [ ! -f ${tmpdir}/configure ]; then
8ed2615f 34 echo "ERROR! Branch ${branch} not found."
7aef1654 35fi
36
c79c8240 37cd ${tmpdir}
8ed2615f 38revision=`git rev-parse --short ${branch}`
5b0e4b91 39suffix="${date}-r${revision}"
8ed2615f 40eval `grep "^ *PACKAGE_VERSION=" configure | sed -e 's/-VCS//' | sed -e 's/PACKAGE_//'`
a03cfcfc 41eval `grep "^ *PACKAGE_TARNAME=" configure | sed -e 's/_TARNAME//'`
a6093a2d 42ed -s configure.ac <<EOS
0ce25b4e 43g/${VERSION}-[A-Z]*/ s//${VERSION}-${suffix}/
7aef1654 44w
45EOS
46ed -s configure <<EOS
0ce25b4e 47g/${VERSION}-[A-Z]*/ s//${VERSION}-${suffix}/
7aef1654 48w
49EOS
50
79e0195d
A
51echo "STATE..."
52echo "PACKAGE: ${PACKAGE}"
53echo "VERSION: ${VERSION}"
8ed2615f 54echo "BRANCH: ${branch}"
0ce25b4e 55echo "REVISION: ${revision}"
79e0195d
A
56echo "STARTDIR: ${startdir}"
57echo "TMPDIR: ${tmpdir}"
58
787fb3fa 59## Ignore extra build layers. General features building is sufficient for snapshot release.
71ceb65f 60./test-builds.sh --cleanup layer-00-default layer-01-minimal layer-02-maximus || exit 1
4eb85b7a 61./configure --silent --enable-build-info="DATE: ${date} REVISION: ${revision}" --enable-translation
48b6e070 62make -s dist-all
7aef1654 63
3e16d6e1 64webbase=/server/httpd/htdocs/squid-cache.org/content/
c79c8240 65basetarball=${webbase}/Versions/v`echo ${VERSION} | cut -d. -f1`/`echo ${VERSION} | cut -d. -f-2|cut -d- -f1`/${PACKAGE}-${VERSION}.tar.bz2
3e16d6e1
A
66
67echo "Building Tarball diff (${basetarball}) ..."
c79c8240 68if [ -f ${basetarball} ]; then
0ce25b4e 69 tar jxf ${PACKAGE}-${VERSION}-${suffix}.tar.bz2
c79c8240 70 tar jxf ${basetarball}
0ce25b4e
AJ
71 echo "Differences from ${PACKAGE}-${VERSION} to ${PACKAGE}-${VERSION}-${suffix}" >${PACKAGE}-${VERSION}-${suffix}.diff
72 diff -ruN ${PACKAGE}-${VERSION} ${PACKAGE}-${VERSION}-${suffix} >>${PACKAGE}-${VERSION}-${suffix}.diff || true
3e16d6e1
A
73else
74 echo "Building Tarball diff ... skipped (no tarball exists)."
71ec6456
A
75fi
76
c79c8240 77cd ${startdir}
0ce25b4e 78echo "Preparing to publish: ${tmpdir}/${PACKAGE}-${VERSION}-${suffix}.tar.* ..."
48b6e070 79#echo "LOCAL: " ; pwd
c79c8240 80#echo "BUILT TARS: " ; ls -1 ${tmpdir}/*.tar.* || true
71ec6456 81
0ce25b4e 82cp -p ${tmpdir}/${PACKAGE}-${VERSION}-${suffix}.tar.gz .
8ed2615f 83echo ${PACKAGE}-${VERSION}-${suffix}.tar.gz >>${branch}.out
0ce25b4e 84cp -p ${tmpdir}/${PACKAGE}-${VERSION}-${suffix}.tar.bz2 .
8ed2615f 85echo ${PACKAGE}-${VERSION}-${suffix}.tar.bz2 >>${branch}.out
0ce25b4e
AJ
86if [ -f ${tmpdir}/${PACKAGE}-${VERSION}-${suffix}.diff ]; then
87 cp -p ${tmpdir}/${PACKAGE}-${VERSION}-${suffix}.diff .
8ed2615f 88 echo ${PACKAGE}-${VERSION}-${suffix}.diff >>${branch}.out
79325308 89fi
19be127e 90
3c34112d
AJ
91# latest Squid 'make' builds a RELEASENOTES.html at top directory
92relnotes=${tmpdir}/RELEASENOTES.html
93if [ ! -f ${relnotes} ]; then
94 # for older Squid-3.x versions we may need to move find the release notes by version
95 relnotes=${tmpdir}/doc/release-notes/release-`echo ${VERSION} | cut -d. -f1,2 | cut -d- -f1`.html
96fi
c79c8240 97if [ -f ${relnotes} ]; then
0ce25b4e 98 cp -p ${relnotes} ${PACKAGE}-${VERSION}-${suffix}-RELEASENOTES.html
8ed2615f 99 echo ${PACKAGE}-${VERSION}-${suffix}-RELEASENOTES.html >>${branch}.out
0ce25b4e
AJ
100 ed -s ${PACKAGE}-${VERSION}-${suffix}-RELEASENOTES.html <<EOF
101g/"ChangeLog"/ s//"${PACKAGE}-${VERSION}-${suffix}-ChangeLog.txt"/g
a6528f8d 102w
103EOF
c6a26ddb 104fi
0ce25b4e 105cp -p ${tmpdir}/ChangeLog ${PACKAGE}-${VERSION}-${suffix}-ChangeLog.txt
8ed2615f 106echo ${PACKAGE}-${VERSION}-${suffix}-ChangeLog.txt >>${branch}.out
b8da3ec1 107
12175206 108# Generate Configuration Manual HTML
c79c8240
AJ
109if [ -x ${tmpdir}/scripts/www/build-cfg-help.pl ]; then
110 make -C ${tmpdir}/src cf.data
111 mkdir -p ${tmpdir}/doc/cfgman
112 ${tmpdir}/scripts/www/build-cfg-help.pl --version ${VERSION} -o ${tmpdir}/doc/cfgman ${tmpdir}/src/cf.data
0ce25b4e 113 sh -c "cd ${tmpdir}/doc/cfgman && tar -zcf ${PWD}/${PACKAGE}-${VERSION}-${suffix}-cfgman.tar.gz *"
8ed2615f 114 echo ${PACKAGE}-${VERSION}-${suffix}-cfgman.tar.gz >>${branch}.out
0ce25b4e
AJ
115 ${tmpdir}/scripts/www/build-cfg-help.pl --version ${VERSION} -o ${PACKAGE}-${VERSION}-${suffix}-cfgman.html -f singlehtml ${tmpdir}/src/cf.data
116 gzip -f -9 ${PACKAGE}-${VERSION}-${suffix}-cfgman.html
8ed2615f 117 echo ${PACKAGE}-${VERSION}-${suffix}-cfgman.html.gz >>${branch}.out
b8da3ec1 118fi
d2669d90 119
12175206 120# Collate Manual Pages and generate HTML versions
7460890a 121if (groff --help >/dev/null); then
83915266 122 make -C ${tmpdir}/src squid.8
5406f265
AJ
123 if [ ! -d ${tmpdir}/doc/manuals ] ; then
124 mkdir -p ${tmpdir}/doc/manuals
125 fi
80cba6d3 126 for f in `ls -1 ${tmpdir}/helpers/*/*/*.8 ${tmpdir}/src/*.8 ${tmpdir}/src/*/*.8 ${tmpdir}/tools/*.8 ./helpers/*/*/*.8 2>/dev/null` ; do
12175206
AJ
127 cp $f ${tmpdir}/doc/manuals/
128 done
5406f265 129 for f in `ls -1 ${tmpdir}/doc/manuals/*.1 ${tmpdir}/doc/manuals/*.8 2>/dev/null` ; do
12175206
AJ
130 cat ${f} | groff -E -Thtml -mandoc >${f}.html
131 done
0ce25b4e 132 sh -c "cd ${tmpdir}/doc/manuals && tar -zcf ${PWD}/${PACKAGE}-${VERSION}-${suffix}-manuals.tar.gz *.html *.1 *.8"
8ed2615f 133 echo ${PACKAGE}-${VERSION}-${suffix}-manuals.tar.gz >>${branch}.out
12175206
AJ
134fi
135
d2669d90 136# Generate language-pack tarballs
0b696b9c
AJ
137# NP: Only useful on development branch
138sh -c "cd ${tmpdir}/errors && tar -zcf ${PWD}/${PACKAGE}-${VERSION}-${suffix}-langpack.tar.gz ./*/* ./alias* ./TRANSLATORS ./COPYRIGHT "
8ed2615f 139echo ${PACKAGE}-${VERSION}-${suffix}-langpack.tar.gz >>${branch}.out