New markup command snippets.
[lilypond.git] / stepmake / bin / stepmakeise.sh
blob4119be3df53b1740db51ad307022b0ffa84e1372
1 #!/bin/sh
2 # stepmakeise.sh
4 help () {
5 cat <<EOF
6 Usage: ../stepmake-x.x.x/bin/stepmakeise.sh
7 Include or update package's StepMake.
8 EOF
11 name=`basename $0`
12 reldir=../releases
13 stepbin=`dirname $0`
15 if [ $# -ne 0 ]; then
16 help
17 exit 2
20 value ()
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
30 if [ -r stepmake ]; then
31 . ./stepmake/VERSION
32 if [ "x$PACKAGE_NAME" != "xStepMake" ]; then
33 echo "$name: huh 1?"
34 exit 1
36 echo "Stepmake found"
37 echo -n "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
44 echo " $version"
45 else
46 VERSION="0.0.0"
47 version=$VERSION
50 if [ true ]; then
51 # urg
52 echo -n "Checking latest..."
53 if [ ! -r $reldir ]; then
54 echo "$name: huh 2?"
55 exit 1
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
67 echo -n "Updating StepMake..."
68 (set +x; rm -rf stepmake; tar xzf $reldir/stepmake-$LATEST.tar.gz; mv stepmake-$LATEST stepmake)
69 echo "ok"
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
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
85 done
87 echo -n "Stepmakeising..."
88 for i in $files; do
89 cp -prv stepmake/$i .
90 done
92 cat <<EOF
94 Please edit the folowing files to your package's needs:
96 VERSION
97 configure.in
99 and look at:
101 make/Toplevel.make.in
102 config.hh.in
103 config.make.in