3 # do a smartmontools release
4 # (C) 2003-11 Bruce Allen <ballen4705@users.sourceforge.net>,
5 # Guido Guenther <agx@sigxcpu.org>
6 # Christian Franke <smartmontools-support@lists.sourceforge.net>
7 # $Id: do_release 3282 2011-03-04 19:26:59Z chrfranke $
9 # Notes on generating releases:
11 # (2) update CHANGELOG -- put in release number
12 # (3) update release number in configure.in
13 # (4) to test, run without '--commit'
14 # (5) when satisfied, add option '--commit'
18 # Smartmontools Signing Key (through 2012)
23 MINOR
=`echo $VERSION | cut -d. -f2`
24 MAJOR
=`echo $VERSION | cut -d. -f1`
25 PERL_OLD
=$MAJOR\\.
$MINOR
27 NEW_VERSION
=$MAJOR.
$MINOR
28 PERL_NEW
=$MAJOR\\.
$MINOR
29 NEW_RELEASE
="RELEASE_${NEW_VERSION//\./_}"
30 echo "New Version: $NEW_VERSION"
31 echo "New Release: $NEW_RELEASE"
38 --commit) COMMIT
=yes; shift ;;
44 *) echo "Usage: $0 [--commit] RC[1-9]|FINAL"; exit 1 ;;
49 */trunk
/smartmontools
) WDROOT
="../.."; DIRPAT
="trunk" ;;
50 */branches
/*/smartmontools
) WDROOT
="../../.."; DIRPAT
="branches/*" ;;
51 *) echo "`/bin/pwd`: no trunk or branch working dir"; exit 1 ;;
54 if [ ! -d "$WDROOT/tags" ]; then
55 echo "tags directory missing"; exit 1
58 REVX
="`(cd $WDROOT && svnversion)`" ||
exit 1
59 REV
="${REVX/%[PM]/}"; REV
="${REV/%[PM]/}"
60 if [ -n "${REV//[0-9]/}" ]; then
61 echo "Working directory not clean: $REVX"; exit 1
64 (cd $WDROOT && svn status
) |
while read s
; do
65 case "`echo $s | tr -s ' '`" in
66 "M "$DIRPAT/smartmontools
/CHANGELOG
) echo "$s: OK";;
67 "M "$DIRPAT/smartmontools
/NEWS
) echo "$s: OK";;
68 "M "$DIRPAT/smartmontools
/configure.
in) echo "$s: OK";;
69 *) echo "$s: not allowed"; exit 1;;
77 VERSION
=`sed -n 's|^AC_INIT[^,]*, *\([0-9.]*\) *,.*$|\1|p' configure.in`
78 if [ -z "$VERSION" ]; then
79 echo "AC_INIT not found in configure.in"; exit 1
82 RELEASE
="RELEASE_${VERSION//\./_}"
85 VERSIONRC
="${VERSION}-${RC/#RC/rc}"
86 RELEASE
="${RELEASE}_${RC}"
89 if [ -e "$WDROOT/tags/$RELEASE" ]; then
90 echo "tags/$RELEASE exists"; exit 1
93 echo "r$REV: Release $VERSIONRC $RELEASE"
96 smartmontools_release_date
=`date -u +"%Y-%m-%d"`
97 smartmontools_release_time
=`date -u +"%T %Z"`
98 cat configure.
in |
sed "s|smartmontools_release_date=.*|smartmontools_release_date=${smartmontools_release_date}|" > configure.tmp
99 cat configure.tmp |
sed "s|smartmontools_release_time=.*|smartmontools_release_time=\"${smartmontools_release_time}\"|" > configure.
in
104 echo "==================================================================="
105 echo ">>> Continuing in 20 seconds ..."
109 # Create tag and commit
110 if [ "$COMMIT" = "yes" ]; then
111 svn mkdir
$WDROOT/tags
/$RELEASE
112 svn copy ..
/smartmontools
$WDROOT/tags
/$RELEASE/smartmontools
113 svn commit
-m "Release $VERSIONRC $RELEASE" $WDROOT
122 make distcheck ||
exit 1
123 make maintainer-clean
126 TARFILE
=smartmontools-
$VERSIONRC.
tar.gz
128 mv -f build
/smartmontools-
$VERSION.
tar.gz
$TARFILE
131 md5sum $TARFILE > $TARFILE.md5
133 # Increase release number
134 if [ -z "$RC" -a "$DIRPAT" = "trunk" ]; then
136 if [ "$COMMIT" = "yes" ]; then
137 perl
-p -i.bak
-e "s/$PERL_OLD/$PERL_NEW/" configure.
in
138 # svn commit -m "Bump release number to $NEW_VERSION" configure.in
143 if [ -n "$KEYID" ] && gpg
--list-secret-keys $KEYID >/dev
/null
2>/dev
/null
; then
144 gpg
--default-key $KEYID --armor --detach-sign .
/smartmontools-
$VERSIONRC.
tar.gz