]> git.proxmox.com Git - mirror_smartmontools-debian.git/blobdiff - do_release
Imported Upstream version 6.1+svn3812
[mirror_smartmontools-debian.git] / do_release
index 967f9b7ce4d766a77307b7e1e0c27324e2d4efb7..f88d4a43a497c1cb096629e239e59454926b036f 100755 (executable)
@@ -1,26 +1,29 @@
 #!/bin/bash
 #
 # do a smartmontools release
-# (C) 2003-9 Bruce Allen <ballen4705@users.sourceforge.net>,
-#            Guido Guenther <agx@sigxcpu.org>
-#            Christian Franke <smartmontools-support@lists.sourceforge.net>
-# $Id: do_release 2997 2009-12-11 21:25:59Z chrfranke $
+# (C) 2003-11 Bruce Allen <ballen4705@users.sourceforge.net>,
+#             Guido Guenther <agx@sigxcpu.org>
+# (C) 2006-13 Christian Franke <smartmontools-support@lists.sourceforge.net>
+# $Id: do_release 3765 2013-02-05 17:17:13Z chrfranke $
 
 # Notes on generating releases:
 # (1) update NEWS
-# (2) update CHANGELOG -- put in release number
-# (3) update release number in configure.in 
+# (2) update ChangeLog -- put in release number
+# (3) update release number in configure.ac
 # (4) to test, run without '--commit'
 # (5) when satisfied, add option '--commit'
 
 set -e
 
+# Smartmontools Signing Key (through 2014)
+KEYID=0x8F6ED8AA
+
 inc_release()
 {
   MINOR=`echo $VERSION | cut -d. -f2`
   MAJOR=`echo $VERSION | cut -d. -f1`
   PERL_OLD=$MAJOR\\.$MINOR
-  ((MINOR++))
+  ((++MINOR))
   NEW_VERSION=$MAJOR.$MINOR
   PERL_NEW=$MAJOR\\.$MINOR     
   NEW_RELEASE="RELEASE_${NEW_VERSION//\./_}"
@@ -59,10 +62,10 @@ if [ -n "${REV//[0-9]/}" ]; then
 fi
 
 (cd $WDROOT && svn status) | while read s; do
-  case "$s" in
-    "M       "$DIRPAT/smartmontools/CHANGELOG)    echo "$s: OK";;
-    "M       "$DIRPAT/smartmontools/NEWS)         echo "$s: OK";;
-    "M       "$DIRPAT/smartmontools/configure.in) echo "$s: OK";;
+  case "`echo $s | tr -s ' '`" in
+    "M "$DIRPAT/smartmontools/ChangeLog)    echo "$s: OK";;
+    "M "$DIRPAT/smartmontools/NEWS)         echo "$s: OK";;
+    "M "$DIRPAT/smartmontools/configure.ac) echo "$s: OK";;
     *) echo "$s: not allowed"; exit 1;;
   esac
 done
@@ -71,9 +74,9 @@ if [ $? -ne 0 ]; then
 fi
 
 # Get release number
-VERSION=`sed -n 's|^AC_INIT[^,]*, *\([0-9.]*\) *,.*$|\1|p' configure.in`
+VERSION=`sed -n 's|^AC_INIT[^,]*, *\([0-9.]*\) *,.*$|\1|p' configure.ac`
 if [ -z "$VERSION" ]; then
-  echo "AC_INIT not found in configure.in"; exit 1
+  echo "AC_INIT not found in configure.ac"; exit 1
 fi
 VERSIONRC="$VERSION"
 RELEASE="RELEASE_${VERSION//\./_}"
@@ -92,8 +95,8 @@ echo "r$REV: Release $VERSIONRC $RELEASE"
 # Update timestamp
 smartmontools_release_date=`date -u +"%Y-%m-%d"`
 smartmontools_release_time=`date -u +"%T %Z"`
-cat configure.in  | sed "s|smartmontools_release_date=.*|smartmontools_release_date=${smartmontools_release_date}|" > configure.tmp
-cat configure.tmp | sed "s|smartmontools_release_time=.*|smartmontools_release_time=\"${smartmontools_release_time}\"|" > configure.in
+cat configure.ac  | sed "s|smartmontools_release_date=.*|smartmontools_release_date=${smartmontools_release_date}|" > configure.tmp
+cat configure.tmp | sed "s|smartmontools_release_time=.*|smartmontools_release_time=\"${smartmontools_release_time}\"|" > configure.ac
 rm -f configure.tmp
 
 # Review changes
@@ -126,14 +129,18 @@ mv -f build/smartmontools-$VERSION.tar.gz $TARFILE
 rm -rvf build
 
 md5sum $TARFILE > $TARFILE.md5
-sha1sum $TARFILE > $TARFILE.sha1
 
 # Increase release number
 if [ -z "$RC" -a "$DIRPAT" = "trunk" ]; then
   inc_release
   if [ "$COMMIT" = "yes" ]; then
-    perl -p -i.bak -e "s/$PERL_OLD/$PERL_NEW/" configure.in
-    # svn commit -m "Bump release number to $NEW_VERSION" configure.in
+    perl -p -i.bak -e "s/$PERL_OLD/$PERL_NEW/" configure.ac
+    # svn commit -m "Bump release number to $NEW_VERSION" configure.ac
   fi
 fi
 
+# Sign tarball
+if [ -n "$KEYID" ] && gpg --list-secret-keys $KEYID >/dev/null 2>/dev/null; then
+  gpg --default-key $KEYID --armor --detach-sign ./smartmontools-$VERSIONRC.tar.gz
+fi
+