chiark / gitweb /
new build script
[jarrg-owen.git] / build-sh
diff --git a/build-sh b/build-sh
new file mode 100755 (executable)
index 0000000..eb3d1e2
--- /dev/null
+++ b/build-sh
@@ -0,0 +1,40 @@
+#!/bin/bash
+#
+# We don't supply a Makefile.  Instead, we just supply this shell script.
+
+set -e
+
+case "$#.$1" in
+0)     ;;
+*.-*)  echo >&2 'no options allowed'; exit 1;;
+*)     echo >&2 'no arguments allowed'; exit 1;;
+esac
+
+: ${JAVA_HOME:=/usr/lib/jvm/java-6-sun}
+export JAVA_HOME
+
+(set -e; cd src; ant -f PCTB.xml)
+
+echo "
+Building tarball
+"
+
+GZIP=-9v tar --exclude=\*{~,.tar.gz,.exe} --exclude='#*#' \
+  --transform='s/^./jpctb/' --exclude=jpctb/{src/build,tmp} \
+  -zcf jpctb.tar.gz .
+
+files='jpctb.tar.gz jpctb-setup.exe'
+
+echo "
+Generated OK:
+"
+ls -al $files
+
+pubbase="${JPCTB_PUBLISH_BASE-login.chiark.greenend.org.uk}"
+pubdir="${JPCTB_PUBLISH_DIR-/home/yarrgweb/public-html/jpctb}"
+revision=`git describe --always`
+
+echo "
+Install with:
+ RSYNC_RSH=ssh rsync -vP $files $pubbase:$pubdir/$revision/
+"