Index: /main/trunk/package-kits/linux/ReadMe
===================================================================
--- /main/trunk/package-kits/linux/ReadMe	(revision 29460)
+++ /main/trunk/package-kits/linux/ReadMe	(revision 29460)
@@ -0,0 +1,30 @@
+Patches:
+    To generate a patch:
+        diff -aur package.pristine package.new > package.patch
+    To apply a patch:
+        patch -p0 -i package.patch
+        where -p0 assumes the paths in the patch are valid in the current directory
+    gs2build.patch
+        Contains patches for the gs2build build process
+        Disables building externals
+
+    perl-util.patch
+        Contains a patch to change the tmp folder for gs2build
+        This is necessary because the original location of the tmp folder was in the gs2build folder, which contains executables, and as such should be read-only.
+        Thus the tmp folder has been changed to /tmp/greenstone-build
+
+Scripts:
+    greenstone
+        Sets up the environment for running greenstone-tools
+    gli
+        Runs greenstone to set up the environment, then runs GLI
+    wvWare
+        Removes itself from $PATH, then runs wvWare (which will be the system wvWare)
+
+Gotchas:
+    derby.jar location
+        Must be in the tomcat lib folder instead of the greenstone lib folder
+        http://stackoverflow.com/questions/24963117/tomcat-realm-forms-login-always-fails
+
+Issues:
+    -
Index: /main/trunk/package-kits/linux/build.properties
===================================================================
--- /main/trunk/package-kits/linux/build.properties	(revision 29460)
+++ /main/trunk/package-kits/linux/build.properties	(revision 29460)
@@ -0,0 +1,139 @@
+#### properties file for Greenstone3 building using ANT. See the README for more 
+#### information
+
+## Tomcat installation
+# Set this to the internet/intranet name of the machine that Tomcat is/will be 
+# run on. localhost is fine for accessing the server from the local machine, 
+# but not remotely
+tomcat.server=localhost
+# The port number that tomcat is/will be run on
+tomcat.port=8383
+# Tomcat's shutdown port - this may need to be changed if you are running two or more Tomcats
+tomcat.shutdown.port=8305
+# If tomcat is already running, enter the path to the base directory here
+tomcat.installed.path=
+# uncomment the following if you have moved the greenstone3 web directory to tomcats webapps dir 
+#web.home=${tomcat.installed.path}/webapps/greenstone3
+
+## Collection building options
+# uncomment if you don't want to have collection building enabled
+#disable.collection.building=true
+#
+# uncomment (and edit) if you want to control where perl is found
+#perl.path=/usr/bin
+
+## Greenstone 3 server program options
+# does running the server automatically start up Tomcat and a browser
+server.auto.start=false
+# if set to true, won't try other ports if the specified port is not available
+server.keep.port=false
+# default servlet to start with
+server.default.servlet=/library
+
+# The context name of your GS3 digital library. By default this will be "greenstone3". 
+# Ensure this has a value. If you change this multiple times, you need to remove the old versions
+# of <custom.context>.xml from GS3/packages/tomcat/conf/Catalina/localhost
+# does not contain previous 
+custom.context=greenstone3
+
+##Browser setup
+browser.path=
+
+## Proxy setup - Greenstone installation will attempt to download extra packages. Set the proxy information here if you are behind a firewall.
+# The proxy server name 
+proxy.host=
+# The proxy server port
+proxy.port=
+# A user name to use when talking to the proxy server (optional, will prompt if not entered here)
+proxy.user=
+# A password to use when talking to the proxy server (optional, will prompt if not entered here)
+proxy.password=
+
+## java compilation properties - for javac
+# Should compilation include the debug option?
+compile.debug=true
+# Should compilation include the deprecation option?
+compile.deprecation=true
+# Should compilation include the optimize option?
+compile.optimize=true
+
+# Properties that control cross-compiling
+compile.cross        = false
+#cross.os             = windows
+#cross.host           = i686-w64-mingw32
+#cross.build          = i686-pc-linux-gnu
+#cross.configure.extraargs =
+
+#cross.os             = android
+#cross.host           = arm-linux-androideabi
+#cross.build          = i686-pc-linux-gnu
+#cross.configure.extraargs = gl_cv_header_working_stdint_h=yes
+
+
+# Control whether or not JNI bindings are used
+#   e.g. MG, MG++ and GDBM and the like
+# Setting this false means these components are not available to the install
+# The expectation is that collections will be build from 100% Java components:
+#   e.g Lucene and JDBM
+# 
+# Ant 1.7.1 and before only test for *existence* so this needs to be commented
+# in or out to control whether jni is used or not
+with.jni=true
+
+## Controls whether or not we want GLI and GEMS to be checked out and compiled
+#with.gli.and.gems=true
+
+## Control if compilation of gs2 is static or not. Used, for example, for distributions
+# Same issue as 'with.jni' for how this gets used in ant 1.7.1 and before
+#compile.static=true
+
+# A flag used by the release-kit to compile with gnomelib
+# (Previously this flag was called use.support.lib but got conflated with
+# the property checkout.gnomelib.ext below)
+#use.gnomelib.ext=true
+
+## Uncomment these lines if enabling compilation with the gnome-lib extension
+## and if compiling imagemagick
+## These extensions should be in the [gsdl3home]/gs2build/ext directory
+#checkout.gnomelib.ext=true
+#checkout.imagemagick.ext=true
+
+# By default, GS3 will check out the pdfbox extension from SVN
+checkout.pdfbox.ext=true
+
+# The following two properties are automatically overridden by gs3-server
+# when running off a read-only medium such as a DVD ...
+#
+# The 'writable' home default is to be the same location as gsdl3.home
+gsdl3home.isreadonly=false
+gsdl3.writablehome=${basedir}/web
+
+# ... alternative the above can be changed to
+#
+#  gsdl3home.isreadonly=true
+#  gsdl3.writablehome=${java.io.tmpdir}/greenstone/web
+#
+# ... or else provided on the command line, e.g.:
+#   ant -Dgsdl3home.isreadonly=true gsdl3.writablehome=/tmp/greenstone/web start
+
+## windows c++ compilation
+# The following property does not help in build.xml. 
+# The user needs to run Visual Studio's vcvars32.bat script from the
+# MSDOS prompt before compiling Greenstone3 (before "ant prepare install")
+#compile.windows.c++.setup=C:/Program Files/Microsoft Visual Studio/VC98/Bin/VCVARS32.BAT
+
+##Flax stuff##
+##uncomment if you want to install flax
+#install.flax=true
+#flax.checkout.path=${flax.svn.root}/trunk/flaxmain
+
+##These need to be uncommented if using Fedora and Fedora GSearch with Greenstone's tomcat
+#fedora.home=#${basedir}/ext/fedora3
+#fedora.maxpermsize=-XX:MaxPermSize=128m
+#fedora.password=pounamu
+#index.writelock.timeout=10000
+
+##Web services related constants##
+base.webservice.name=SOAPServer
+##listing and description of all the web services deployable on GS3##
+web.services.list=${base.webservice.name} for Greenstone3's core web services, QBR${base.webservice.name} for Query, Browse and Retrieve services
Index: /main/trunk/package-kits/linux/gli
===================================================================
--- /main/trunk/package-kits/linux/gli	(revision 29460)
+++ /main/trunk/package-kits/linux/gli	(revision 29460)
@@ -0,0 +1,7 @@
+#!/bin/sh
+
+export JAVA_HOME=/usr/lib/jvm/default
+
+. greenstone --no-interactive
+
+/opt/gli/gli.sh
Index: /main/trunk/package-kits/linux/greenstone
===================================================================
--- /main/trunk/package-kits/linux/greenstone	(revision 29460)
+++ /main/trunk/package-kits/linux/greenstone	(revision 29460)
@@ -0,0 +1,97 @@
+#!/bin/sh
+
+interactive=1
+sourced=1
+unset use_shell
+case $* in
+    *--no-interactive*)
+        unset interactive
+        ;;
+esac
+
+fail() {
+    echo $* >&2
+    exit 1
+}
+
+# make sure we are sourced, and not run
+if test "`basename $0`" == "greenstone" ; then
+# if $0 is "greenstone" we've been run... $0 is shellname if sourced.
+# One exception is zsh has an option to set it temporarily to the script name
+    if test -z "$ZSH_NAME" ; then
+        # we aren't using zsh
+        unset sourced
+    fi
+fi
+
+if test -z "$sourced" ; then
+    test -z "$interactive" && fail "Script must be sourced for non-interactive use"
+    echo "Script was not sourced" >&2
+    echo -n "Use a new shell? (y/[n]) " >&2
+    read use_shell
+    test "$use_shell" != "y" -a "$use_shell" != "Y" && fail "Script must either be sourced, or allowed to start an interactive shell"
+    use_shell=1
+fi
+
+GSDLHOME=/opt/greenstone/gs2build
+export GSDLHOME
+
+GSDLOS=linux
+export GSDLOS
+
+# Establish cpu architecture
+# 32-bit or 64-bit?
+UNAME_HW_MACH=`uname -m`
+
+# Following test came from VirtualBox's Guest Additions autostart.sh
+# (adapted for use in Greenstone)
+case "$UNAME_HW_MACH" in
+i[3456789]86|x86|i86pc)
+    GSDLARCH='32'                                                                                                
+    ;;
+x86_64|amd64|AMD64)
+    GSDLARCH='64'
+    ;;
+*)
+    echo "Unknown architecture: $UNAME_HW_MACH" >&2
+    ;;
+esac
+
+# Only want non-trival GSDLARCH value set if there is evidence of
+# the installed bin (lib, ...) directories using linux32, linux64
+# (otherwise probably looking at an SVN compiled up version for single OS)
+if test ! -d "$GSDLHOME/bin/$GSDLOS$GSDLARCH" ;
+then
+    GSDLARCH=""
+fi
+
+export GSDLARCH
+
+# Workaround for perl >= 5.18
+PERL_PERTURB_KEYS=0
+export PERL_PERTURB_KEYS
+
+
+PATH="$GSDLHOME/bin/script:$GSDLHOME/bin/$GSDLOS$GSDLARCH:$PATH"
+export PATH
+LD_LIBRARY_PATH="$GSDLHOME/gs2build/lib/$GSDLOS$GSDLARCH:$GSDLHOME/lib/$GSDLOS$GSDLARCH:$LD_LIBRARY_PATH"
+export LD_LIBRARY_PATH
+
+if test -n "$interactive" -a -z "$GSDL3HOME" ; then
+    echo "Where are the collections? [/srv/gsdl/]" >&2
+    echo -n " > " >&2
+    read GSDL3HOME
+fi
+if test -z "$GSDL3HOME" ; then
+    echo "Setting collections location to the default" >&2
+    GSDL3HOME=/srv/gsdl
+fi
+export GSDL3HOME
+
+test -d "$GSDL3HOME/sites/localsite/collect" || mkdir -p "$GSDL3HOME/sites/localsite/collect"
+
+if test -n "$interactive" -a -n "$use_shell" ; then
+    test -z $SHELL && SHELL=sh
+    echo "Starting an interactive shell for GSDL management" >&2
+    $SHELL
+fi
Index: /main/trunk/package-kits/linux/greenstone3.xml
===================================================================
--- /main/trunk/package-kits/linux/greenstone3.xml	(revision 29460)
+++ /main/trunk/package-kits/linux/greenstone3.xml	(revision 29460)
@@ -0,0 +1,8 @@
+<Context path="/greenstone3" docBase="/srv/gsdl/" reloadable="true">
+    <Realm className="org.apache.catalina.realm.JDBCRealm" 
+        driverName="org.apache.derby.jdbc.EmbeddedDriver"
+        connectionURL="jdbc:derby:/srv/gsdl/etc/usersDB"
+        userTable="users" userNameCol="username" userCredCol="password"
+        userRoleTable="roles" roleNameCol="role"
+    />
+</Context>
Index: /main/trunk/package-kits/linux/gs2build.patch
===================================================================
--- /main/trunk/package-kits/linux/gs2build.patch	(revision 29460)
+++ /main/trunk/package-kits/linux/gs2build.patch	(revision 29460)
@@ -0,0 +1,87 @@
+--- gs2build/build-src/configure.in.orig	2014-11-14 17:39:39.863383460 +1300
++++ gs2build/build-src/configure.in	2014-11-14 17:40:52.845299057 +1300
+@@ -88,18 +88,6 @@
+ AC_SUBST(ENABLE_JAVA)
+ 
+ dnl
+-dnl Set use of wvware (enabled by default)
+-dnl
+-AC_ARG_ENABLE(wvware, [  --disable-wvware          Disable wvWare compilation], USE_WVWARE=$enableval, USE_WVWARE=yes)
+-if test $USE_WVWARE = "yes" -o $USE_WVWARE = "1" ; then
+-  USE_WVWARE=1
+-  AC_DEFINE(USE_WVWARE,[])
+-else
+-  USE_WVWARE=0
+-fi
+-AC_SUBST(USE_WVWARE)
+-
+-dnl
+ dnl Set use of JDBM (enabled by default)
+ dnl
+ AC_ARG_ENABLE(jdbm, [  --disable-jdbm          Disable JDBM compilation], USE_JDBM=$enableval, USE_JDBM=yes)
+@@ -472,50 +460,13 @@
+   AC_SUBST(MODULEDIRS)
+ fi
+ 
+-#----------------------------------------------------------------------------
+-# GS3 uses this to set up gnome-lib env, GS2 uses the configure in gs2build/toplevel GS2 installation
+-# For gnome-lib-minimal need to source its ./devel.bash before wvware can even be configured
+-# For a gnome-lib that's already compiled, don't need to its source ./devel.bash to configure wvware
+-# If a gnome-lib is not yet compiled, we compile it first with CASCADE-MAKE.sh
+-# Need to make sure that the gnome-lib-minimal is not the cut-down gnome-lib-minimal (which contains
+-# only the linux/lib subfolder) that's included with linux and mac binaries, because we can't compile 
+-# wvware with the cut-down one, only run wvware with it. The test for the cut-down version is that 
+-# it does not contain devel.bash.
+-
+-if test $ENABLE_GNOMELIB_EXT = 1; then
+-
+-   if test -z "$GSDLHOME"; then
+-      cd ..
+-      gshome=`pwd`
+-      cd build-src
+-   else 
+-      gshome=$GSDLHOME  
+-   fi
+-
+-   if test -f $gshome/ext/gnome-lib-minimal/devel.bash; then
+-      echo "*** gnome-lib (minimal) detected. Sourcing the gnomelib env for configuring wvware..."
+-      cd $gshome/ext/gnome-lib-minimal
+-      source ./devel.bash
+-      cd $gshome/build-src
+-   elif test -d $gshome/ext/gnome-lib; then
+-     if test -d $gshome/ext/gnome-lib/$gsdlos; then
+-        echo "*** Sourcing the gnomelib env for configuring wvware..."
+-	cd $gshome/ext/gnome-lib
+-      	source ./devel.bash
+-      	cd $gshome/build-src	
+-     fi 
+-   fi
+-
+-fi
+-
+ # ---------------------------------------------------------------------------
+-AC_CONFIG_SUBDIRS(packages)
+ 
+ # the list of folders in the src folder
+ srclist="src/hashfile/Makefile \
+          src/phind/generate/Makefile \
+          src/java/org/nzdl/gsdl/Makefile"
+ 
+-AC_OUTPUT(packages/Makefile Makefile $srclist $moduleDirs)
++AC_OUTPUT(Makefile $srclist $moduleDirs)
+ 
+ 
+--- gs2build/build-src/Makefile.in.orig	2014-11-14 17:52:15.848644058 +1300
++++ gs2build/build-src/Makefile.in	2014-11-14 17:52:27.558644340 +1300
+@@ -48,9 +48,9 @@
+ ALLFILES = $(OBJECTS)
+ 
+ # all directories should be compiled
+-COMPILEDIRS = packages src/hashfile src/phind/generate src/java/org/nzdl/gsdl
++COMPILEDIRS = src/hashfile src/phind/generate src/java/org/nzdl/gsdl
+ # a subset of the directories get installed
+-INSTALLDIRS = packages src/hashfile src/phind/generate 
++INSTALLDIRS = src/hashfile src/phind/generate 
+ 
+ MODULEDIRS = @MODULEDIRS@
+ 
Index: /main/trunk/package-kits/linux/pacman/demo/PKGBUILD
===================================================================
--- /main/trunk/package-kits/linux/pacman/demo/PKGBUILD	(revision 29460)
+++ /main/trunk/package-kits/linux/pacman/demo/PKGBUILD	(revision 29460)
@@ -0,0 +1,48 @@
+# Maintainer: Jeremy Symon <jtsymon@gmail.com>
+pkgname=greenstone-demo-svn
+pkgver=r29457  
+pkgrel=1
+pkgdesc="Demo Greenstone Digital Library Collections"
+url="http://greenstone.org"
+arch=('any')
+license=('GPLv2')
+depends=('greenstone')
+optdepends=()
+makedepends=(
+  'greenstone-tools'
+  'svn'
+)
+# conflicts=()
+# replaces=()
+# backup=()
+# install=''
+source=("svn+http://svn.greenstone.org/main/trunk/greenstone3/web/sites/localsite/collect")
+md5sums=('SKIP')
+
+pkgver() {
+  cd "collect"
+  local ver="$(svnversion)"
+  printf "r%s" "${ver//[[:alpha:]]}"
+}
+
+build() {
+  cd "${srcdir}/collect"
+  find . -type d -name ".svn" -exec rm -rf {} \; || :
+  rm -f */index.zip
+  cd "${srcdir}"
+  rm -rf sites/
+  mkdir -p sites/localsite
+  mv collect sites/localsite/
+  export GSDL3HOME=$(pwd)
+  . greenstone --no-interactive
+  find sites/localsite/collect/ -mindepth 1 -maxdepth 1 -not -name ".*" -execdir bash -c 'col="$(basename $1)"; import.pl -removeold -site localsite "$col"; buildcol.pl -removeold -site localsite "$col"; mv "${col}/building" "${col}/index"' -- {} \;
+  mv sites/localsite/collect .
+}
+
+package() {
+  install -d ${pkgdir}/srv/gsdl/sites/localsite
+  cp -r ${srcdir}/collect ${pkgdir}/srv/gsdl/sites/localsite/
+}
+
+# vim:expandtab:ts=2:sw=2:
+
Index: /main/trunk/package-kits/linux/pacman/gli/PKGBUILD
===================================================================
--- /main/trunk/package-kits/linux/pacman/gli/PKGBUILD	(revision 29460)
+++ /main/trunk/package-kits/linux/pacman/gli/PKGBUILD	(revision 29460)
@@ -0,0 +1,52 @@
+# Maintainer: Jeremy Symon <jtsymon@gmail.com>
+pkgname=greenstone-gli-svn
+pkgver=r29457  
+pkgrel=1
+pkgdesc="Greenstone Librarian Interface - GUI frontend to greenstone-tools"
+url="http://greenstone.org"
+arch=('any')
+license=('GPLv2')
+depends=(
+  'greenstone-tools'
+  'java-runtime=7'
+)
+optdepends=()
+makedepends=(
+  'svn'
+  'java-environment=7'
+)
+# conflicts=()
+# replaces=()
+# backup=()
+# install=''
+source=(
+  "$pkgname::svn+http://svn.greenstone.org/main/trunk/gli"
+  'gli'
+)
+md5sums=(
+  'SKIP'
+  'SKIP' # TODO: add gli MD5 here
+)
+
+pkgver() {
+  cd "$pkgname"
+  local ver="$(svnversion)"
+  printf "r%s" "${ver//[[:alpha:]]}"
+}
+
+build() {
+  cd "${srcdir}/$pkgname"
+  find . -type d -name ".svn" -exec rm -rf {} \; || :
+  export JAVA_HOME=/usr/lib/jvm/default/
+  ./makegli.sh
+  rm -rf src/ winutil/ *.bat
+}
+
+package() {
+  install -d ${pkgdir}/opt/gli
+  cp -rT ${srcdir}/$pkgname ${pkgdir}/opt/gli
+  install -Dm755 ${srcdir}/gli ${pkgdir}/usr/bin/gli
+}
+
+# vim:expandtab:ts=2:sw=2:
+
Index: /main/trunk/package-kits/linux/pacman/gli/gli
===================================================================
--- /main/trunk/package-kits/linux/pacman/gli/gli	(revision 29460)
+++ /main/trunk/package-kits/linux/pacman/gli/gli	(revision 29460)
@@ -0,0 +1,1 @@
+link ../../gli
Index: /main/trunk/package-kits/linux/pacman/main/PKGBUILD
===================================================================
--- /main/trunk/package-kits/linux/pacman/main/PKGBUILD	(revision 29460)
+++ /main/trunk/package-kits/linux/pacman/main/PKGBUILD	(revision 29460)
@@ -0,0 +1,88 @@
+# Maintainer: Jeremy Symon <jtsymon@gmail.com>
+pkgname=greenstone-svn
+pkgver=r29457
+pkgrel=1
+pkgdesc="Greenstone is a suite of software for building and distributing digital library collections."
+url="http://greenstone.org"
+arch=('i686' 'x86_64')
+license=('GPLv2')
+depends=(
+  'java-runtime=7'
+  'tomcat7'
+  'tomcat-native'
+)
+optdepends=()
+makedepends=(
+  'java-environment=7'
+  'svn'
+  'apache-ant'
+  'patch'
+  'autoconf'
+  'gcc'
+  'make'
+)
+provides=('greenstone')
+# conflicts=()
+# replaces=()
+# backup=()
+# install=''
+source=(
+  "$pkgname::svn+http://svn.greenstone.org/main/trunk/greenstone3/"
+  'build.properties'
+  'gs2build.patch'
+  'greenstone3.xml'
+)
+md5sums=(
+  'SKIP'
+  'SKIP' # TODO: add build.properties MD5 here
+  'SKIP' # TODO: add gs2build.patch MD5 here
+  'SKIP' # TODO: add greenstone3.xml MD5 here
+)
+
+pkgver() {
+  cd "$pkgname"
+  local ver="$(svnversion)"
+  printf "r%s" "${ver//[[:alpha:]]}"
+}
+
+prepare() {
+  cd "${srcdir}/${pkgname}"
+  export JAVA_HOME=/usr/lib/jvm/default
+  cp -L ../build.properties .
+  yes | ant prepare
+  # disable gs2build packages
+  patch -p0 -i ../gs2build.patch
+  pushd gs2build/build-src
+  autoconf
+  popd
+  # rm -rf packages
+  rm -rf packages/*.zip
+  rm -rf packages/axis/docs
+  # rm -rf src/packages
+  # rm -rf gs2build/common-src/packages
+  rm -rf gs2build/build-src/packages 
+}
+
+build() {
+  cd "${srcdir}/${pkgname}"
+  export JAVA_HOME=/usr/lib/jvm/default
+  ant install
+  mv lib/jni/*.jar web/WEB-INF/lib/
+  find . -type d \( -name ".svn" -o -iname "win32" -o -iname "windows" -o -iname "darwin" \) -exec rm -rf {} \; 2>/dev/null || :
+  find . \( -iname "*.dll" -o -iname "*.exe" \) -exec rm -rf {} \; || :
+  rm -rf web/sites/localsite/collect/*
+}
+
+package() {
+  install -d ${pkgdir}/srv/gsdl ${pkgdir}/usr/lib ${pkgdir}/usr/share/java/tomcat7
+  install -dm775 ${pkgdir}/etc/tomcat7/Catalina
+  install -Dm755 ${srcdir}/${pkgname}/lib/jni/*.so ${pkgdir}/usr/lib/
+  cp -rT ${srcdir}/${pkgname}/web ${pkgdir}/srv/gsdl/
+  install -Dm644 ${srcdir}/greenstone3.xml ${pkgdir}/etc/tomcat7/Catalina/localhost/greenstone3.xml
+  # derby.jar must be in the tomcat lib folder instead of the greenstone lib folder:
+  # http://stackoverflow.com/questions/24963117/tomcat-realm-forms-login-always-fails
+  mv ${pkgdir}/srv/gsdl/WEB-INF/lib/derby.jar ${pkgdir}/usr/share/java/tomcat7/
+}
+
+# vim:expandtab:ts=2:sw=2:
+
Index: /main/trunk/package-kits/linux/pacman/main/build.properties
===================================================================
--- /main/trunk/package-kits/linux/pacman/main/build.properties	(revision 29460)
+++ /main/trunk/package-kits/linux/pacman/main/build.properties	(revision 29460)
@@ -0,0 +1,1 @@
+link ../../build.properties
Index: /main/trunk/package-kits/linux/pacman/main/greenstone3.xml
===================================================================
--- /main/trunk/package-kits/linux/pacman/main/greenstone3.xml	(revision 29460)
+++ /main/trunk/package-kits/linux/pacman/main/greenstone3.xml	(revision 29460)
@@ -0,0 +1,1 @@
+link ../../greenstone3.xml
Index: /main/trunk/package-kits/linux/pacman/main/gs2build.patch
===================================================================
--- /main/trunk/package-kits/linux/pacman/main/gs2build.patch	(revision 29460)
+++ /main/trunk/package-kits/linux/pacman/main/gs2build.patch	(revision 29460)
@@ -0,0 +1,1 @@
+link ../../gs2build.patch
Index: /main/trunk/package-kits/linux/pacman/tools/PKGBUILD
===================================================================
--- /main/trunk/package-kits/linux/pacman/tools/PKGBUILD	(revision 29460)
+++ /main/trunk/package-kits/linux/pacman/tools/PKGBUILD	(revision 29460)
@@ -0,0 +1,91 @@
+# Maintainer: Jeremy Symon <jtsymon@gmail.com>
+pkgname=greenstone-tools-svn
+pkgver=r29457
+pkgrel=1
+pkgdesc="Tools for working with Greenstone collections."
+url="http://greenstone.org"
+arch=('i686' 'x86_64')
+license=('GPLv2')
+depends=(
+  'java-runtime=7'
+  'wv'
+  'perl'
+  'perl-xml-parser'
+  'perl-text-iconv'
+  'imagemagick'
+)
+optdepends=()
+makedepends=(
+  'svn'
+  'apache-ant'
+  'patch'
+  'autoconf'
+  'gcc'
+  'make'
+)
+provides=('greenstone-tools')
+# conflicts=()
+# replaces=()
+# backup=()
+# install=''
+source=(
+  "$pkgname::svn+http://svn.greenstone.org/main/trunk/greenstone3/"
+  'build.properties'
+  'gs2build.patch'
+  'perl-util.patch'
+  'wvWare'
+  'greenstone'
+)
+md5sums=(
+  'SKIP'
+  'SKIP' # TODO: add build.properties MD5 here
+  'SKIP' # TODO: add gs2build.patch MD5 here
+  'SKIP' # TODO: add perl-util.patch MD5 here
+  'SKIP' # TODO: add wvWare MD5 here
+  'SKIP' # TODO: add greenstone MD5 here
+)
+
+pkgver() {
+  cd "$pkgname"
+  local ver="$(svnversion)"
+  printf "r%s" "${ver//[[:alpha:]]}"
+}
+
+prepare() {
+  cd "${srcdir}/${pkgname}"
+  export JAVA_HOME=/usr/lib/jvm/default
+  cp -L ../build.properties .
+  yes | ant prepare
+  # disable gs2build packages
+  patch -p0 -i ../gs2build.patch
+  pushd gs2build/build-src
+  autoconf
+  popd
+  # rm -rf packages
+  rm -rf packages/*.zip
+  rm -rf packages/axis/docs
+  # rm -rf src/packages
+  # rm -rf gs2build/common-src/packages
+  rm -rf gs2build/build-src/packages 
+}
+
+build() {
+  cd "${srcdir}/${pkgname}"
+  export JAVA_HOME=/usr/lib/jvm/default
+  ant install
+  patch -p0 -i ../perl-util.patch
+  cp -L ${srcdir}/wvWare gs2build/bin/linux/wvWare
+  find . -type d \( -name ".svn" -o -iname "win32" -o -iname "windows" -o -iname "darwin" \) -exec rm -rf {} \; 2>/dev/null || :
+  find . \( -iname "*.dll" -o -iname "*.exe" \) -exec rm -rf {} \; || :
+  rm -rf src/ gs2build/build-src/ gs2build/common-src/ gs2build/collect/demo/ winutil/
+}
+
+package() {
+  install -d ${pkgdir}/opt/greenstone
+  cp -r ${srcdir}/${pkgname}/gs2build ${pkgdir}/opt/greenstone/
+  cp -r ${srcdir}/${pkgname}/bin ${pkgdir}/opt/greenstone/
+  install -Dm755 ${srcdir}/greenstone ${pkgdir}/usr/bin/greenstone
+}
+
+# vim:expandtab:ts=2:sw=2:
+
Index: /main/trunk/package-kits/linux/pacman/tools/build.properties
===================================================================
--- /main/trunk/package-kits/linux/pacman/tools/build.properties	(revision 29460)
+++ /main/trunk/package-kits/linux/pacman/tools/build.properties	(revision 29460)
@@ -0,0 +1,1 @@
+link ../../build.properties
Index: /main/trunk/package-kits/linux/pacman/tools/greenstone
===================================================================
--- /main/trunk/package-kits/linux/pacman/tools/greenstone	(revision 29460)
+++ /main/trunk/package-kits/linux/pacman/tools/greenstone	(revision 29460)
@@ -0,0 +1,1 @@
+link ../../greenstone
Index: /main/trunk/package-kits/linux/pacman/tools/gs2build.patch
===================================================================
--- /main/trunk/package-kits/linux/pacman/tools/gs2build.patch	(revision 29460)
+++ /main/trunk/package-kits/linux/pacman/tools/gs2build.patch	(revision 29460)
@@ -0,0 +1,1 @@
+link ../../gs2build.patch
Index: /main/trunk/package-kits/linux/pacman/tools/perl-util.patch
===================================================================
--- /main/trunk/package-kits/linux/pacman/tools/perl-util.patch	(revision 29460)
+++ /main/trunk/package-kits/linux/pacman/tools/perl-util.patch	(revision 29460)
@@ -0,0 +1,1 @@
+link ../../perl-util.patch
Index: /main/trunk/package-kits/linux/pacman/tools/wvWare
===================================================================
--- /main/trunk/package-kits/linux/pacman/tools/wvWare	(revision 29460)
+++ /main/trunk/package-kits/linux/pacman/tools/wvWare	(revision 29460)
@@ -0,0 +1,1 @@
+link ../../wvWare
Index: /main/trunk/package-kits/linux/perl-util.patch
===================================================================
--- /main/trunk/package-kits/linux/perl-util.patch	(revision 29460)
+++ /main/trunk/package-kits/linux/perl-util.patch	(revision 29460)
@@ -0,0 +1,11 @@
+--- gs2build/perllib/util.pm.orig	2014-11-19 15:54:32.017195491 +1300
++++ gs2build/perllib/util.pm	2014-11-19 15:56:10.850531232 +1300
+@@ -213,7 +213,7 @@
+ 	}
+     }
+ 
+-    my $tmpdir = &FileUtils::filenameConcatenate($ENV{'GSDLHOME'}, "tmp");
++    my $tmpdir = "/tmp/greenstone-build";
+     &FileUtils::makeAllDirectories ($tmpdir) unless -e $tmpdir;
+ 
+     my $count = 1000;
Index: /main/trunk/package-kits/linux/wvWare
===================================================================
--- /main/trunk/package-kits/linux/wvWare	(revision 29460)
+++ /main/trunk/package-kits/linux/wvWare	(revision 29460)
@@ -0,0 +1,5 @@
+#!/bin/sh
+# remove current directory from path
+dir=$(dirname $0 | sed -e 's/\//\\\//g')
+PATH=$(echo $PATH | sed -e "s/:$dir:/:/")
+wvWare $@
