set -e
case "$#.$1" in
-0) ;;
+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)
+revision=`git describe --always || echo '(unknown revision)'`
+if [ x"`git diff 2>/dev/null || echo x`" != x ]; then
+ revision="$revision-local"
+fi
+
+cat >src/net/chiark/yarrg/Version.java <<END
+ package net.chiark.yarrg;
+ public class Version {
+ public final static String version = "$revision";
+ }
+END
+rm -f src/build/net/chiark/yarrg/Version.class
+rm -f src/build/net/chiark/yarrg/ControlPanel.class
+rm -f src/build/net/chiark/yarrg/MarketUploader.class
+rm -f *.jar
+
+cd src
+ant -f Jarrg.xml
+cd ..
echo "
-Building tarball
+Building tarballs
"
-GZIP=-9v tar --exclude=\*{~,.tar.gz,.exe} --exclude='#*#' \
- --transform='s/^./jpctb/' --exclude=jpctb/{src/build,tmp} \
- -zcf jpctb.tar.gz .
+tarball () {
+ output=$1; shift
+ GZIP='-9v --rsyncable' tar --exclude=\*{~,.tar.gz,.exe} --exclude='#*#' \
+ --transform='s/^./jarrg/' --exclude={src/build,tmp} "$@" \
+ -zcf "$output" .
+}
+
+tarball jarrg-source.tar.gz
-files='jpctb.tar.gz jpctb-setup.exe'
+tarball jarrg-linux.tar.gz \
+ --exclude={.git*,src,accessibility.properties,build-sh} \
+
+files='jarrg-source.tar.gz jarrg-linux.tar.gz jarrg-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`
+pubbase="${JARRG_PUBLISH_BASE-login.chiark.greenend.org.uk}"
+pubdir="${JARRG_PUBLISH_DIR-/home/yarrgweb/public-html/download/jarrg}"
echo "
+Revision: $revision
+
Install with:
- RSYNC_RSH=ssh rsync -vP $files $pubbase:$pubdir/$revision/
+ RSYNC_RSH=ssh rsync -vP $files $pubbase:$pubdir/test/
"