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