lilypond-1.3.122
[lilypond.git] / bin / release
blob7521b49f1150b9e23189fef72e4102adcd626177
1 #!/bin/sh
3 # script to automate releases
5 grep -q '^TOP' VERSION
6 res=$?
7 if test ! -f VERSION || test $res != 0; then
8 echo not in topleveldir
9 exit 1
10 fi
12 function setversion() {
13 eval `sed -n 's/^\([A-Z_]*\) *= *\(.*\)$/\1=\2/p' VERSION`
15 MJ=$TOPLEVEL_MAJOR_VERSION
16 MI=$TOPLEVEL_MINOR_VERSION
17 PA=$TOPLEVEL_PATCH_LEVEL
18 MP=$TOPLEVEL_MY_PATCH_LEVEL
19 NEWVER=$MJ.$MI.$PA$MP
20 if [ x$MP = x -o x$MP = xpre ]
21 then
22 LASTVER=$MJ.$MI.`expr $PA - 1`
24 if [ -f $releasedir//lilypond-$LASTVER""pre.tar.gz ] ; then
25 LASTVER="$LASTVER""pre"
27 else
28 LASTVER=$MJ.$MI.$PA
31 echo
32 echo "Current version ("`pwd`") is $NEWVER, Last version: $LASTVER"
33 echo
36 heredir=`pwd`
37 releasedir=`pwd`/../releases
38 patchdir=`pwd`/../patches
39 MAKE=${MAKE:-"make"}
40 TAR=${TAR:-"tar"}
43 $MAKE dist;
44 setversion
45 LILYVER=$NEWVER
47 tarball=lilypond-$LILYVER.tar.gz
48 patch=patch-$LILYVER.gz
50 mv $tarball $releasedir/
52 cd ../test
53 $heredir/bin/make-patch $LASTVER $NEWVER lilypond
54 gzip -f9 patch-$NEWVER
55 mv $patch $patchdir//
57 RPMS=`find ~/rpms/ -name lilypond-$NEWVER'*'rpm`
58 rm *.rpm {lilypond,patch}-*.gz
60 if [ ! -z "$RPMS" ]; then
61 ln $RPMS .
64 ln $releasedir//$tarball .
65 ln $patchdir//$patch .
68 if [ ! -z "$RPMS" ]; then
69 RPMS="lilypond-$LILYVER-1.i386.rpm lilypond-$LILYVER-1.src.rpm"
70 fi
71 $TAR cf updeet $tarball $patch $RPMS
72 $TAR tfv updeet