chiark / gitweb /
Remove apparently-unneeded space
[jarrg-owen.git] / build-sh
1 #!/bin/bash
2 #
3 # We don't supply a Makefile.  Instead, we just supply this shell script.
4
5 set -e
6
7 case "$#.$1" in
8 0.)     ;;
9 *.-*)   echo >&2 'no options allowed'; exit 1;;
10 *)      echo >&2 'no arguments allowed'; exit 1;;
11 esac
12
13 : ${JAVA_HOME:=/usr/lib/jvm/java-6-sun}
14 export JAVA_HOME
15
16 revision=`git describe --always || echo '(unknown revision)'`
17 cat >src/com/tedpearson/ypp/market/Version.java <<END
18   package com.tedpearson.ypp.market;
19   public class Version {
20       public final static String version = "$revision";
21   }
22 END
23 rm -f src/build/com/tedpearson/ypp/market/Version.class
24 rm -f src/build/com/tedpearson/ypp/market/ControlPanel.class
25 rm -f *.jar
26
27 cd src
28 ant -f PCTB.xml
29 cd ..
30
31 echo "
32 Building tarball
33 "
34
35 GZIP='-9v --rsyncable' tar --exclude=\*{~,.tar.gz,.exe} --exclude='#*#' \
36   --transform='s/^./jpctb/' --exclude=jpctb/{src/build,tmp} \
37   -zcf jpctb.tar.gz .
38
39 files='jpctb.tar.gz jpctb-setup.exe'
40
41 echo "
42 Generated OK:
43 "
44 ls -al $files
45
46 pubbase="${JPCTB_PUBLISH_BASE-login.chiark.greenend.org.uk}"
47 pubdir="${JPCTB_PUBLISH_DIR-/home/yarrgweb/public-html/download/jpctb}"
48
49 echo "
50 Install with:
51  RSYNC_RSH=ssh rsync -vP $files $pubbase:$pubdir/test/
52 "