]> git.donarmstrong.com Git - lilypond.git/blob - stepmake/bin/stepmakeise.sh
Make distributed tarball from Git file list
[lilypond.git] / stepmake / bin / stepmakeise.sh
1 #!/bin/sh
2 # stepmakeise.sh
3
4 help () {
5         cat <<EOF
6 Usage: ../stepmake-x.x.x/bin/stepmakeise.sh
7 Include or update package's StepMake.
8 EOF
9 }
10
11 name=`basename $0`
12 reldir=../releases
13 stepbin=`dirname $0`
14
15 if [ $# -ne 0 ]; then
16         help
17         exit 2
18 fi
19
20 value ()
21 {
22     expression=`echo $1 | sed 's/\./ \\\\\* 100 + /g'`
23     # urg?  $1=`expr $expression`
24     urg=/tmp/stepmakeise.$$
25     echo expr $expression > $urg
26     echo `. $urg`
27     rm -f $urg
28 }
29
30 if [ -r stepmake ]; then
31         . ./stepmake/VERSION
32         if [ "x$PACKAGE_NAME" != "xStepMake" ]; then
33                 echo "$name: huh 1?"
34                 exit 1
35         fi
36         echo "Stepmake found"
37         printf "Checking version..."
38         VERSION=$MAJOR_VERSION.$MINOR_VERSION.$PATCH_LEVEL
39         # urg
40         version=$VERSION
41         if [ "$MY_PATCH_LEVEL" != "" ]; then
42                 VERSION=$VERSION.$MY_PATCH_LEVEL
43         fi
44         echo " $version"
45 else
46         VERSION="0.0.0"
47         version=$VERSION
48 fi
49
50 if [ true ]; then
51         # urg
52         printf "Checking latest..."
53         if [ ! -r $reldir ]; then
54                 echo "$name: huh 2?"
55                 exit 1
56         fi
57         LATEST=`cd $reldir; ls -t1 stepmake-*.tar.gz | head -n 1 | sed 's!stepmake-!!' | sed 's!.tar.gz!!'`
58         # urg
59         latest=`echo $LATEST | sed 's/\.[a-zA-Z][a-zA-Z]*[0-9]*$//'`
60         latest_val=`value $latest`
61         echo " $latest"
62         version_val=`value $version`
63         if [ $latest_val -le $version_val ]; then
64             echo "relax, StepMake is up to date"
65             exit 0
66         fi
67         printf "Updating StepMake..."
68         (set +x; rm -rf stepmake; tar xzf $reldir/stepmake-$LATEST.tar.gz; mv stepmake-$LATEST stepmake)
69         echo "ok"
70 fi
71
72 if [ -r VERSION ]; then
73         echo "$name: warning: VERSION found: not stepmakeising"
74         echo "You should rerun configure"
75         rm -f Makefile
76         exit 0
77 fi
78
79 files="VERSION make aclocal.in configure.in config.hh.in config.make.in"
80 for i in $files; do
81         if [ -r $i ]; then
82                 echo "$name: can't stepmakise: $i already present"
83                 exit 1
84         fi
85 done
86
87 printf "Stepmakeising..."
88 for i in $files; do
89         cp -prv stepmake/$i .
90 done
91
92 cat <<EOF
93 ok
94 Please edit the folowing files to your package's needs:
95
96     VERSION
97     configure.in 
98
99 and look at:
100
101     make/Toplevel.make.in
102     config.hh.in
103     config.make.in
104 EOF
105