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