3 # do a smartmontools release
4 # (C) 2003-9 Bruce Allen <ballen4705@users.sourceforge.net>,
5 # Guido Guenther <agx@sigxcpu.org>
6 # Christian Franke <smartmontools-support@lists.sourceforge.net>
7 # $Id: do_release 2997 2009-12-11 21:25: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'
20 MINOR
=`echo $VERSION | cut -d. -f2`
21 MAJOR
=`echo $VERSION | cut -d. -f1`
22 PERL_OLD
=$MAJOR\\.
$MINOR
24 NEW_VERSION
=$MAJOR.
$MINOR
25 PERL_NEW
=$MAJOR\\.
$MINOR
26 NEW_RELEASE
="RELEASE_${NEW_VERSION//\./_}"
27 echo "New Version: $NEW_VERSION"
28 echo "New Release: $NEW_RELEASE"
35 --commit) COMMIT
=yes; shift ;;
41 *) echo "Usage: $0 [--commit] RC[1-9]|FINAL"; exit 1 ;;
46 */trunk
/smartmontools
) WDROOT
="../.."; DIRPAT
="trunk" ;;
47 */branches
/*/smartmontools
) WDROOT
="../../.."; DIRPAT
="branches/*" ;;
48 *) echo "`/bin/pwd`: no trunk or branch working dir"; exit 1 ;;
51 if [ ! -d "$WDROOT/tags" ]; then
52 echo "tags directory missing"; exit 1
55 REVX
="`(cd $WDROOT && svnversion)`" ||
exit 1
56 REV
="${REVX/%[PM]/}"; REV
="${REV/%[PM]/}"
57 if [ -n "${REV//[0-9]/}" ]; then
58 echo "Working directory not clean: $REVX"; exit 1
61 (cd $WDROOT && svn status
) |
while read s
; do
63 "M "$DIRPAT/smartmontools
/CHANGELOG
) echo "$s: OK";;
64 "M "$DIRPAT/smartmontools
/NEWS
) echo "$s: OK";;
65 "M "$DIRPAT/smartmontools
/configure.
in) echo "$s: OK";;
66 *) echo "$s: not allowed"; exit 1;;
74 VERSION
=`sed -n 's|^AC_INIT[^,]*, *\([0-9.]*\) *,.*$|\1|p' configure.in`
75 if [ -z "$VERSION" ]; then
76 echo "AC_INIT not found in configure.in"; exit 1
79 RELEASE
="RELEASE_${VERSION//\./_}"
82 VERSIONRC
="${VERSION}-${RC/#RC/rc}"
83 RELEASE
="${RELEASE}_${RC}"
86 if [ -e "$WDROOT/tags/$RELEASE" ]; then
87 echo "tags/$RELEASE exists"; exit 1
90 echo "r$REV: Release $VERSIONRC $RELEASE"
93 smartmontools_release_date
=`date -u +"%Y-%m-%d"`
94 smartmontools_release_time
=`date -u +"%T %Z"`
95 cat configure.
in |
sed "s|smartmontools_release_date=.*|smartmontools_release_date=${smartmontools_release_date}|" > configure.tmp
96 cat configure.tmp |
sed "s|smartmontools_release_time=.*|smartmontools_release_time=\"${smartmontools_release_time}\"|" > configure.
in
101 echo "==================================================================="
102 echo ">>> Continuing in 20 seconds ..."
106 # Create tag and commit
107 if [ "$COMMIT" = "yes" ]; then
108 svn mkdir
$WDROOT/tags
/$RELEASE
109 svn copy ..
/smartmontools
$WDROOT/tags
/$RELEASE/smartmontools
110 svn commit
-m "Release $VERSIONRC $RELEASE" $WDROOT
119 make distcheck ||
exit 1
120 make maintainer-clean
123 TARFILE
=smartmontools-
$VERSIONRC.
tar.gz
125 mv -f build
/smartmontools-
$VERSION.
tar.gz
$TARFILE
128 md5sum $TARFILE > $TARFILE.md5
129 sha1sum $TARFILE > $TARFILE.sha1
131 # Increase release number
132 if [ -z "$RC" -a "$DIRPAT" = "trunk" ]; then
134 if [ "$COMMIT" = "yes" ]; then
135 perl
-p -i.bak
-e "s/$PERL_OLD/$PERL_NEW/" configure.
in
136 # svn commit -m "Bump release number to $NEW_VERSION" configure.in