1. Summary
  2. Files
  3. Support
  4. Report Spam
  5. Create account
  6. Log in

root/trunk/smartmontools/do_release @ 3645

Revision 3645, 3.7 KB (checked in by chrfranke, 18 months ago)

Rename old CHANGELOG to ChangeLog?-5.0-6.0.
Start new ChangeLog?.

  • Property svn:eol-style set to native
  • Property svn:executable set to *
  • Property svn:keywords set to Id
Line 
1#!/bin/bash
2#
3# do a smartmontools release
4# (C) 2003-11 Bruce Allen <ballen4705@users.sourceforge.net>,
5#             Guido Guenther <agx@sigxcpu.org>
6# (C) 2006-12 Christian Franke <smartmontools-support@lists.sourceforge.net>
7# $Id$
8
9# Notes on generating releases:
10# (1) update NEWS
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'
15
16set -e
17
18# Smartmontools Signing Key (through 2012)
19KEYID=0x2753E77A
20
21inc_release()
22{
23  MINOR=`echo $VERSION | cut -d. -f2`
24  MAJOR=`echo $VERSION | cut -d. -f1`
25  PERL_OLD=$MAJOR\\.$MINOR
26  ((++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"
32}
33
34COMMIT=
35RC=
36
37case "$1" in
38  --commit) COMMIT=yes; shift ;;
39esac
40
41case "$*" in
42  RC[1-9]) RC="$1" ;;
43  FINAL) ;;
44  *) echo "Usage: $0 [--commit] RC[1-9]|FINAL"; exit 1 ;;
45esac
46
47# Check workdir
48case "`/bin/pwd`" in
49  */trunk/smartmontools)      WDROOT="../..";    DIRPAT="trunk"      ;;
50  */branches/*/smartmontools) WDROOT="../../.."; DIRPAT="branches/*" ;;
51  *) echo "`/bin/pwd`: no trunk or branch working dir"; exit 1 ;;
52esac
53
54if [ ! -d "$WDROOT/tags" ]; then
55  echo "tags directory missing"; exit 1
56fi
57
58REVX="`(cd $WDROOT && svnversion)`" || exit 1
59REV="${REVX/%[PM]/}"; REV="${REV/%[PM]/}"
60if [ -n "${REV//[0-9]/}" ]; then
61  echo "Working directory not clean: $REVX"; exit 1
62fi
63
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;;
70  esac
71done
72if [ $? -ne 0 ]; then
73  exit 1
74fi
75
76# Get release number
77VERSION=`sed -n 's|^AC_INIT[^,]*, *\([0-9.]*\) *,.*$|\1|p' configure.in`
78if [ -z "$VERSION" ]; then
79  echo "AC_INIT not found in configure.in"; exit 1
80fi
81VERSIONRC="$VERSION"
82RELEASE="RELEASE_${VERSION//\./_}"
83
84if [ "$RC" ]; then
85  VERSIONRC="${VERSION}-${RC/#RC/rc}"
86  RELEASE="${RELEASE}_${RC}"
87fi
88
89if [ -e "$WDROOT/tags/$RELEASE" ]; then
90  echo "tags/$RELEASE exists"; exit 1
91fi
92
93echo "r$REV: Release $VERSIONRC $RELEASE"
94
95# Update timestamp
96smartmontools_release_date=`date -u +"%Y-%m-%d"`
97smartmontools_release_time=`date -u +"%T %Z"`
98cat configure.in  | sed "s|smartmontools_release_date=.*|smartmontools_release_date=${smartmontools_release_date}|" > configure.tmp
99cat configure.tmp | sed "s|smartmontools_release_time=.*|smartmontools_release_time=\"${smartmontools_release_time}\"|" > configure.in
100rm -f configure.tmp
101
102# Review changes
103svn diff
104echo "==================================================================="
105echo ">>> Continuing in 20 seconds ..."
106sleep 20
107set -v
108
109# Create tag and commit
110if [ "$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
114fi
115
116# Build
117./autogen.sh
118
119mkdir build
120cd build
121../configure
122make distcheck || exit 1
123make maintainer-clean
124cd ..
125
126TARFILE=smartmontools-$VERSIONRC.tar.gz
127
128mv -f build/smartmontools-$VERSION.tar.gz $TARFILE
129rm -rvf build
130
131md5sum $TARFILE > $TARFILE.md5
132
133# Increase release number
134if [ -z "$RC" -a "$DIRPAT" = "trunk" ]; then
135  inc_release
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
139  fi
140fi
141
142# Sign tarball
143if [ -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
145fi
146
Note: See TracBrowser for help on using the browser.