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 2970 2009-10-26 18:36:22Z 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
) ;;
47 *) echo "not run from trunk checkout"; exit 1 ;;
50 if [ ! -d ..
/..
/tags
]; then
51 echo "tags directory missing"; exit 1
54 REV
=`(cd ../.. && svnversion)` ||
exit 1
55 if [ -z "`echo "$REV" | sed -n '/^[0-9][0-9]*$/p'`" ]; then
56 echo "Working directory not clean: $REV"; exit 1
60 VERSION
=`sed -n 's|^AC_INIT[^,]*, *\([0-9.]*\) *,.*$|\1|p' configure.in`
61 if [ -z "$VERSION" ]; then
62 echo "AC_INIT not found in configure.in"; exit 1
65 RELEASE
="RELEASE_${VERSION//\./_}"
68 VERSIONRC
="${VERSION}-${RC/#RC/rc}"
69 RELEASE
="${RELEASE}_${RC}"
72 if [ -e "../../tags/$RELEASE" ]; then
73 echo "tags/$RELEASE exists"; exit 1
76 echo "r$REV: Release $VERSIONRC $RELEASE"
80 smartmontools_release_date
=`date -u +"%Y-%m-%d"`
81 smartmontools_release_time
=`date -u +"%T %Z"`
82 cat configure.
in |
sed "s|smartmontools_release_date=.*|smartmontools_release_date=${smartmontools_release_date}|" > configure.tmp
83 cat configure.tmp |
sed "s|smartmontools_release_time=.*|smartmontools_release_time=\"${smartmontools_release_time}\"|" > configure.
in
86 # Create tag and commit
88 if [ "$COMMIT" = "yes" ]; then
89 svn mkdir tags
/$RELEASE
90 svn copy trunk
/smartmontools tags
/$RELEASE/smartmontools
91 svn commit
-m "Release $VERSIONRC $RELEASE"
93 cd trunk
/smartmontools
101 make distcheck ||
exit 1
102 make maintainer-clean
105 TARFILE
=smartmontools-
$VERSIONRC.
tar.gz
107 mv -f build
/smartmontools-
$VERSION.
tar.gz
$TARFILE
110 md5sum $TARFILE > $TARFILE.md5
111 sha1sum $TARFILE > $TARFILE.sha1
113 # Increase release number
114 if [ -z "$RC" ]; then
116 if [ "$COMMIT" = "yes" ]; then
117 perl
-p -i.bak
-e "s/$PERL_OLD/$PERL_NEW/" configure.
in
118 # svn commit -m "Bump release number to $NEW_VERSION" configure.in