chiark / gitweb /
actually discover if builds break
[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 cd src
17 ant -f PCTB.xml
18 cd ..
19
20 echo "
21 Building tarball
22 "
23
24 GZIP=-9v tar --exclude=\*{~,.tar.gz,.exe} --exclude='#*#' \
25   --transform='s/^./jpctb/' --exclude=jpctb/{src/build,tmp} \
26   -zcf jpctb.tar.gz .
27
28 files='jpctb.tar.gz jpctb-setup.exe'
29
30 echo "
31 Generated OK:
32 "
33 ls -al $files
34
35 pubbase="${JPCTB_PUBLISH_BASE-login.chiark.greenend.org.uk}"
36 pubdir="${JPCTB_PUBLISH_DIR-/home/yarrgweb/public-html/download/jpctb}"
37 revision=`git describe --always`
38
39 echo "
40 Install with:
41  RSYNC_RSH=ssh rsync -vP $files $pubbase:$pubdir/$revision/
42 "