]>
git.ipfire.org Git - thirdparty/squid.git/blob - mksnapshot.sh
4 echo "Usage: $0 [branch]"
5 echo "Where [branch] is the path under /bzr/ to the branch to snapshot."
10 BZRROOT
= ${BZRROOT:-/bzr}
12 # generate a tarball name from the branch ($1) note that trunk is at
13 # /bzr/trunk, but we call it 3.HEAD for consistency with CVS (squid 2.x), and
14 # branches are in /bzr/branches/ but we don't want 'branches/' in the tarball
15 # name so we strip that.
16 branchpath
= ${1:-trunk}
17 tag
= ${2:-`basename $branchpath`}
19 date = `env TZ=GMT date +%Y%m%d`
21 tmpdir
= ${TMPDIR:-${PWD}}/${module}-${tag} -mksnapshot
24 trap "echo FAIL-BUILD_ ${VERSION} ; rm -rf ${tmpdir} " 0
27 bzr
export ${tmpdir} ${BZRROOT}/${module}/${branchpath} ||
exit 1
28 if [ ! -f ${tmpdir} / configure
] && [ -f ${tmpdir} / configure.ac
]; then
29 sh
-c "cd ${tmpdir} && ./bootstrap.sh"
31 if [ ! -f ${tmpdir} / configure
]; then
32 echo "ERROR! Tag ${tag} not found in ${module} "
36 revision
= `bzr revno ${BZRROOT}/${module}/${branchpath} `
37 suffix
= " ${date} -r ${revision} "
38 eval `grep "^ *PACKAGE_VERSION=" configure | sed -e 's/-BZR//' | sed -e 's/PACKAGE_//'`
39 eval `grep "^ *PACKAGE_TARNAME=" configure | sed -e 's/_TARNAME//'`
40 ed
-s configure.ac
<<EOS
41 g/ ${VERSION}-[A-Z]*/ s//${VERSION}-${suffix} /
45 g/ ${VERSION}-[A-Z]*/ s//${VERSION}-${suffix} /
50 echo "PACKAGE: ${PACKAGE} "
51 echo "VERSION: ${VERSION} "
53 echo "REVISION: ${revision} "
54 echo "STARTDIR: ${startdir} "
55 echo "TMPDIR: ${tmpdir} "
57 .
/ test-builds.sh
--cleanup ||
exit 1
58 .
/ configure
--silent --enable-build-info = "DATE: ${date} REVISION: ${revision} "
61 webbase
=/ server
/ httpd
/ htdocs
/ squid-cache.org
/ content
/
62 basetarball
= ${webbase}/Versions/v`echo ${VERSION} | cut -d. -f1`/`echo ${VERSION} | cut -d. -f-2|cut -d- -f1`/${PACKAGE}-${VERSION} .
tar .bz2
64 echo "Building Tarball diff ( ${basetarball} ) ..."
65 if [ -f ${basetarball} ]; then
66 tar jxf
${PACKAGE}-${VERSION}-${suffix} .
tar .bz2
67 tar jxf
${basetarball}
68 echo "Differences from ${PACKAGE}-${VERSION} to ${PACKAGE}-${VERSION}-${suffix}" >${PACKAGE}-${VERSION}-${suffix} .diff
69 diff -ruN ${PACKAGE}-${VERSION} ${PACKAGE}-${VERSION}-${suffix} >>${PACKAGE}-${VERSION}-${suffix} .diff || true
71 echo " Building Tarball
diff ... skipped
( no tarball exists
) .
"
75 echo " Preparing to publish
: ${tmpdir}/${PACKAGE}-${VERSION}-${suffix} .
tar .
* ...
"
77 #echo " BUILT TARS
: " ; ls -1 ${tmpdir} /*.tar.* || true
79 cp -p ${tmpdir}/${PACKAGE}-${VERSION}-${suffix} .tar.gz .
80 echo ${PACKAGE}-${VERSION}-${suffix}.tar.gz >>${tag} .out
81 cp -p ${tmpdir}/${PACKAGE}-${VERSION}-${suffix} .tar.bz2 .
82 echo ${PACKAGE}-${VERSION}-${suffix}.tar.bz2 >>${tag} .out
83 if [ -f ${tmpdir}/${PACKAGE}-${VERSION}-${suffix} .diff ]; then
84 cp -p ${tmpdir}/${PACKAGE}-${VERSION}-${suffix} .diff .
85 echo ${PACKAGE}-${VERSION}-${suffix}.diff >>${tag} .out
88 relnotes= ${tmpdir} /doc/release-notes/release-`echo ${VERSION} | cut -d. -f1,2 | cut -d- -f1`.html
89 if [ -f ${relnotes} ]; then
90 cp -p ${relnotes} ${PACKAGE}-${VERSION}-${suffix} -RELEASENOTES.html
91 echo ${PACKAGE}-${VERSION}-${suffix}-RELEASENOTES.html >>${tag} .out
92 ed -s ${PACKAGE}-${VERSION}-${suffix} -RELEASENOTES.html <<EOF
93 g/" ChangeLog
"/ s//" ${PACKAGE}-${VERSION}-${suffix} -ChangeLog .txt
"/g
97 cp -p ${tmpdir}/ChangeLog ${PACKAGE}-${VERSION}-${suffix} -ChangeLog.txt
98 echo ${PACKAGE}-${VERSION}-${suffix}-ChangeLog.txt >>${tag} .out
100 # Generate Configuration Manual HTML
101 if [ -x ${tmpdir} /scripts/www/build-cfg-help.pl ]; then
102 make -C ${tmpdir} /src cf.data
103 mkdir -p ${tmpdir} /doc/cfgman
104 ${tmpdir}/scripts/www/build-cfg-help.pl --version ${VERSION} -o ${tmpdir}/doc/cfgman ${tmpdir} /src/cf.data
105 sh -c " cd ${tmpdir}/doc/cfgman && tar -zcf ${PWD}/${PACKAGE}-${VERSION}-${suffix} -cfgman .
tar .gz
* "
106 echo ${PACKAGE}-${VERSION}-${suffix}-cfgman.tar.gz >>${tag} .out
107 ${tmpdir}/scripts/www/build-cfg-help.pl --version ${VERSION} -o ${PACKAGE}-${VERSION}-${suffix}-cfgman.html -f singlehtml ${tmpdir} /src/cf.data
108 gzip -f -9 ${PACKAGE}-${VERSION}-${suffix} -cfgman.html
109 echo ${PACKAGE}-${VERSION}-${suffix}-cfgman.html.gz >>${tag} .out
112 # Collate Manual Pages and generate HTML versions
113 if (groff --help >/dev/null); then
114 make -C ${tmpdir} /src squid.8
115 if [ ! -d ${tmpdir} /doc/manuals ] ; then
116 mkdir -p ${tmpdir} /doc/manuals
118 for f in `ls -1 ${tmpdir}/helpers/*/*/*.8 ${tmpdir}/src/*.8 ${tmpdir}/src/*/*.8 ${tmpdir}/tools/*.1 ${tmpdir} /tools/*.8 ./helpers/*/*/*.8 2>/dev/null` ; do
119 cp $f ${tmpdir} /doc/manuals/
121 for f in `ls -1 ${tmpdir} /doc/manuals/*.1 ${tmpdir} /doc/manuals/*.8 2>/dev/null` ; do
122 cat ${f} | groff -E -Thtml -mandoc > ${f} .html
124 sh -c " cd ${tmpdir}/doc/manuals && tar -zcf ${PWD}/${PACKAGE}-${VERSION}-${suffix} -manuals .
tar .gz
* .html
* .1 * .8 "
125 echo ${PACKAGE}-${VERSION}-${suffix}-manuals.tar.gz >>${tag} .out
128 # Generate language-pack tarballs
129 # NP: Only to be done on trunk.
130 if test " ${tag} " = " trunk
" ; then
131 sh -c " cd ${tmpdir}/errors && tar -zcf ${PWD}/${PACKAGE}-${VERSION}-${suffix} -langpack .
tar .gz .
/*/* .
/ alias * .
/ TRANSLATORS .
/ COPYRIGHT
"
132 echo ${PACKAGE}-${VERSION}-${suffix}-langpack.tar.gz >>${tag} .out