2008-01-09 20:17:38 +01:00
|
|
|
#!/bin/sh
|
|
|
|
|
|
|
|
set -e
|
|
|
|
|
|
|
|
if [ ! -d src ] ; then
|
|
|
|
echo "Please run me in bip sources root." >&2
|
|
|
|
exit 1
|
|
|
|
fi
|
|
|
|
|
|
|
|
release="$1"
|
2011-09-13 04:55:17 +02:00
|
|
|
: ${MAKEOPTS:=-j -l4}
|
2008-01-09 20:17:38 +01:00
|
|
|
|
2011-09-13 04:55:17 +02:00
|
|
|
set_version() {
|
|
|
|
local release
|
|
|
|
release="${1}"
|
|
|
|
sed -i -e '/^AC_INIT/s/\(, \[\)[^]]*/\1'${release}'/' configure.ac
|
|
|
|
}
|
|
|
|
|
|
|
|
get_version() {
|
|
|
|
grep -e '^AC_INIT' configure.ac | cut -d [ -f 3 | cut -d ] -f 1
|
|
|
|
}
|
|
|
|
|
|
|
|
make_distcheck() {
|
|
|
|
if ! make ${MAKEOPTS} distcheck; then
|
|
|
|
echo "'make distcheck' fails, please try again." >&2
|
|
|
|
return 1
|
|
|
|
else
|
|
|
|
true
|
|
|
|
fi
|
|
|
|
}
|
|
|
|
|
|
|
|
git log > ChangeLog
|
|
|
|
if [ -n "$release" ]; then
|
|
|
|
set_version "${release}"
|
|
|
|
make_distcheck || exit 1
|
|
|
|
|
|
|
|
git commit -a -m "Update version and ChangeLog for bip-${release} release."
|
2013-10-19 12:52:04 +02:00
|
|
|
git tag -s release-$release
|
2011-09-13 04:55:17 +02:00
|
|
|
|
|
|
|
set_version "${release}-git"
|
|
|
|
git commit -a -m "Add -git to version string."
|
|
|
|
|
|
|
|
echo "See bip-${release}.tar.gz"
|
2008-01-09 20:17:38 +01:00
|
|
|
else
|
2011-09-13 04:55:17 +02:00
|
|
|
make_distcheck || exit 1
|
|
|
|
|
|
|
|
tarname=bip-$(get_version)
|
2008-01-09 20:17:38 +01:00
|
|
|
prefix=bip-$(date +%y%m%d)
|
|
|
|
|
2011-09-13 04:55:17 +02:00
|
|
|
rm -rf "${tarname}" "${prefix}"
|
|
|
|
tar -xzf "${tarname}".tar.gz
|
|
|
|
rm -rf "${tarname}".tar.gz
|
2008-01-09 20:18:27 +01:00
|
|
|
|
2011-09-13 04:55:17 +02:00
|
|
|
mv "${tarname}" "${prefix}"
|
|
|
|
tar -czf "${prefix}".tar.gz "${prefix}"
|
|
|
|
rm -rf "${prefix}"
|
|
|
|
|
|
|
|
# Revert the ChangeLog.
|
|
|
|
git checkout HEAD -- ChangeLog
|
|
|
|
|
|
|
|
echo "See ${prefix}.tar.gz"
|
|
|
|
fi
|