]> git.proxmox.com Git - mirror_smartmontools-debian.git/blob - do_release
Imported smartmontools-5.37.cvs20061111
[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.39 2006/05/19 16:33:33 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 if [ -f /etc/redhat-release ]; then
21 RPM_BASE=/usr/src/redhat/
22 else
23 RPM_BASE=/usr/src/rpm/
24 fi
25 SOURCES=$RPM_BASE/SOURCES/
26
27 setup_cvs()
28 {
29 CVS_SERVER=fakevalue
30 unset CVS_SERVER || echo "can't unset CVS_SERVER=$CVS_SERVER"
31 CVS_RSH=ssh
32 CVSROOT=:ext:ballen4705@smartmontools.cvs.sourceforge.net:/cvsroot/smartmontools
33 }
34
35 get_release()
36 {
37 VERSION=`grep 'AC_INIT' configure.in | awk '{ print $2 }' | sed s/,//g`
38 RELEASE="RELEASE_${VERSION//\./_}"
39 echo "Version: $VERSION"
40 echo "Release: $RELEASE"
41 }
42
43 inc_release()
44 {
45 MINOR=`echo $VERSION | cut -d. -f2`
46 MAJOR=`echo $VERSION | cut -d. -f1`
47 PERL_OLD=$MAJOR\\.$MINOR
48 ((MINOR++))
49 NEW_VERSION=$MAJOR.$MINOR
50 PERL_NEW=$MAJOR\\.$MINOR
51 NEW_RELEASE="RELEASE_${NEW_VERSION//\./_}"
52 echo "New Version: $NEW_VERSION"
53 echo "New Release: $NEW_RELEASE"
54 }
55
56 # run automake/autoconf
57 if [ -f Makefile ] ; then
58 make distcheck || exit 1
59 make clean
60 make distclean
61 rm -f Makefile configure
62 fi
63
64 smartmontools_release_date=`date -u +"%Y/%m/%d"`
65 smartmontools_release_time=`date -u +"%T %Z"`
66 cat configure.in | sed "s|smartmontools_release_date=.*|smartmontools_release_date=${smartmontools_release_date}|" > configure.tmp
67 cat configure.tmp | sed "s|smartmontools_release_time=.*|smartmontools_release_time=\"${smartmontools_release_time}\"|" > configure.in
68 rm -f configure.tmp
69
70 ./autogen.sh
71
72 get_release
73
74 # tag CVS version
75 if [ $USECVS -ne 0 ] ; then
76 setup_cvs
77 cvs commit -m "Release $VERSION $RELEASE"
78 cvs tag -d $RELEASE
79 cvs tag $RELEASE
80 fi
81
82 # build .tar.gz
83 rm -rf build
84 mkdir build
85 cd build
86 ../configure
87 make distcheck || exit 1
88 cd ..
89 cp build/smartmontools-$VERSION.tar.gz $SOURCES
90
91 # build rpm
92 rpmbuild -ba --sign smartmontools.spec
93
94 # remove source tarball
95 rm -f $SOURCES/smartmontools-$VERSION.tar.gz
96
97 # increase release number:
98 inc_release
99 if [ $USECVS -ne 0 ] ; then
100 perl -p -i.bak -e "s/$PERL_OLD/$PERL_NEW/" configure.in
101 perl -p -i.bak -e "s/Version:\t$PERL_OLD/Version:\t$PERL_NEW/" smartmontools.spec
102 fi
103
104 mv -f $RPM_BASE/RPMS/i386/smartmontools-$VERSION-*.i386.rpm . || mv -f $RPM_BASE/RPMS/x86_64/smartmontools-$VERSION-*.x86_64.rpm .
105 mv -f $RPM_BASE/SRPMS/smartmontools-$VERSION-*.src.rpm .
106 cp -f build/smartmontools-$VERSION.tar.gz .
107 if [ "$KEYID" ]; then
108 gpg --default-key $KEYID --armor --detach-sign ./smartmontools-$VERSION.tar.gz
109 fi
110
111 # cleanup
112 rm -rf autom4te.cache build/ config.h.in Makefile.in examplescripts/Makefile.in \
113 depcomp mkinstalldirs install-sh configure aclocal.m4 missing *.bak