chiark / gitweb /
new build script
authorIan Jackson <ian@liberator.relativity.greenend.org.uk>
Sun, 22 Aug 2010 19:41:50 +0000 (20:41 +0100)
committerIan Jackson <ian@liberator.relativity.greenend.org.uk>
Sun, 22 Aug 2010 19:41:50 +0000 (20:41 +0100)
.gitignore
README
build-sh [new file with mode: 0755]

index 6941f01aa8c25c02cc392103bd4a7adff5fc5f4e..e3094d70abf9fefdd5b1cd212da935cb6e466864 100644 (file)
@@ -6,4 +6,5 @@ tmp
 PCTB-ControlPanel.jar
 PCTB-Uploader.jar
 jpctb-setup.exe
 PCTB-ControlPanel.jar
 PCTB-Uploader.jar
 jpctb-setup.exe
+jpctb.tar.gz
 src/build/
 src/build/
diff --git a/README b/README
index dc7902bcf6c619a4a6042606c438a82b1740d7dd..9658f4c1a276c647f4618be87b73dea64e79da47 100644 (file)
--- a/README
+++ b/README
@@ -9,6 +9,7 @@ distribution:
 
 ./jpctb /path/to/yohoho/yohoho
 
 
 ./jpctb /path/to/yohoho/yohoho
 
+
 Windows
 -------
 
 Windows
 -------
 
@@ -23,19 +24,27 @@ one of two things:
    installing Puzzle Pirates.  (Don't worry about reinstalling; you
    won't lose any of your pirates or pieces of eight!)
 
    installing Puzzle Pirates.  (Don't worry about reinstalling; you
    won't lose any of your pirates or pieces of eight!)
 
+
 Source
 ------
 
 To build from source you will need a Java SDK, version 6, and Apache
 ant, as well as NSIS to build the Windows installer package.
 
 Source
 ------
 
 To build from source you will need a Java SDK, version 6, and Apache
 ant, as well as NSIS to build the Windows installer package.
 
-  cd src
-  ant -f PCTB.xml
+You can run the script "build-sh" do to the build.  It will create in
+the current directory (the top level of the build) the .jar files for
+JPCTB and also the two distribution files:
+  jpctb-setup.exe   the installer for windows users
+  jpctb.tar.gz      a filtered tarball of this whole directory, for linux users
 
 
-Currently this only seems to work with the Sun JDK.  If your default
-JDK is OpenJDK then the following rune may work better:
+Currently the build only seems to work with the Sun JDK, so the script
+sets JAVA_HOME to /usr/lib/jvm/java-6-sun.  If that's not what you
+want, set JAVA_HOME yourself.
 
 
-  JAVA_HOME=/usr/lib/jvm/java-6-sun ant -f PCTB.xml
+To make shipping the files a bit easier it prints a rune for rsyncing
+the files to the distribution site with a pathname based on the output
+from "git-describe".  You can set JPCTB_PUBLISH_BASE and ..._DIR to
+control the exact output.
 
 
 Bugs
 
 
 Bugs
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/
+"