]> git.proxmox.com Git - mirror_smartmontools-debian.git/blob - do_release
drop 30_gcc4.3.diff - fixed upstream
[mirror_smartmontools-debian.git] / do_release
1 #!/bin/bash -ev
2 #
3 # do a smartmontools release
4 # (C) 2003-6 Bruce Allen <ballen4705@users.sourceforge.net>,
5 # Guido Guenther <agx@sigxcpu.org>
6 # $Id: do_release,v 1.40 2006/12/19 19:25:42 chrfranke Exp $
7
8 # Notes on generating releases:
9 # (1) update NEWS
10 # (2) update CHANGELOG -- put in release number
11 # (3) update release number in configure.in and smartmontools.spec
12 # (4) update internal changelog in smartmontools.spec
13 # (5) to test, set USECVS below to 0
14 # (6) when satisfied, set USECVS below to 1
15
16 USECVS=1
17
18 KEYID=0x841ABAE8
19
20 setup_cvs()
21 {
22 CVS_SERVER=fakevalue
23 unset CVS_SERVER || echo "can't unset CVS_SERVER=$CVS_SERVER"
24 CVS_RSH=ssh
25 CVSROOT=:ext:ballen4705@smartmontools.cvs.sourceforge.net:/cvsroot/smartmontools
26 }
27
28 get_release()
29 {
30 VERSION=`grep 'AC_INIT' configure.in | awk '{ print $2 }' | sed s/,//g`
31 RELEASE="RELEASE_${VERSION//\./_}"
32 echo "Version: $VERSION"
33 echo "Release: $RELEASE"
34 }
35
36 inc_release()
37 {
38 MINOR=`echo $VERSION | cut -d. -f2`
39 MAJOR=`echo $VERSION | cut -d. -f1`
40 PERL_OLD=$MAJOR\\.$MINOR
41 ((MINOR++))
42 NEW_VERSION=$MAJOR.$MINOR
43 PERL_NEW=$MAJOR\\.$MINOR
44 NEW_RELEASE="RELEASE_${NEW_VERSION//\./_}"
45 echo "New Version: $NEW_VERSION"
46 echo "New Release: $NEW_RELEASE"
47 }
48
49 # run automake/autoconf
50 if [ -f Makefile ] ; then
51 make distcheck || exit 1
52 make clean
53 make distclean
54 rm -f Makefile configure
55 fi
56
57 smartmontools_release_date=`date -u +"%Y/%m/%d"`
58 smartmontools_release_time=`date -u +"%T %Z"`
59 cat configure.in | sed "s|smartmontools_release_date=.*|smartmontools_release_date=${smartmontools_release_date}|" > configure.tmp
60 cat configure.tmp | sed "s|smartmontools_release_time=.*|smartmontools_release_time=\"${smartmontools_release_time}\"|" > configure.in
61 rm -f configure.tmp
62
63 ./autogen.sh
64
65 get_release
66
67 # tag CVS version
68 if [ $USECVS -ne 0 ] ; then
69 setup_cvs
70 cvs commit -m "Release $VERSION $RELEASE"
71 cvs tag -d $RELEASE
72 cvs tag $RELEASE
73 fi
74
75 # build .tar.gz
76 rm -rf build
77 mkdir build
78 cd build
79 ../configure
80 make distcheck || exit 1
81 cd ..
82
83 # increase release number:
84 inc_release
85 if [ $USECVS -ne 0 ] ; then
86 perl -p -i.bak -e "s/$PERL_OLD/$PERL_NEW/" configure.in
87 perl -p -i.bak -e "s/Version:\t$PERL_OLD/Version:\t$PERL_NEW/" smartmontools.spec
88 fi
89
90 cp -f build/smartmontools-$VERSION.tar.gz .
91 if [ "$KEYID" ]; then
92 gpg --default-key $KEYID --armor --detach-sign ./smartmontools-$VERSION.tar.gz
93 fi
94
95 # cleanup
96 rm -rf autom4te.cache build/ config.h.in Makefile.in examplescripts/Makefile.in \
97 depcomp mkinstalldirs install-sh configure config.guess config.sub \
98 aclocal.m4 missing *.bak