3 # do a smartmontools release
4 # (C) 2003-11 Bruce Allen, Guido Guenther
5 # (C) 2006-15 Christian Franke
6 # $Id: do_release 4071 2015-04-26 18:25:12Z chrfranke $
8 # Notes on generating releases:
10 # (2) update ChangeLog -- put in release number
11 # (3) update release number in configure.ac
12 # (4) to test, run without '--commit'
13 # (5) when satisfied, add option '--commit'
17 # Smartmontools Signing Key (through 2016)
22 MINOR
=`echo $VERSION | cut -d. -f2`
23 MAJOR
=`echo $VERSION | cut -d. -f1`
24 PERL_OLD
=$MAJOR\\.
$MINOR
26 NEW_VERSION
=$MAJOR.
$MINOR
27 PERL_NEW
=$MAJOR\\.
$MINOR
28 NEW_RELEASE
="RELEASE_${NEW_VERSION//\./_}"
29 echo "New Version: $NEW_VERSION"
30 echo "New Release: $NEW_RELEASE"
37 --commit) COMMIT
=yes; shift ;;
43 *) echo "Usage: $0 [--commit] RC[1-9]|FINAL"; exit 1 ;;
48 */trunk
/smartmontools
) WDROOT
="../.."; DIRPAT
="trunk" ;;
49 */branches
/*/smartmontools
) WDROOT
="../../.."; DIRPAT
="branches/*" ;;
50 *) echo "`/bin/pwd`: no trunk or branch working dir"; exit 1 ;;
53 if [ ! -d "$WDROOT/tags" ]; then
54 echo "tags directory missing"; exit 1
57 REVX
="`(cd $WDROOT && svnversion)`" ||
exit 1
58 REV
="${REVX/%[PM]/}"; REV
="${REV/%[PM]/}"
59 if [ -n "${REV//[0-9]/}" ]; then
60 echo "Working directory not clean: $REVX"; exit 1
63 (cd $WDROOT && svn status
) |
while read s
; do
64 case "`echo $s | tr -s ' '`" in
65 "M "$DIRPAT/smartmontools
/ChangeLog
) echo "$s: OK";;
66 "M "$DIRPAT/smartmontools
/NEWS
) echo "$s: OK";;
67 "M "$DIRPAT/smartmontools
/configure.ac
) echo "$s: OK";;
68 *) echo "$s: not allowed"; exit 1;;
76 VERSION
=`sed -n 's|^AC_INIT[^,]*, *\([0-9.]*\) *,.*$|\1|p' configure.ac`
77 if [ -z "$VERSION" ]; then
78 echo "AC_INIT not found in configure.ac"; exit 1
81 RELEASE
="RELEASE_${VERSION//\./_}"
84 VERSIONRC
="${VERSION}-${RC/#RC/rc}"
85 RELEASE
="${RELEASE}_${RC}"
88 if [ -e "$WDROOT/tags/$RELEASE" ]; then
89 echo "tags/$RELEASE exists"; exit 1
92 echo "r$REV: Release $VERSIONRC $RELEASE"
95 smartmontools_release_date
=`date -u +"%Y-%m-%d"`
96 smartmontools_release_time
=`date -u +"%T %Z"`
97 cat configure.ac |
sed "s|smartmontools_release_date=.*|smartmontools_release_date=${smartmontools_release_date}|" > configure.tmp
98 cat configure.tmp |
sed "s|smartmontools_release_time=.*|smartmontools_release_time=\"${smartmontools_release_time}\"|" > configure.ac
103 echo "==================================================================="
104 echo ">>> Continuing in 20 seconds ..."
108 # Create tag and commit
109 if [ "$COMMIT" = "yes" ]; then
110 svn mkdir
$WDROOT/tags
/$RELEASE
111 svn copy ..
/smartmontools
$WDROOT/tags
/$RELEASE/smartmontools
112 svn commit
-m "Release $VERSIONRC $RELEASE" $WDROOT
121 make distcheck ||
exit 1
122 make maintainer-clean
125 TARFILE
=smartmontools-
$VERSIONRC.
tar.gz
127 mv -f build
/smartmontools-
$VERSION.
tar.gz
$TARFILE
130 md5sum $TARFILE > $TARFILE.md5
132 # Increase release number
133 if [ -z "$RC" -a "$DIRPAT" = "trunk" ]; then
135 if [ "$COMMIT" = "yes" ]; then
136 perl
-p -i.bak
-e "s/$PERL_OLD/$PERL_NEW/" configure.ac
137 # svn commit -m "Bump release number to $NEW_VERSION" configure.ac
142 if [ -n "$KEYID" ] && gpg
--list-secret-keys $KEYID >/dev
/null
2>/dev
/null
; then
143 gpg
--default-key $KEYID --armor --detach-sign .
/smartmontools-
$VERSIONRC.
tar.gz