Index: /release-kits/mark3/ant-scripts/build.xml
===================================================================
--- /release-kits/mark3/ant-scripts/build.xml	(revision 16526)
+++ /release-kits/mark3/ant-scripts/build.xml	(revision 16526)
@@ -0,0 +1,42 @@
+<?xml version="1.0" encoding="utf-8" ?>
+
+<!--
+		.......................................................... 
+		February 2008
+		Linux Release Kit for Greenstone3 (lirk3)
+		Oran Fry
+		..........................................................
+-->
+
+<project name="lirk3-build" default="lirk3">
+
+	<!-- CONSTANTS -->
+
+	<!-- the version numbers of bundled things -->
+	<property name="bundled.version.tomcat" value="5.5.25"/>
+	<property name="bundled.version.ant" value="1.6.5"/>
+
+	<!-- set current month and year-->
+	<exec executable="date" outputproperty="current.month"><arg value="+%b"/></exec>
+	<exec executable="date" outputproperty="current.year"><arg value="+%Y"/></exec>
+
+	<!-- for the benefit of the shared scripts, set release-kit home -->
+	<property name="rk.home" value="${lirk3.home}" />
+
+
+	<!-- IMPORT OTHER ANT SCRIPTS -->
+	<import file="shared-ant-scripts/init.xml"/>
+	<import file="compile.xml"/>
+	<import file="create-distribution.xml"/>
+	<import file="create-installer.xml"/>
+	<import file="wrap.xml"/>
+
+	<!-- THE MAIN TARGET -->
+	<target name="lirk3" depends="init">
+		<addressedcall target="compile"/>
+		<addressedcall target="create-distribution"/>
+		<addressedcall target="create-installer"/>
+		<addressedcall target="wrap"/>
+	</target>
+
+</project>
Index: /release-kits/mark3/ant-scripts/compile.xml
===================================================================
--- /release-kits/mark3/ant-scripts/compile.xml	(revision 16526)
+++ /release-kits/mark3/ant-scripts/compile.xml	(revision 16526)
@@ -0,0 +1,195 @@
+<?xml version="1.0" encoding="utf-8" ?>
+<project name="lirk3-compile" default="compile">
+
+
+	<target name="compile">
+
+		<!-- checkout -->
+		<addressedcall target="checkout-greenstone3" />
+
+		<!-- preparation -->
+		<addressedcall target="set-version-number-property" />
+		<addressedcall target="dist-prepare-unix" />
+		<addressedcall target="tweak-configure-scripts" />
+
+		<!-- update -->
+		<addressedcall target="dist-update-unix" />
+
+		<!-- configure -->
+		<addressedcall target="dist-configure-unix" />
+		<addressedcall target="tweak-makefiles" />
+
+		<!-- build -->
+		<addressedcall target="dist-build-unix" />
+		<addressedcall target="fix-wget" />
+		<addressedcall target="linux-strip-execs" />
+
+		<!-- documentation -->
+		<addressedcall target="prepare-documentation" />
+
+	</target>
+
+	<target name="checkout-greenstone3">
+		<if><bool><istrue value="${execute}"/></bool>
+			<svn>
+				<checkout url="${svn.root}/greenstone3/${branch.path}" destPath="greenstone3"/>
+			</svn>
+		</if>
+	</target>
+
+	<target name="set-version-number-property">
+		<if><bool><istrue value="${execute}"/></bool>
+			<rsr file="greenstone3/resources/java/global.properties.in" pattern="(.*)@gsdl3version@(.*)" replacement="$1${version}$2" />
+		</if>
+	</target>
+
+	<target name="dist-prepare-unix">
+		<if><bool><istrue value="${execute}"/></bool>
+			<ant dir="greenstone3" antfile="${lirk3.home}/ant-scripts/operations-on-gs3home.xml" target="prepare-unix"  inheritAll="false"/>
+		</if>	
+	</target>
+	<target name="tweak-configure-scripts">
+		<addressedcall target="mgpp-add-static" />
+		<addressedcall target="mg-add-static" />
+		<addressedcall target="gs2buildextra-add-static" />
+	</target>
+
+	<target name="dist-update-unix">
+		<if><bool><istrue value="${execute}"/></bool>
+			<ant dir="greenstone3" antfile="${lirk3.home}/ant-scripts/operations-on-gs3home.xml" target="update-unix"  inheritAll="false"/>
+		</if>
+	</target>
+
+	<target name="dist-configure-unix">
+		<if><bool><istrue value="${execute}"/></bool>
+			<exec dir="greenstone3/gs2build/gs2build-extra" executable="autoconf" output="greenstone3/gs2build/configure">
+				<arg line="configure.in"/>
+			</exec>
+			<chmod file="greenstone3/gs2build/configure" perm="+x"/>
+			<ant dir="greenstone3" antfile="${lirk3.home}/ant-scripts/operations-on-gs3home.xml" target="configure-unix" inheritAll="false"/>
+		</if>
+	</target>
+
+	<target name="tweak-makefiles">
+		<addressedcall target="wv-add-static" />
+		<addressedcall target="xlhtml-add-static" />
+		<addressedcall target="ppthtml-add-static" />
+		<addressedcall target="rtftohtml-add-static" />
+		<addressedcall target="gdbm-add-static" />
+	</target>
+
+	<target name="dist-build-unix">
+		<if><bool><istrue value="${execute}"/></bool>
+			<ant dir="greenstone3" antfile="${lirk3.home}/ant-scripts/operations-on-gs3home.xml" target="build-unix" inheritAll="false"/>
+		</if>
+	</target>
+
+	<target name="fix-wget">
+		<if><bool><istrue value="${execute}"/></bool>
+			<!-- fix this !!! -->
+		  <delete file="greenstone3/gs2build/packages/wget/wget-1.9/src/wget"/>
+		</if>
+	</target>
+
+	<target name="linux-strip-execs">
+		<if><bool><istrue value="${execute}"/></bool>
+			<exec dir="greenstone3/gs2build/bin/linux" executable="find">
+				<arg line="! -name . -exec strip {} &#59;"/>
+			</exec>
+		</if>
+	</target>
+
+	<target name="prepare-documentation">
+		<if><bool><istrue value="${execute}"/></bool>
+			<mkdir dir="greenstone3/gsdl-manuals"/>
+			<svn>
+				<checkout url="${svn.root}/documentation/${branch.path}/manuals" destPath="greenstone3/gsdl-manuals/manuals"/>
+				<checkout url="${svn.root}/documentation/${branch.path}/shared" destPath="greenstone3/gsdl-manuals/shared"/>
+			</svn>
+			<javac srcdir="greenstone3/gsdl-manuals/shared"
+			      destdir="greenstone3/gsdl-manuals/shared"
+			      debug="on">
+				<include name="*.java"/>
+			</javac>
+			<unzip src="greenstone3/gsdl-manuals/shared/fop.zip" dest="greenstone3/gsdl-manuals/shared"/>
+
+			<path id="documentation.compile.classpath">
+				<fileset dir="greenstone3/gsdl-manuals">
+					<include name="**/*.jar"/>
+				</fileset>
+				<pathelement path="greenstone3/gsdl-manuals/shared"/>
+				<pathelement path="greenstone3/gsdl-manuals/manuals"/>
+			</path>
+
+			<java classname="ApplyXSLT" classpathref="documentation.compile.classpath" output="greenstone3/gsdl-manuals/manuals/xml-source/en/help-en.xml">
+				<arg value="greenstone3/gsdl-manuals/manuals/processing/gen-gli-help-to-manual-chapter.xsl" />
+				<arg value="greenstone3/gli/help/en/help.xml" />
+				<arg value="greenstone3" />
+			</java>
+
+			<chmod perm="a+x" file="greenstone3/gsdl-manuals/shared/fop/fop.sh"/>
+			<echo>Run generate-pdf.sh</echo>
+			<exec dir="greenstone3/gsdl-manuals/manuals" executable="/bin/sh">
+				<arg line="generate-pdf.sh u en" />
+			</exec>
+		</if>
+	</target>
+
+	<!--
+
+		third level targets
+
+	-->
+
+	<target name="mgpp-add-static">
+		<if><bool><istrue value="${execute}"/></bool>
+			<rsr file="greenstone3/gs2build/indexers/mgpp/configure.in" pattern="^LDFLAGS=$" replacement="LDFLAGS=-static" />
+			<exec dir="greenstone3/gs2build/indexers/mgpp" executable="autoconf" output="greenstone3/gs2build/indexers/mgpp/configure">
+				<arg line="configure.in"/>
+			</exec>
+		</if>
+	</target>
+	<target name="mg-add-static">
+		<if><bool><istrue value="${execute}"/></bool>
+			<rsr file="greenstone3/gs2build/indexers/mg/configure.in" pattern="^LDFLAGS=$" replacement="LDFLAGS=-static" />
+			<exec dir="greenstone3/gs2build/indexers/mg" executable="autoconf" output="greenstone3/gs2build/indexers/mg/configure">
+				<arg line="configure.in"/>
+			</exec>
+		</if>
+	</target>
+	<target name="gs2buildextra-add-static">
+		<if><bool><istrue value="${execute}"/></bool>
+			<rsr file="greenstone3/gs2build/gs2build-extra/packages.configure" pattern="^ENVIRONMENT=&quot;&quot;$" replacement="ENVIRONMENT=&quot;LDFLAGS=-static&quot;" />
+			<rsr file="greenstone3/gs2build/gs2build-extra/configure.in" pattern="^LDFLAGS=$" replacement="LDFLAGS=-static" />
+		</if>
+	</target>
+
+	<target name="wv-add-static">
+		<if><bool><istrue value="${execute}"/></bool>
+			<rsr file="greenstone3/gs2build/packages/wv/wv-gs/Makefile" pattern="^LDFLAGS =\s*$" replacement="LDFLAGS = -static" />
+		</if>
+	</target>
+	<target name="xlhtml-add-static">
+		<if><bool><istrue value="${execute}"/></bool>
+			<rsr file="greenstone3/gs2build/packages/xlhtml/xlhtml-0.4.9.0/xlhtml/Makefile" pattern="^LDFLAGS =\s*$" replacement="LDFLAGS = -static" />
+		</if>
+	</target>
+	<target name="ppthtml-add-static">
+		<if><bool><istrue value="${execute}"/></bool>
+			<rsr file="greenstone3/gs2build/packages/xlhtml/xlhtml-0.4.9.0/ppthtml/Makefile" pattern="^LDFLAGS =\s*$" replacement="LDFLAGS = -static" />
+		</if>
+	</target>
+	<target name="rtftohtml-add-static">
+		<if><bool><istrue value="${execute}"/></bool>
+			<rsr file="greenstone3/gs2build/packages/rtftohtml/rtftohtml_src/Makefile" pattern="-o rtftohtml(.{2})EXEEXT(.{1})" replacement="-o rtftohtml$1EXEEXT$2 -static" />
+		</if>
+	</target>
+	<target name="gdbm-add-static">
+		<if><bool><istrue value="${execute}"/></bool>
+			<rsr file="greenstone3/src/packages/javagdbm/jni/Makefile" pattern="^(GDBM_LIBS)\s*=\s*(.*)-lgdbm(.*)$" replacement="$1=$2/usr/lib/libgdbm.a$3" />
+		</if>
+	</target>
+
+
+
+</project>
Index: /release-kits/mark3/ant-scripts/create-distribution.xml
===================================================================
--- /release-kits/mark3/ant-scripts/create-distribution.xml	(revision 16526)
+++ /release-kits/mark3/ant-scripts/create-distribution.xml	(revision 16526)
@@ -0,0 +1,101 @@
+<?xml version="1.0" encoding="utf-8" ?>
+<project name="lirk3-create-distribution" default="create-distribution">
+
+
+	<target name="create-distribution">
+
+		<!-- create distribution -->
+		<addressedcall target="export-greenstone3" />
+		<addressedcall target="dist-set-version-number-property" />
+		<addressedcall target="dist-set-gli-version" />
+		<addressedcall target="create-distributions-1" />
+		<addressedcall target="create-distributions-2" />
+		<addressedcall target="create-distributions-3" />
+		<addressedcall target="copy-over-build-xml" />
+		<addressedcall target="insert-user-manual"/>
+		<addressedcall target="insert-compiled-binaries"/>
+
+	</target>
+
+	<target name="export-greenstone3">
+		<if><bool><istrue value="${execute}"/></bool>
+			<mkdir dir="distribution"/>
+			<delete dir="distribution/greenstone3"/>
+			<svn>
+				<export srcurl="${svn.root}/greenstone3/${branch.path}" destPath="distribution/greenstone3"/>
+				<export srcurl="${svn.root}/gli/${branch.path}" destPath="distribution/greenstone3/gli"/>
+			</svn>
+		</if>
+	</target>
+
+	<target name="dist-set-version-number-property">
+		<if><bool><istrue value="${execute}"/></bool>
+			<rsr file="distribution/greenstone3/resources/java/global.properties.in" pattern="(.*)@gsdl3version@(.*)" replacement="$1${version}$2" />
+		</if>
+	</target>
+
+	<target name="dist-set-gli-version">
+		<if><bool><istrue value="${execute}"/></bool>
+			<ant antfile="${lirk3.home}/ant-scripts/shared-ant-scripts/operations-on-gli.xml" dir="${basedir}/distribution/greenstone3/gli" target="set-version-numbers"/>
+		</if>
+	</target>
+
+
+	<target name="create-distributions-1">
+		<if><bool><istrue value="${execute}"/></bool>
+			<ant antfile="${lirk3.home}/ant-scripts/operations-on-gs3home.xml" dir="distribution/greenstone3" target="create-distribution-1" inheritAll="false">
+				<property name="app.version" value="${version}"/>
+				<property name="branch.path" value="${branch.path}"/>
+			</ant>
+		</if>
+	</target>
+
+	<target name="create-distributions-2">
+		<if><bool><istrue value="${execute}"/></bool>
+			<ant antfile="${lirk3.home}/ant-scripts/operations-on-gs3home.xml" dir="distribution/greenstone3" target="create-distribution-2"  inheritAll="false">
+				<property name="app.version" value="${version}"/>
+				<property name="branch.path" value="${branch.path}"/>
+			</ant>
+		</if>
+	</target>
+
+	<target name="create-distributions-3">
+		<if><bool><istrue value="${execute}"/></bool>
+			<ant antfile="${lirk3.home}/ant-scripts/operations-on-gs3home.xml" dir="distribution/greenstone3" target="create-distribution-3"  inheritall="false">
+				<property name="app.version" value="${version}"/>
+				<property name="branch.path" value="${branch.path}"/>
+			</ant>
+		</if>
+	</target>
+
+	<target name="copy-over-build-xml">
+		<if><bool><istrue value="${execute}"/></bool>
+			<move file="distribution/greenstone3/modified-build.xml" tofile="distribution/greenstone3/build.xml"/>
+		</if>
+	</target>
+
+	<target name="insert-user-manual">
+		<if><bool><istrue value="${execute}"/></bool>
+			<copy file="greenstone3/gsdl-manuals/manuals/build/en/pdf/User_en.pdf" tofile="distribution/greenstone3/docs/manual/gs2_user_en.pdf"/>
+		</if>
+	</target>
+
+	<target name="insert-compiled-binaries">
+		<if><bool><istrue value="${execute}"/></bool>
+
+			<delete dir="distribution/greenstone3/lib/jni"/>
+			<exec executable="cp"><arg line="-r greenstone3/lib/jni distribution/greenstone3/lib"/></exec>
+
+			<delete dir="distribution/greenstone3/gs2build/bin/linux"/>
+			<exec executable="cp"><arg line="-r greenstone3/gs2build/bin/linux distribution/greenstone3/gs2build/bin"/></exec>
+
+			<delete dir="distribution/greenstone3/gs2build/bin/java"/>
+			<exec executable="cp"><arg line="-r greenstone3/gs2build/bin/java distribution/greenstone3/gs2build/bin"/></exec>
+
+		</if>
+	</target>
+
+
+
+
+</project>
Index: /release-kits/mark3/ant-scripts/create-installer.xml
===================================================================
--- /release-kits/mark3/ant-scripts/create-installer.xml	(revision 16526)
+++ /release-kits/mark3/ant-scripts/create-installer.xml	(revision 16526)
@@ -0,0 +1,98 @@
+<?xml version="1.0" encoding="utf-8" ?>
+<project name="lirk3-create-installer" default="create-installer">
+
+	<target name="create-installer">
+		<addressedcall target="setup-for-installer-creation"/>
+		<addressedcall target="compile-installer"/>
+	</target>
+
+	<target name="setup-for-installer-creation">
+		<if><bool><istrue value="${execute}"/></bool>
+
+			<!-- get the size of packages -->
+			<exec executable="du" dir="${basedir}/distribution/greenstone3/packages" outputproperty="du.tomcat"><arg line="-hs tomcat"/></exec>
+			<exec executable="sed" inputstring="${du.tomcat}" outputproperty="component.size.tomcat"><arg line="-e 's/^\(.*\)\s.*$/\1b/g'"/></exec>
+
+			<exec executable="du" dir="${basedir}/distribution/greenstone3/packages" outputproperty="du.ant"><arg line="-hs ant"/></exec>
+			<exec executable="sed" inputstring="${du.ant}" outputproperty="component.size.ant"><arg line="-e 's/^\(.*\)\s.*$/\1b/g'"/></exec>
+
+			<echo>Project Path: ${basedir}/distribution/greenstone3</echo>
+
+			<echo>Getting things ready to compile the installer</echo>
+			<mkdir dir="${basedir}/installer/resources"/>
+			<copy todir="${basedir}/installer" file="${lirk3.home}/installer/antinstall-config.xml" overwrite="true" />
+			<copy todir="${basedir}/installer" file="${lirk3.home}/installer/build.xml" overwrite="true" />
+			<copy todir="${basedir}/installer/classes" overwrite="true">
+				<fileset dir="${lirk3.home}/greenstone3/installer-classes"/>
+				<fileset dir="${lirk3.home}/ant-scripts/tasks/orans" includes="RegexSearchReplace.class" />
+			</copy>
+
+			<!-- put the concrete values of things in the config -->
+			<rsr file="${basedir}/installer/antinstall-config.xml" pattern="@version@" replacement="${version}"/>
+			<rsr file="${basedir}/installer/antinstall-config.xml" pattern="@component.size.linux-java@" replacement="${component.size.linux-java}"/>
+			<rsr file="${basedir}/installer/antinstall-config.xml" pattern="@component.size.tomcat@" replacement="${component.size.tomcat}"/>
+			<rsr file="${basedir}/installer/antinstall-config.xml" pattern="@component.size.ant@" replacement="${component.size.ant}"/>
+
+			<rsr file="${basedir}/installer/build.xml" pattern="@java.min.version@" replacement="${java.min.version}"/>
+			<rsr file="${basedir}/installer/build.xml" pattern="@java.extracted@" replacement="${linux-java.extracted}"/>
+
+
+			<!-- put the concrete values of things in the text -->
+
+			<!-- default -->
+			<rsr file="${basedir}/installer/classes/resources/LanguagePack.properties" pattern="@version@" replacement="${version}"/>
+			<rsr file="${basedir}/installer/classes/resources/LanguagePack.properties" pattern="@java.min.version@" replacement="${java.min.version}"/>
+			<rsr file="${basedir}/installer/classes/resources/LanguagePack.properties" pattern="@bundled.version.java@" replacement="${bundled.version.linux-java}"/>
+			<rsr file="${basedir}/installer/classes/resources/LanguagePack.properties" pattern="@bundled.version.tomcat@" replacement="${bundled.version.tomcat}"/>
+			<rsr file="${basedir}/installer/classes/resources/LanguagePack.properties" pattern="@bundled.version.ant@" replacement="${bundled.version.ant}"/>
+
+			<!-- chinese -->
+			<rsr file="${basedir}/installer/classes/resources/LanguagePack_zh_CN.properties" pattern="@version@" replacement="${version}"/>
+			<rsr file="${basedir}/installer/classes/resources/LanguagePack_zh_CN.properties" pattern="@java.min.version@" replacement="${java.min.version}"/>
+			<rsr file="${basedir}/installer/classes/resources/LanguagePack_zh_CN.properties" pattern="@bundled.version.java@" replacement="${bundled.version.linux-java}"/>
+			<rsr file="${basedir}/installer/classes/resources/LanguagePack_zh_CN.properties" pattern="@bundled.version.tomcat@" replacement="${bundled.version.tomcat}"/>
+			<rsr file="${basedir}/installer/classes/resources/LanguagePack_zh_CN.properties" pattern="@bundled.version.ant@" replacement="${bundled.version.ant}"/>
+
+		</if>
+	</target>
+
+	<target name="compile-installer">
+		<if><bool><istrue value="${execute}"/></bool>
+
+			<installer file="${basedir}/installer/greenstone3-with-java.jar"
+					compress="true"
+					extractType="NonExtractor"
+					installConfig="${basedir}/installer/antinstall-config.xml"
+					buildFile="${basedir}/installer/build.xml"
+					antInstallLib="${lirk3.home}/packages/ant-installer/lib"
+					antLib="${lirk3.home}/packages/ant/lib"
+					validateConfig="true"
+					failOnError="false"
+					icons="bluecurve">
+
+				<!-- copy all the important files into the archive to be extracted for install -->
+				<zipfileset dir="${basedir}/installer/classes" includes="**/*" /> <!-- installer classes -->
+				<zipfileset dir="${basedir}/distribution/greenstone3" includes="**/*"/>
+
+			</installer>
+
+			<!-- delete the 'bundled java only' lines from the installer config -->
+			<rsr file="${basedir}/installer/antinstall-config.xml" pattern=".*&lt;!-- bundled java only --&gt;" replacement=""/>
+
+			<installer file="${basedir}/installer/greenstone3.jar"
+					compress="true"
+					extractType="NonExtractor"
+					installConfig="${basedir}/installer/antinstall-config.xml"
+					buildFile="${basedir}/installer/build.xml"
+					antInstallLib="${lirk3.home}/packages/ant-installer/lib"
+					antLib="${lirk3.home}/packages/ant/lib"
+					validateConfig="true"
+					icons="bluecurve">
+
+				<zipfileset dir="${basedir}/installer/classes" includes="**/*"/>
+				<zipfileset dir="${basedir}/distribution/greenstone3" includes="**/*"/>
+			</installer>
+		</if>
+	</target>
+
+</project>
Index: /release-kits/mark3/ant-scripts/operations-on-gs3home.xml
===================================================================
--- /release-kits/mark3/ant-scripts/operations-on-gs3home.xml	(revision 16526)
+++ /release-kits/mark3/ant-scripts/operations-on-gs3home.xml	(revision 16526)
@@ -0,0 +1,351 @@
+<?xml version="1.0"?>
+
+<!-- ====================================================================== 
+     March 2005                                                    
+
+     Greenstone3 build and install script
+                   
+     kjdon                                                                
+     ====================================================================== -->
+
+<project name="opeations-on-gs3home" default="usage">
+  
+	<!-- include standard build file -->
+	<import file="${basedir}/build.xml"/>
+
+	<property name="documented.collections.home" value="/home/nzdl/for-distributions/collect"/>
+	<property name="greenstone3-change-date" value="Tue Feb 20 12:13:42 NZDT 2007"/>
+	<property name="gs2build-change-date" value="Wed Dec 13 10:35:57 NZDT 2006"/>
+
+	<!-- ====================== DISTRIBUTION Targets ========================= -->
+
+	<!-- Create the binaries for Unix/Mac distributions -->
+	<target name="prepare-unix" depends="init">
+		<antcall target="checkout-gs2build"/>
+		<antcall target="checkout-gli"/>
+	</target>
+
+	<target name="update-unix" depends="init">
+		<antcall target="svnupdate-distribution"/>
+		<antcall target="rename-gs2build-files-unix"/>
+		<antcall target="delete-windows-files"/>
+	</target>
+
+	<target name="configure-unix" depends="init">
+		<antcall target="configure-c++"/>
+	</target>    
+	<target name="build-unix" depends="init">
+		<antcall target="compile-packages"/>
+		<antcall target="compile-gs2build"/>
+	</target>
+    
+
+
+	<!-- creates the base distribution. Needs binaries copied in to it from other greenstones (prepare-os targets) -->
+	<target name="create-distribution-1" depends="init" description="do all the initial downloading and setting up">
+
+		<antcall target="checkout-gs2build"/>
+
+		<!--
+		gli is now checked out by create-distribution.xml
+		so it already exists
+		<antcall target="checkout-gli"/>
+		-->
+
+		<delete><fileset dir="." includes="*.bat"/></delete>
+		<!--<delete file="${gli.home}/gli.sh"/>-->
+		<delete file="${gli.home}/gems.sh"/>
+		<antcall target="rename-gs2build-files-dist"/>    
+		<delete dir="${gs2build.home}/gs2build-extra"/>
+
+		<antcall target="prepare-tomcat"/>
+		<delete file="${packages.home}/apache-tomcat-5.5.25.zip"/>
+		<delete file="${packages.home}/apache-tomcat-5.5.25-compat.zip"/>
+
+		<antcall target="prepare-axis"/>
+		<delete file="${packages.home}/axis-bin-1_2_1.zip"/>
+
+		<!-- delete old axis dir -->
+		<delete dir="${packages.home}/axis"/>
+		<mkdir dir="${web.home}/applet"/>
+		<mkdir dir="${web.home}/logs"/>
+		<antcall target="prepare-ant"/>
+		<delete file="${packages.home}/apache-ant-1.7.0-bin.zip"/>
+		<antcall target="prepare-collections"/>
+
+		<!-- get good XML-Parser - does this work? -->
+		<antcall target="get-xml-parser"/>
+
+		<!-- documented collections -->
+		<antcall target="get-documented-collections"/>
+
+		<delete file="${basedir}/README-CVS.txt"/>
+		<delete file="${basedir}/TODO.txt"/>
+
+		<!-- make the extra directories needed for a release -->
+		<!--<mkdir dir="${basedir}/Linux/lib/jni"/>
+		<mkdir dir="${gs2build.home}/Unix/bin/linux"/>-->
+
+	</target>
+
+	<target name="create-distribution-2" description="do all the compilation">
+
+		<!-- compile the java stuff -->
+		<antcall target="compile-web"/>
+		<antcall target="configure-tomcat"/>
+		<antcall target="configure-packages-and-indexers"/>
+		<antcall target="compile-packages-and-indexers-javaonly"/>
+		<antcall target="distclean-packages"/>
+		<antcall target="compile-core"/>
+		<antcall target="compile-gli"/>
+
+	</target>
+
+	<target name="create-distribution-3" depends="init" description="Do the rearranging of source code and others">
+
+		<!-- delete some source files -->
+		<delete dir="${gs2build.home}/source/src"/>
+		<delete dir="${gs2build.home}/source/lib"/>
+		<delete dir="${gs2build.home}/source/packages"/>
+		<delete dir="${gs2build.home}/source/indexers"/>
+
+		<!-- generate modified build.xml file -->
+		<antcall target="run-xslt-binary"/>
+
+		<!-- clean up -->
+		<delete><fileset dir="${basedir}" includes="**/.svn"/></delete>
+
+		<delete><fileset dir="${basedir}" includes="*.bat"/></delete>
+		<delete><fileset dir="${basedir}/gli" includes="*.bat"/></delete>
+		<delete><fileset dir="${basedir}/gs2build" includes="*.bat"/></delete>
+		<delete><fileset dir="${basedir}/bin/script" includes="*.bat"/></delete>
+
+		<delete dir="${basedir}/build"/>
+		<delete dir="${basedir}/lib/jni"/>
+		<delete dir="${basedir}/winutil"/>
+		<delete dir="${basedir}/dist-resources"/>
+		<delete dir="${basedir}/gs2build/source"/>
+
+		<delete file="${basedir}/gs2build/WIN32cfg.h"/>
+		<delete file="${basedir}/gs2build/win32.mak"/>
+
+	</target>
+  
+	<!-- Supplementary targets -->
+
+	<target name="svnupdate-distribution" depends="init">
+		<antcall target="svnupdate-packages"/>
+		<antcall target="svnupdate-core"/>
+		<antcall target="svnupdate-gs2build"/>
+		<antcall target="svnupdate-web"/>
+	</target>
+
+	<target name="run-xslt-binary" depends="init">
+		<xslt in="${basedir}/build.xml" out="${basedir}/modified-build.xml" style="${lirk3.home}/greenstone3/xsl/convert-build-xml.xsl"/>
+	</target>
+
+	<target name="run-xslt-source" depends="init">
+		<xslt in="${basedir}/build.xml" out="${basedir}/modified-build.xml" style="${lirk3.home}/greenstone3/xsl/convert-build-xml-source.xsl"/>
+	</target>
+  
+	<target name="rename-gs2build-files-dist" depends="init,rename-gs2build-files-unix">
+		<copy file="${gs2build-extra.home}/lib.win32.mak" tofile="${gs2build.home}/lib/win32.mak"/>
+		<copy file="${gs2build-extra.home}/win32.mak" tofile="${gs2build.home}/win32.mak"/>
+		<copy file="${gs2build-extra.home}/setup.bat" tofile="${gs2build.home}/setup.bat"/>
+	</target>   
+
+  <target name="configure-packages-and-indexers" depends="init">
+    <exec executable="${indexers.home}/configure"
+      dir="${indexers.home}">
+      <arg value="--prefix=${basedir}"/>
+      <arg value="--libdir=${lib.jni}"/>
+    </exec>          
+    <exec executable="${javagdbm.home}/configure"
+      dir="${javagdbm.home}">
+      <arg value="--prefix=${basedir}"/>
+      <arg value="--libdir=${lib.jni}"/>
+    </exec>    
+
+  </target>
+
+  <target name="compile-packages-and-indexers-javaonly" depends="init">
+    <echo>Compiling Indexers</echo>
+    <exec executable="make" os="${os.unix}"
+       dir="${indexers.home}">
+      <arg value="javaonly"/>
+    </exec>
+    <exec executable="make" os="${os.unix}"
+      dir="${indexers.home}">
+      <arg value="install-javaonly"/>
+    </exec>
+    <!-- install the jar files -->
+    <copy file="${mg.home}/mg.jar" todir="${lib.jni}"/>
+    <copy file="${mgpp.home}/mgpp.jar" todir="${lib.jni}"/>
+    <copy file="${lucene.home}/LuceneWrapper.jar" todir="${web.lib}"/>
+    
+    <!-- javagdbm -->
+    <exec executable="make" os="${os.unix}"
+      dir="${javagdbm.home}">
+      <arg value="javaonly"/>
+    </exec>
+    <exec executable="make" os="${os.unix}"
+      dir="${javagdbm.home}">
+      <arg value="installjava"/>
+    </exec>
+    <!-- install the jar file -->
+    <copy file="${javagdbm.home}/javagdbm.jar" todir="${lib.jni}"/>
+
+  </target>
+
+  <target name="delete-windows-files" depends="init" unless="current.os.iswindows">
+    <delete dir="${basedir}/winutil"/>
+    <delete>
+      <fileset dir="${lib.jni}" includes="*.dll"/>
+    </delete>
+  </target>
+
+  <target name="get-perl-for-windows" depends="init" if="current.os.iswindows">
+    <mkdir dir="${gs2build.home}/bin/windows"/>
+    <get src="http://www.greenstone.org/gs3files/perl-for-windows.zip"
+      dest="${gs2build.home}/bin/windows/perl-for-windows.zip"
+      usetimestamp="true"/>
+    <unzip src="${gs2build.home}/bin/windows/perl-for-windows.zip" 
+      dest="${gs2build.home}/bin/windows"/>
+    <delete file="${gs2build.home}/bin/windows/perl-for-windows.zip"/>
+  </target>
+
+  <target name="distclean-packages" depends="init">
+    <!-- indexers : just call the make target -->
+    <exec executable="make" os="${os.unix}"
+      dir="${indexers.home}">
+      <arg value="distclean"/>
+    </exec>
+    <!-- javagdbm -->
+    <exec executable="make" os="${os.unix}"
+      dir="${javagdbm.home}">
+      <arg value="distclean"/>
+    </exec>
+  </target>
+
+  <!-- copy the doc eg colls from /home/nzdl - note we don't include the formatting ones -->
+  <target name="get-documented-collections" depends="init">
+    <property name="collect.home" value="${basedir}/web/sites/localsite/collect"/>
+
+<!--    <copy todir="${collect.home}/authen-e">
+      <fileset dir="${documented.collections.home}/authen-e"/>
+    </copy>
+    <copy todir="${collect.home}/bibliog1">
+      <fileset dir="${documented.collections.home}/bibliog1"/>
+    </copy>
+    <copy todir="${collect.home}/bibliogr">
+      <fileset dir="${documented.collections.home}/bibliogr"/>
+    </copy>
+    <copy todir="${collect.home}/dls-e">
+      <fileset dir="${documented.collections.home}/dls-e"/>
+    </copy>
+    <copy todir="${collect.home}/dspace-e">
+      <fileset dir="${documented.collections.home}/dspace-e"/>
+    </copy>
+    <copy todir="${collect.home}/gsarch-e">
+      <fileset dir="${documented.collections.home}/gsarch-e"/>
+    </copy>
+    <copy todir="${collect.home}/image-e">
+      <fileset dir="${documented.collections.home}/image-e"/>
+    </copy>
+    <copy todir="${collect.home}/isis-e">
+      <fileset dir="${documented.collections.home}/isis-e"/>
+    </copy>
+    <copy todir="${collect.home}/oai-e">
+      <fileset dir="${documented.collections.home}/oai-e"/>
+    </copy>
+    <copy todir="${collect.home}/pagedimg-e">
+      <fileset dir="${documented.collections.home}/pagedimg-e"/>
+    </copy>
+    <copy todir="${collect.home}/wrdpdf-e">
+      <fileset dir="${documented.collections.home}/wrdpdf-e"/>
+    </copy>
+
+    <copy todir="${collect.home}/garish">
+      <fileset dir="${documented.collections.home}/garish"/>
+    </copy>
+    <copy todir="${collect.home}/marcexam">
+      <fileset dir="${documented.collections.home}/marcexam"/>
+    </copy>
+    <copy todir="${collect.home}/style-e">
+      <fileset dir="${documented.collections.home}/style-e"/>
+    </copy>
+    <copy todir="${collect.home}/wiki">
+      <fileset dir="${documented.collections.home}/wiki"/>
+    </copy> -->
+  </target>
+
+  <target name="get-xml-parser" depends="init">
+    <get src="http://www.greenstone.org/gs3files/XML-Parser.tar.gz" dest="${gs2build.home}/perllib/cpan/XML-Parser.tar.gz" usetimestamp="true"/>
+    <untar src="${gs2build.home}/perllib/cpan/XML-Parser.tar.gz" dest="${gs2build.home}/perllib/cpan/" compression="gzip"/>
+    <delete file="${gs2build.home}/perllib/cpan/XML-Parser.tar.gz"/>
+  </target>
+
+<!--  <target name="create-changelog"> -->
+    <!-- generate greenstone 3 changelog -->
+<!--    <exec executable="/home/nzdl/for-distributions/bin/script/cvs2cl.pl"
+      dir="${basedir}">
+      <arg value="-P"/>
+      <arg value="-F"/>
+      <arg value="trunk"/>
+      <arg value="-r"/>
+      <arg value="-S"/>
+      <arg value="-l"/>
+      <arg value="-d'${greenstone3-change-date}&lt;tomorrow'"/>
+      <arg value="-f"/>
+      <arg value="greenstone-${app.version}-ChangeLog.txt"/>
+      <arg value="-I"/>
+      <arg value="gli/.*|gs2build/.*"/>
+    </exec> -->
+    <!-- generate coll building change log -->
+<!--    <exec executable="/home/nzdl/for-distributions/bin/script/cvs2cl.pl"
+      dir="${basedir}">
+      <arg value="-P"/>
+      <arg value="-F"/>
+      <arg value="trunk"/>
+      <arg value="-r"/>
+      <arg value="-S"/>
+      <arg value="-l"/>
+      <arg value="-d'${gs2build-change-date}&lt;tomorrow'"/>
+      <arg value="-f"/>
+      <arg value="greenstone-${app.version}-ChangeLog-collbuilding.txt"/>
+      <arg value="gli"/>
+      <arg value="gs2build"/>
+    </exec> 
+  </target> -->
+
+
+  <!-- new targets to go in distribution build.xml files -->
+
+  <!-- new usage target for binary release -->
+  <target name="usage-for-binary-dist" description="Print a help message">
+    <echo message="  Execute 'ant -projecthelp' for a list of targets."/>
+    <echo message="  Execute 'ant -help' for Ant help."/>
+  </target>
+    
+
+  <!-- new install target for source distribution -->
+  <target name="install-for-source-dist" depends="init" description="install the source distribution. Includes configuring and compiling">
+    <antcall target="unzip-windows-packages"/>
+    <!-- do the java version dependent stuff -->
+    <antcall target="configure-java-version"/>
+    <antcall target="install-macos-extra"/>
+    <!-- set gsdlhome in setup.bat -->
+    <antcall target="gs2build-edit-setup-bat"/>
+    <antcall target="install-indexer-files"/>
+    <antcall target="configure"/>
+    <antcall target="configure-c++"/>
+    <antcall target="compile"/>
+    <!-- make sure we have execute permission for the .sh files -->
+    <chmod dir="${basedir}" perm="ugo+rx" 
+      includes="*.sh"/>
+
+  </target>
+
+</project>
+  
+
Index: /release-kits/mark3/ant-scripts/wrap.xml
===================================================================
--- /release-kits/mark3/ant-scripts/wrap.xml	(revision 16526)
+++ /release-kits/mark3/ant-scripts/wrap.xml	(revision 16526)
@@ -0,0 +1,99 @@
+<?xml version="1.0" encoding="utf-8" ?>
+<project name="lirk3-wrap" default="wrap">
+
+	<target name="wrap">
+		<addressedcall target="setup-for-wrapping"/>
+		<addressedcall target="compile-wrapper"/>
+	</target>
+
+	<target name="setup-for-wrapping">
+		<if><bool><istrue value="${execute}"/></bool>
+
+			<!-- create and setup the build directory -->
+			<mkdir dir="${basedir}/wrapped-installer/build"/>
+			<copy todir="${basedir}/wrapped-installer/build" file="${lirk3.home}/linux/wrapper.cpp" overwrite="true" />
+			<copy todir="${basedir}/wrapped-installer/build" file="${lirk3.home}/packages/search4j/libsearch4j.cpp" overwrite="true" />
+			<copy todir="${basedir}/wrapped-installer/build" file="${lirk3.home}/packages/search4j/libsearch4j.h" overwrite="true" />
+
+			<!-- copy bundled files -->
+			<copy todir="${basedir}/wrapped-installer/build" file="${lirk3.home}/linux/${linux-java.installer}"/>
+			<copy todir="${basedir}/wrapped-installer/build" file="${basedir}/installer/greenstone3.jar"/>
+			<copy todir="${basedir}/wrapped-installer/build" file="${basedir}/installer/greenstone3-with-java.jar"/>
+
+			<!-- substitute the real java installer filename and min version into various files -->
+			<rsr file="${basedir}/wrapped-installer/build/wrapper.cpp" pattern="@java.installer@" replacement="${linux-java.installer}"/>
+			<rsr file="${basedir}/wrapped-installer/build/wrapper.cpp" pattern="@installer.name@" replacement="greenstone3"/>
+			<rsr file="${basedir}/wrapped-installer/build/wrapper.cpp" pattern="@java.extracted@" replacement="${linux-java.extracted}"/>
+			<rsr file="${basedir}/wrapped-installer/build/wrapper.cpp" pattern="@java.min.version@" replacement="${java.min.version}"/>
+
+		</if>
+	</target>
+
+	<target name="compile-wrapper">
+		<if><bool><istrue value="${execute}"/></bool>
+
+			<echo level="info">create an object file (extension .o) for each file to bundle</echo>
+			<exec executable="/usr/bin/objcopy" dir="${basedir}/wrapped-installer/build">
+				<arg line="-I binary -O elf32-i386 -B i386 --redefine-sym _binary_greenstone3_jar_start=greenstone3jar --readonly-text greenstone3.jar greenstone3.jar.o"/>
+			</exec>
+			<exec executable="/usr/bin/objcopy" dir="${basedir}/wrapped-installer/build">
+				<arg line="-I binary -O elf32-i386 -B i386 --redefine-sym _binary_greenstone3_with_java_jar_start=greenstone3jar --readonly-text greenstone3-with-java.jar greenstone3-with-java.jar.o"/>
+			</exec>
+			<exec executable="/usr/bin/objcopy" dir="${basedir}/wrapped-installer/build">
+				<arg line="-I binary -O elf32-i386 -B i386 --redefine-sym _binary_${linux-java.installer}_start=java --readonly-text ${linux-java.installer} java.o"/>
+			</exec>
+
+
+			<!-- get size of greenstone.jar -->
+			<exec executable="ls" dir="${basedir}/wrapped-installer/build" outputproperty="greenstone3.jar.ls"><arg line="-l greenstone3.jar"/></exec>
+			<exec executable="sed" inputstring="${greenstone3.jar.ls}" outputproperty="greenstone3.jar.size"><arg line="-e 's/^[^\ ]*\ *[^\ ]*\ *[^\ ]*\ *[^\ ]*\ *\([0-9]*\).*$/\1/g'"/></exec>
+
+			<!-- get size of greenstone-with-java.jar -->
+			<exec executable="ls" dir="${basedir}/wrapped-installer/build" outputproperty="greenstone3-with-java.jar.ls"><arg line="-l greenstone3-with-java.jar"/></exec>
+			<exec executable="sed" inputstring="${greenstone3-with-java.jar.ls}" outputproperty="greenstone3-with-java.jar.size"><arg line="-e 's/^[^\ ]*\ *[^\ ]*\ *[^\ ]*\ *[^\ ]*\ *\([0-9]*\).*$/\1/g'"/></exec>
+
+			<!-- get size of java -->
+			<exec executable="ls" dir="${basedir}/wrapped-installer/build" outputproperty="java.ls"><arg line="-l ${linux-java.installer}"/></exec>
+			<exec executable="sed" inputstring="${java.ls}" outputproperty="java.size"><arg line="-e 's/^[^\ ]*\ *[^\ ]*\ *[^\ ]*\ *[^\ ]*\ *\([0-9]*\).*$/\1/g'"/></exec>
+
+
+			<echo level="info">creating the header file for no java version</echo>
+			<delete file="wrapper.h"/>
+			<exec executable="echo" output="${basedir}/wrapped-installer/build/wrapper.h"><arg line="extern const char greenstone3jar[${greenstone3.jar.size}];"/></exec>
+
+			<echo level="info">compile the wrapper program</echo>
+			<exec executable="g++" dir="${basedir}/wrapped-installer/build">
+				<arg line="-Wall -static -static-libgcc -c -o wrapper.o wrapper.cpp"/>
+			</exec>
+
+			<echo level="info">compile libsearch4j</echo>
+			<exec executable="g++" dir="${basedir}/wrapped-installer/build">
+				<arg line="-Wall -static -static-libgcc -c -o libsearch4j.o libsearch4j.cpp"/>
+			</exec>
+
+			<echo level="info">link, bundling the files to be bundled</echo>
+			<exec executable="g++" dir="${basedir}/wrapped-installer/build">
+				<arg line="-static -static-libgcc -o  ../greenstone-${version}-linux.bin wrapper.o libsearch4j.o greenstone3.jar.o"/>
+			</exec>
+
+
+			<echo level="info">creating the header file for bundled java version</echo>
+			<delete file="wrapper.h"/>
+			<exec executable="echo" output="${basedir}/wrapped-installer/build/wrapper.h"><arg line="extern const char greenstone3jar[${greenstone3-with-java.jar.size}];"/></exec>
+			<exec executable="echo" output="${basedir}/wrapped-installer/build/wrapper.h" append="true"><arg line="extern const char java[${java.size}];"/></exec>
+			<exec executable="echo" output="${basedir}/wrapped-installer/build/wrapper.h" append="true"><arg line="#define java_is_bundled yes"/></exec>
+
+			<echo level="info">recompile the wrapper program</echo>
+			<exec executable="g++" dir="${basedir}/wrapped-installer/build">
+				<arg line="-Wall -static -static-libgcc -c -o wrapper.o wrapper.cpp"/>
+			</exec>
+
+			<echo level="info">relink, bundling the files to be bundled</echo>
+			<exec executable="g++" dir="${basedir}/wrapped-installer/build">
+				<arg line="-static -static-libgcc -o  ../greenstone-${version}-linux-with-java.bin wrapper.o libsearch4j.o greenstone3-with-java.jar.o java.o"/>
+			</exec>
+
+		</if>
+	</target>
+
+</project>
Index: /release-kits/mark3/bin/lirk3
===================================================================
--- /release-kits/mark3/bin/lirk3	(revision 16526)
+++ /release-kits/mark3/bin/lirk3	(revision 16526)
@@ -0,0 +1,94 @@
+function show_help {
+	echo "lirk3 - the LInux Release Kit for greenstone3"
+	echo "Helps you to create releases of Greenstone3 from the Repository"
+	echo
+	echo "usage: lirk3 [-sim] [-from <target>] [other-args]"
+	echo "	-sim"
+	echo "		(shortcut for -Dexecute=false)"
+	echo "		simulation only, don't actually do anything"
+	echo
+	echo "	-from <target>"
+	echo "		(shortcut for -Dresume.from=<target>)"
+	echo "		start execution from the target with the given target address"
+	echo "		first level targets can be referred to by name. E.g., -from compile is the same as -from 1"
+	echo
+	echo "	-descend"
+	echo "		(shortcut for -Dresume.mode=descend)"
+	echo "		execute only the descendents of the target specified with -from"
+	echo "		for example, with -from 3 -descend, targets 3.1, 3.2, 3.3 etc. would be executed, but execution
+	echo "		would stop before target 4
+	echo
+	echo "	-cp"
+	echo "		show the classpath being used by LiRK3"
+	echo "		(like `ant --diagnostics`)"
+	
+}
+
+#work out the classpath
+CLASSPATH=$JAVA_HOME/lib/tools.jar
+for file in $LIRK3_HOME/lib/*.jar; do
+	CLASSPATH=$CLASSPATH:$file
+done
+for file in $LIRK3_HOME/packages/ant/lib/*.jar; do
+	CLASSPATH=$CLASSPATH:$file
+done
+for file in $LIRK3_HOME/packages/ant-installer/lib/*.jar; do
+	CLASSPATH=$CLASSPATH:$file
+done
+CLASSPATH=$CLASSPATH:$LIRK3_HOME/packages/ant-installer/classes
+
+
+#create the command
+toexec="$LIRK3_HOME/packages/ant/bin/ant -lib `pwd`/installer/classes -f $LIRK3_HOME/ant-scripts/build.xml -Dbasedir=`pwd` -Dlirk3.home=$LIRK3_HOME"
+
+#pass on the arguments
+while [ "$1" != "" ]; do
+
+	if [ "$1" == "-help" ]; then
+		show_help
+		exit
+
+	elif [ "$1" == "-cp" ]; then
+		echo $CLASSPATH
+		exit
+
+	elif [ "$1" == "-sim" ]; then
+		toexec="$toexec -Dexecute=false"
+		shift
+
+	elif [ "$1" == "-descend" ]; then
+		toexec="$toexec -Dresume.mode=descend"
+		shift
+
+	elif [ "$1" == "-from" ]; then
+
+		toexec="$toexec -Dresume.from="
+		from=`echo $2 | sed 's/compile/1/g' | sed 's/create-distributions/2/g' | sed 's/create-installer/3/g' | sed 's/wrap/4/g'`
+		toexec=$toexec$from
+		shift 2
+
+	elif [ "$1" == "-to" ]; then
+
+		toexec="$toexec -Dresume.to="
+		to=`echo $2 | sed 's/compile/1/g' | sed 's/create-distributions/2/g' | sed 's/create-installer/3/g' | sed 's/wrap/4/g'`
+		toexec=$toexec$to
+		shift 2
+
+
+	else
+		toexec="$toexec $1"
+		shift
+	fi
+
+done
+
+#echo $toexec
+echo "O---------------------------------------O"
+echo "|                                       |"
+echo "|   LiRK3                               |"
+echo "|   Linux Release Kit for Greenstone3   |"
+echo "|                                       |"
+echo "O---------------------------------------O"
+echo "Basedir  : `pwd`"
+
+$toexec
Index: /release-kits/mark3/installer/antinstall-config.xml
===================================================================
--- /release-kits/mark3/installer/antinstall-config.xml	(revision 16526)
+++ /release-kits/mark3/installer/antinstall-config.xml	(revision 16526)
@@ -0,0 +1,56 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE installer PUBLIC "-//tp23 //DTD Ant Installer Config//EN" "http://antinstaller.sf.net/dtd/antinstall-config-0.8.dtd">
+
+<installer
+			ui="swing,text"
+			verbose="true"
+			debug="false"
+			lookAndFeel="org.tp23.jgoodies.plaf.plastic.PlasticXPLookAndFeel"
+			name="Greenstone3 @version@ Installer"
+			windowIcon="/resources/icon.png"
+			defaultImageResource="/resources/header.png"
+			minJavaVersion="1.4">
+
+	<!--  simple intro page -->
+	<page type="input" name="intro" displayText="">
+		<comment name="welcome-message"/>
+	</page>
+
+	<!--  type="license" shows a license page to click through -->
+	<page type="license" name="license" resource="/LICENSE.txt"  displayText="" />
+
+	<!--  install destination page -->
+	<page type="input" name="destination" displayText="">
+
+		<directory property="installDir"
+			defaultValue="/usr/local/Greenstone-@version@"
+			defaultValueWin="${env.ProgramFiles}\Greenstone-@version@"
+			create="true"
+			displayText="" />
+
+	</page>
+
+	<page type="input" name="selector" displayText="">
+
+		<comment name="choose-components"/>
+
+		<target target="install-core-components" 	diskRequirement="50Mb"							defaultValue="true"	displayText="" force="true" />
+		<target target="install-java" 				diskRequirement="@component.size.java@"	defaultValue="true"	displayText="" /> <!-- bundled java only -->
+		<target target="install-tomcat"				diskRequirement="@component.size.tomcat@"	defaultValue="true"	displayText="" />
+		<target target="install-ant"					diskRequirement="@component.size.ant@"		defaultValue="true"	displayText="" />
+		<target target="install-source-code"		diskRequirement="10Mb"							defaultValue="false"	displayText="" />
+
+	</page>
+
+	<page type="input" name="tomcat-config" ifProperty="(${install-tomcat}==true)" displayText="">
+
+		<text property="tomcat.server" defaultValue="localhost" displayText=""/>
+		<text property="tomcat.port" defaultValue="8080" displayText=""/>
+		<text property="tomcat.shutdown.port" defaultValue="8005" displayText=""/>
+
+	</page>
+
+	<page type="progress" name="progress" showTargets="false" target="cleanuptarget" displayText="">
+	</page>
+
+</installer>
Index: /release-kits/mark3/installer/build.xml
===================================================================
--- /release-kits/mark3/installer/build.xml	(revision 16526)
+++ /release-kits/mark3/installer/build.xml	(revision 16526)
@@ -0,0 +1,176 @@
+<?xml version="1.0"?>
+<!--
+This is the build.xml run by AntInstaller for the installer
+-->
+
+<project name="Installation">
+
+	<!-- this is required to pick up the properties generated during the install pages -->
+	<property file="${basedir}/ant.install.properties"/>
+
+	<path id="project.classpath">
+		<pathelement path="${antinstaller.jar}"/>
+	</path>
+
+	<!-- custom tasks -->
+	<typedef name="rsr" classname="RegexSearchReplace" classpathref="project.classpath"/>
+
+	<target name="install-core-components" depends="">
+
+		<!-- create the installation directory -->
+		<echo message="Creating Installation directory"/>
+		<echo>basedir: ${basedir}</echo>
+		<echo>installDir: ${installDir}</echo>
+		<echo>antinstaller.jar: ${antinstaller.jar}</echo>
+		<mkdir dir="${installDir}"/>
+
+
+		<!-- install binaries and set executable -->
+		<echo message="Installing Executable Binaries (bin)"/>
+		<unzip src="${antinstaller.jar}" dest="${installDir}"><patternset><include name="bin/**/*"/></patternset></unzip>
+		<echo/>
+
+		<echo message="Installing Documentation (docs)"/>
+		<unzip src="${antinstaller.jar}" dest="${installDir}"><patternset><include name="docs/**/*"/></patternset></unzip>
+		<echo/>
+
+		<echo message="Installing GLI (gli)"/>
+		<unzip src="${antinstaller.jar}" dest="${installDir}"><patternset><include name="gli/**/*"/></patternset></unzip>
+		<echo/>
+
+		<echo message="Installing gs2build (gs2build)"/>
+		<unzip src="${antinstaller.jar}" dest="${installDir}"><patternset><include name="gs2build/**/*"/></patternset></unzip>
+		<echo/>
+
+		<echo message="Installing Libraries (lib)"/>
+		<unzip src="${antinstaller.jar}" dest="${installDir}"><patternset><include name="lib/**/*"/></patternset></unzip>
+		<echo/>
+
+		<echo message="Installing Web Content (web)"/>
+		<unzip src="${antinstaller.jar}" dest="${installDir}"><patternset><include name="web/**/*"/></patternset></unzip>
+		<echo/>
+
+		<echo message="Installing Resources (resources)"/>
+		<unzip src="${antinstaller.jar}" dest="${installDir}"><patternset><include name="resources/**/*"/></patternset></unzip>
+		<echo/>
+
+		<echo message="Installing Top Level Files"/>
+		<unzip src="${antinstaller.jar}" dest="${installDir}">
+			<patternset>
+				<include name="build.xml"/>
+				<include name="build.properties"/>
+				<include name="gs3-server.sh"/>
+				<include name="gs3-setup.sh"/>
+				<include name="LICENSE.txt"/>
+				<include name="README.txt"/>
+				<include name="server.jar"/>
+			</patternset>
+		</unzip>
+		<echo/>
+
+		<echo message="Setting Binaries to Executable"/>
+		<chmod dir="${installDir}" includes="*.sh" perm="775"/>
+		<chmod dir="${installDir}/bin/script" includes="*" perm="775"/>
+		<chmod dir="${installDir}/bin" includes="*" perm="775"/>
+		<chmod dir="${installDir}/gs2build/bin/linux" includes="*" perm="775"/>
+		<chmod dir="${installDir}/gs2build/bin/script" includes="**/*" perm="775"/>
+		<chmod dir="${installDir}/gli" includes="*.sh" perm="775"/>
+		<echo/>
+
+		<!-- change the tomcat ports in build.properties -->
+		<echo message="Changing tomcat ports in build.properties"/>
+		<rsr file="${installDir}/build.properties" pattern="(tomcat.port[=:]).*" replacement="$1${tomcat.port}" />
+		<rsr file="${installDir}/build.properties" pattern="(tomcat.shutdown.port[=:]).*" replacement="$1${tomcat.shutdown.port}" />
+
+		<!-- set up global properties -->
+		<echo message="Setting up global properties"/>
+		<copy file="${installDir}/resources/java/global.properties.in" tofile="${installDir}/web/WEB-INF/classes/global.properties" overwrite="true"/>
+		<rsr file="${installDir}/web/WEB-INF/classes/global.properties" pattern="(.*)@gsdl3home@(.*)" replacement="$1${installDir}/web$2" />
+		<rsr file="${installDir}/web/WEB-INF/classes/global.properties" pattern="(.*)@tomcat.server@(.*)" replacement="$1localhost$2" />
+		<rsr file="${installDir}/web/WEB-INF/classes/global.properties" pattern="(.*)@tomcat.port@(.*)" replacement="$1${tomcat.port}$2" />
+
+		<!-- set up log4j properties-->
+		<echo message="Setting up log4j properties"/>
+		<copy file="${installDir}/resources/java/log4j.properties.in" tofile="${installDir}/web/WEB-INF/classes/log4j.properties" overwrite="true"/>
+		<rsr file="${installDir}/web/WEB-INF/classes/log4j.properties" pattern="(.*)@gsdl3home@(.*)" replacement="$1${installDir}/web$2" />
+
+
+		<!-- in the gs3-setup.sh file, set ANT_HOME and put it in PATH (no need anymore)-->
+		<!--<echo>In the gs3-setup.sh file, set ANT_HOME and put it in PATH</echo>
+		<exec executable="echo" output="${installDir}/gs3-setup.sh" append="true">
+			<arg line="export ANT_HOME=${installDir}/packages/ant; export PATH=$ANT_HOME/bin:$PATH;"/>
+		</exec>-->
+
+		<!-- delete unneeded files -->	    
+		<echo message="Deleting some extraneous files"/>
+		<delete dir="${installDir}/resources/icons"/>
+		<delete file="${installDir}/resources/*.png"/>
+
+		<echo message="Finished"/>
+
+	</target>
+
+	<!-- Source -->
+	<target name="install-source-code" depends="">
+		<echo message="Installing Source Code (src)"/>
+		<mkdir dir="${installDir}/src"/>
+		<unzip src="${antinstaller.jar}" dest="${installDir}">
+			<patternset>
+				<include name="src/**/*"/>
+			</patternset>
+		</unzip>
+	</target>
+
+	<target name="install-java">
+
+		<echo message="Installing bundled java"/>
+
+		<copy todir="${installDir}/packages/jre">
+			<fileset dir="../@java.extracted@"/>
+		</copy>
+		<chmod dir="${installDir}/packages/jre/bin" includes="*" perm="775"/>		
+
+		<echo/>
+
+	</target>
+
+	<target name="install-tomcat">
+		<echo message="Installing Tomcat (packages/tomcat)"/>
+		<!-- extract the files -->
+		<unzip src="${antinstaller.jar}" dest="${installDir}"><patternset><include name="packages/tomcat/**/*"/></patternset></unzip>
+
+		<!-- change the tomcat ports in tomcats server.xml -->
+		<echo message="Changing tomcat ports tomcat's server.xml"/>
+		<copy file="${installDir}/resources/tomcat/server.xml" tofile="${installDir}/packages/tomcat/conf/server.xml" overwrite="true"/>
+		<rsr file="${installDir}/packages/tomcat/conf/server.xml" pattern="(.*)@port@(.*)" replacement="$1${tomcat.port}$2" />
+		<rsr file="${installDir}/packages/tomcat/conf/server.xml" pattern="(.*)@shutdown-port@(.*)" replacement="$1${tomcat.shutdown.port}$2" />
+		
+		<!-- copy the greenstone3.xml file to tomcat -->
+		<echo message="Copying greenstone3.xml to tomcat directory"/>
+		<copy file="${installDir}/resources/tomcat/greenstone3.xml" tofile="${installDir}/packages/tomcat/conf/Catalina/localhost/greenstone3.xml" overwrite="true"/>
+		<rsr file="${installDir}/packages/tomcat/conf/Catalina/localhost/greenstone3.xml" pattern="(.*)@gsdl3webhome@(.*)" replacement="$1${installDir}/web$2" />
+
+		<!-- set binaries to executable -->
+		<chmod dir="${installDir}/packages/tomcat/bin" includes="*.sh" perm="775"/>
+		<echo/>
+
+	</target>
+
+	<target name="install-ant">
+
+		<!-- extract the files -->
+		<echo message="Installing Ant (packages/ant)"/>
+		<unzip src="${antinstaller.jar}" dest="${installDir}"><patternset><include name="packages/ant/**/*"/></patternset></unzip>
+
+		<!-- set binaries to executable -->
+		<chmod dir="${installDir}/packages/ant/bin" includes="*" perm="775"/>
+		<echo/>
+	</target>
+
+
+
+	<target name="cleanuptarget">
+	</target>
+	
+
+</project>
