Index: main/trunk/release-kits/bin/cdrk2
===================================================================
--- main/trunk/release-kits/bin/cdrk2	(revision 21386)
+++ main/trunk/release-kits/bin/cdrk2	(revision 21386)
@@ -0,0 +1,1 @@
+link rk
Index: main/trunk/release-kits/bin/derk
===================================================================
--- main/trunk/release-kits/bin/derk	(revision 21386)
+++ main/trunk/release-kits/bin/derk	(revision 21386)
@@ -0,0 +1,1 @@
+link rk
Index: main/trunk/release-kits/bin/rk
===================================================================
--- main/trunk/release-kits/bin/rk	(revision 21385)
+++ main/trunk/release-kits/bin/rk	(revision 21386)
@@ -1,11 +1,6 @@
 #!/bin/bash
 
-#determine requested release kit
-echo $0
-exit
-
-
-
 function show_title() {
+	echo "RK_HOME: $RK_HOME"
 	echo "O---------------------------------------------O"
 	echo 
@@ -17,60 +12,51 @@
 }
 
-#pre checks
-if [ "$rk_name" == "" ]; then
-	echo "rk_name not set";
-	exit;
-elif [ "$RK_HOME" == "" ]; then
-	echo "RK_HOME not set";
-	exit
-fi
-
 function show_help {
-
 	echo "$rk_name - $rk_fullname"
-	echo "Helps you to create releases from the Repository"
+	echo "Automatically creates Greenstone releases"
 	echo
-	echo "usage: $rk_name [-sim] [-from <target>] [other-args]"
-	echo "	-sim"
-	echo "		simulation only, don't actually do anything"
-	echo
+	echo "usage: $rk_name [-help|-cmd] [ANT_ARGS]"
 	echo "	-help"
 	echo "		show this help screen"
-	echo
-	echo "	-from <target>"
-	echo "		start execution from the target with the given target address"
-	echo
-	echo "	-to <target>"
-	echo "		stop execution just before the target with the given target address"
-	echo
-	echo "	-descend <target>"
-	echo "		execute only the target with the given address, including subtargets"
-	echo
 	echo
 	echo "	-cmd"
 	echo "		show the ant command being used by $rk_name"
 	echo
-	echo "	-properties"
-	echo "		show the properties required/allowed in $rk_name-build.properties"
-
+	echo "	ANT_ARGS"
+	echo "		Additional arguments to be passed to ant"
 }
 
-#cd up a level or two if needed
-if [ ! -e "$rk_name-build.properties" ]; then
-	if [ -e "../$rk_name-build.properties" ]; then
-		RKOLDPWD=`pwd`
-		cd ..
-	elif [ -e "../../$rk_name-build.properties" ]; then
-		RKOLDPWD=`pwd`
-		cd ../..
-	fi
+#determine requested release kit
+rk_name="$(basename $0)"
+export RK_HOME="$(cd "$(dirname "$0")/.." && pwd)"
+
+if [ "$rk_name" == "rk2" ]; then
+	rk_fullname="Release Kit for Greenstone2"
+elif [ "$rk_name" == "rk3" ]; then
+        rk_fullname="Release Kit for Greenstone3"
+else
+	echo "Unrecognised release-kit name '$rk_name'" >&2
+	exit
 fi
 
-#set ANT_HOME
-export ANT_HOME=$RK_HOME/core/ant
+
+#cd up a level or two if needed
+if [ -e "$rk_name-build.properties" ]; then
+	pushd .
+elif [ -e "../$rk_name-build.properties" ]; then
+	pushd ..
+elif [ -e "../../$rk_name-build.properties" ]; then
+	pushd ../..
+else
+	echo "couldn't find file $rk_name-build.properties"
+	echo "it should exist in the top level of the release"
+	exit
+fi
+
+#make sure ant has enough memory
 export ANT_OPTS=-Xmx800M
 
 #create the command
-toexec="ant -lib `pwd`/installer/classes -f $RK_HOME/ant-scripts/build.xml -Dbasedir=`pwd` -D$rk_name.home=$RK_HOME"
+toexec="ant -lib `pwd`/installer/classes -f $RK_HOME/$rk_name/ant-scripts/build.xml -Dbasedir=`pwd` -D$rk_name.home=$RK_HOME"
 
 #pass on the arguments
@@ -89,11 +75,8 @@
 done
 
-if [ "$target" != "" ]; then
-	toexec="$toexec $target"
-fi
-
-#execute (or show the command to be executed)
+#show the command to be executed
 if [ "$show_cmd" == "true" ]; then
 	echo $toexec
+#execute
 else
 	show_title | tee ${rk_name}.out
@@ -101,6 +84,4 @@
 fi
 
-if [ "$RKOLDPWD" != "" ]; then
-	cd $RKOLDPWD
-fi
-
+#go back to original dir
+popd
Index: main/trunk/release-kits/bin/rk2
===================================================================
--- main/trunk/release-kits/bin/rk2	(revision 21386)
+++ main/trunk/release-kits/bin/rk2	(revision 21386)
@@ -0,0 +1,1 @@
+link rk
Index: main/trunk/release-kits/bin/rk3
===================================================================
--- main/trunk/release-kits/bin/rk3	(revision 21386)
+++ main/trunk/release-kits/bin/rk3	(revision 21386)
@@ -0,0 +1,1 @@
+link rk
Index: main/trunk/release-kits/bin/sork2
===================================================================
--- main/trunk/release-kits/bin/sork2	(revision 21386)
+++ main/trunk/release-kits/bin/sork2	(revision 21386)
@@ -0,0 +1,1 @@
+link rk
Index: main/trunk/release-kits/bin/sork3
===================================================================
--- main/trunk/release-kits/bin/sork3	(revision 21386)
+++ main/trunk/release-kits/bin/sork3	(revision 21386)
@@ -0,0 +1,1 @@
+link rk
Index: main/trunk/release-kits/kits/cdrk2/ant-scripts/build.xml
===================================================================
--- main/trunk/release-kits/kits/cdrk2/ant-scripts/build.xml	(revision 21386)
+++ main/trunk/release-kits/kits/cdrk2/ant-scripts/build.xml	(revision 21386)
@@ -0,0 +1,282 @@
+<?xml version="1.0" encoding="utf-8" ?>
+<!--
+		.......................................................... 
+		March 2009
+		CD Release Kit for Greenstone2 (cdrk2)
+		Oran Fry
+		..........................................................
+-->
+
+<project name="cdrk2-build" default="cdrk2">
+
+	<!-- CONSTANTS -->
+
+	<!-- for the benefit of the shared scripts, set release-kit home -->
+	<property name="rk.name" value="cdrk2"/>
+	<property name="rk.home" value="${cdrk2.home}" />
+	<property name="rk.os" value="multi" />
+	<property name="os.suffix" value="AnyPlatform"/>
+	
+	<!-- IMPORT OTHER ANT SCRIPTS -->
+	<import file="../core/ant-scripts/init.xml"/>
+	<import file="../greenstone2/ant-scripts/rk2-targets.xml"/>
+
+	<!-- figure out where the compiled software is coming from -->
+	<property name="software.archive.linux"						value="http://www.greenstone.org/caveat-emptor/cdrom-components-${version}-candidate-${date}-linux.tar.gz"/>
+	<property name="software.archive.windows"					value="http://www.greenstone.org/caveat-emptor/cdrom-components-${version}-candidate-${date}-windows.tar.gz"/>
+	<property name="software.archive.mac"						value="http://www.greenstone.org/caveat-emptor/cdrom-components-${version}-candidate-${date}-mac.tar.gz"/>
+	<property name="software.archive.documented-examples"		value="http://www.greenstone.org/caveat-emptor/Greenstone-documented-examples-${version}-candidate-${date}.tar.gz"/>
+
+	<target name="cdrk2-init">
+		<echo message="software.archive.linux:                    ${software.archive.linux}"/>
+		<echo message="software.archive.windows:                  ${software.archive.windows}"/>
+		<echo message="software.archive.mac:                      ${software.archive.mac}"/>
+		<echo message="software.archive.documented-examples:      ${software.archive.documented-examples}"/>
+	</target>
+
+
+	<!-- THE MAIN TARGET -->
+	<target name="cdrk2" depends="init,cdrk2-init">
+		<antcall target="checkout-and-compile-documentation"/>
+		<antcall target="build-tutorials"/>
+		<antcall target="build-documentation"/>
+		<antcall target="insert-documented-examples"/>
+		<antcall target="insert-readmes"/>
+		<antcall target="insert-software"/>
+		<antcall target="create-autorun"/>
+		<antcall target="create-image"/>
+	</target>
+
+	<target name="properties">
+		<echo>Required Properties:</echo>
+		<echo>version                                     the version string for the release</echo>
+		<echo/>
+		<echo>Optional Properties:</echo>
+		<echo>software.archive.linux                      the URL to the linux archive of components</echo>
+		<echo>software.archive.windows                    the URL to the windows archive of components</echo>
+		<echo>software.archive.mac                        the URL to the mac archive of components</echo>
+		<echo>software.archive.documented-examples        the URL to the archive of documented examples</echo>
+		<echo/>
+	</target>
+
+	<target name="checkout-and-compile-documentation">
+		<svn>
+			<checkout url="${svn.root}/documentation/${branch.path}/shared" destPath="documentation/shared"/>
+		</svn>		
+		<javac srcdir="documentation/shared" destdir="documentation/shared" debug="on">
+			<include name="*.java"/>
+		</javac>
+
+	</target>
+
+	<target name="build-tutorials">
+
+		<svn>
+			<checkout url="${svn.root}/documentation/${branch.path}/tutorials" destPath="documentation/tutorials"/>
+			<checkout url="${svn.root}/main/${branch.path}/gli" destPath="documentation/gli"/>
+			<checkout url="${svn.root}/main/${branch.path}/greenstone2/perllib" destPath="documentation/perllib"/>
+			<checkout url="${svn.root}/main/${branch.path}/greenstone2/macros" destPath="documentation/macros"/>
+			<checkout url="${svn.root}/documentation/${branch.path}/tutorial_sample_files" destPath="documentation/tutorial_sample_files"/>
+		</svn>
+
+		<delete dir="documentation/tutorials/html"/>
+		<exec dir="documentation/tutorials" executable="/bin/bash">
+			<arg value="generate-html.sh"/>
+			<env key="GSDLHOME" value="${basedir}/documentation"/>
+		</exec>
+
+		<delete dir="cdrom/Tutorial Exercises"/>
+		<mkdir dir="cdrom/Tutorial Exercises/sample_files"/>
+
+		<!-- tutorial html -->
+		<copy todir="cdrom/Tutorial Exercises/English"><fileset dir="documentation/tutorials/html/en"/></copy>
+		<copy todir="cdrom/Tutorial Exercises/French"><fileset dir="documentation/tutorials/html/fr"/></copy>
+		<copy todir="cdrom/Tutorial Exercises/Spanish"><fileset dir="documentation/tutorials/html/es"/></copy>
+		<copy todir="cdrom/Tutorial Exercises/Russian"><fileset dir="documentation/tutorials/html/ru"/></copy>
+
+		<!-- sample files -->
+		<zip destfile="cdrom/Tutorial Exercises/sample_files/beatles.zip" basedir="documentation/tutorial_sample_files/beatles"/>
+		<zip destfile="cdrom/Tutorial Exercises/sample_files/custom.zip" basedir="documentation/tutorial_sample_files/custom"/>
+		<zip destfile="cdrom/Tutorial Exercises/sample_files/demo_NewFiles.zip" basedir="documentation/tutorial_sample_files/demo_NewFiles"/>
+		<zip destfile="cdrom/Tutorial Exercises/sample_files/dspace.zip" basedir="documentation/tutorial_sample_files/dspace"/>
+		<zip destfile="cdrom/Tutorial Exercises/sample_files/images.zip" basedir="documentation/tutorial_sample_files/images"/>
+		<zip destfile="cdrom/Tutorial Exercises/sample_files/isis.zip" basedir="documentation/tutorial_sample_files/isis"/>
+		<zip destfile="cdrom/Tutorial Exercises/sample_files/marc.zip" basedir="documentation/tutorial_sample_files/marc"/>
+		<zip destfile="cdrom/Tutorial Exercises/sample_files/niupepa.zip" basedir="documentation/tutorial_sample_files/niupepa"/>
+		<zip destfile="cdrom/Tutorial Exercises/sample_files/oai.zip" basedir="documentation/tutorial_sample_files/oai"/>
+		<zip destfile="cdrom/Tutorial Exercises/sample_files/simple_html.zip" basedir="documentation/tutorial_sample_files/simple_html"/>
+		<zip destfile="cdrom/Tutorial Exercises/sample_files/tudor.zip" basedir="documentation/tutorial_sample_files/tudor"/>
+		<zip destfile="cdrom/Tutorial Exercises/sample_files/Word_and_PDF.zip" basedir="documentation/tutorial_sample_files/Word_and_PDF"/>
+
+	</target>
+
+	<target name="build-documentation">
+		
+		<svn>
+			<checkout url="${svn.root}/documentation/${branch.path}/manuals" destPath="documentation/manuals"/>
+			<checkout url="${svn.root}/documentation/${branch.path}/shared" destPath="documentation/shared"/>
+			<checkout url="${svn.root}/main/${branch.path}/gli" destPath="documentation/gli"/>
+		</svn>
+		<unzip src="documentation/shared/fop.zip" dest="documentation/shared"/>
+		<chmod perm="a+x" file="documentation/shared/fop/fop.sh"/>
+
+		<antcall target="generate-gli-chapter"><param name="language" value="en"/></antcall>
+		<antcall target="generate-gli-chapter"><param name="language" value="fr"/></antcall>
+		<antcall target="generate-gli-chapter"><param name="language" value="es"/></antcall>
+		<antcall target="generate-gli-chapter"><param name="language" value="ru"/></antcall>
+
+		<delete dir="documentation/manuals/build"/>
+		<exec dir="documentation/manuals" executable="/bin/bash">
+			<arg value="generate-pdf.sh"/>
+			<arg value="all"/>
+			<arg value="en es ru fr"/>
+		</exec>
+
+		<exec spawn="true" dir="documentation/manuals" executable="/bin/bash">
+			<arg value="generate-pdf.sh"/>
+			<arg value="Install"/>
+			<arg value="ar"/>
+		</exec>
+
+		<delete dir="cdrom/Documentation"/>
+		<copy todir="cdrom/Documentation/English"><fileset dir="documentation/manuals/build/en/pdf"/></copy>
+		<copy todir="cdrom/Documentation/French"><fileset dir="documentation/manuals/build/fr/pdf"/></copy>
+		<copy todir="cdrom/Documentation/Spanish"><fileset dir="documentation/manuals/build/es/pdf"/></copy>
+		<copy todir="cdrom/Documentation/Russian"><fileset dir="documentation/manuals/build/ru/pdf"/></copy>
+		<copy todir="cdrom/Documentation/Arabic"><fileset dir="documentation/manuals/build/ar/pdf"/></copy>
+
+		<!-- top it off with a few more -->
+		<get src="http://wiki.greenstone.org/wiki/gsdoc/others/CDS-ISIS_to_DL.pdf" dest="cdrom/Documentation/English/CDS-ISIS_to_DL.pdf"/>
+		<get src="http://www.greenstone.org/docs/inside_greenstone.pdf" dest="cdrom/Documentation/English/inside_greenstone.pdf"/>
+
+		<get src="http://www.greenstone.org/manuals/gsdl2/ar/pdf/Users_Guide_Arabic.doc" dest="cdrom/Documentation/Arabic/Users_Guide_Arabic.doc"/>
+		<get src="http://www.greenstone.org/manuals/gsdl2/ar/pdf/Install_ar.pdf" dest="cdrom/Documentation/Arabic/Install_ar.pdf"/>
+
+		<mkdir dir="cdrom/Documentation/Brazilian Portuguese"/>
+		<get src="http://www.greenstone.org/manuals/gsdl2/pt-br/pdf/Install_pt-br.pdf" dest="cdrom/Documentation/Brazilian Portuguese/Install_pt-br.pdf"/>
+
+		<mkdir dir="cdrom/Documentation/Vietnamese"/>
+		<get src="http://prdownloads.sourceforge.net/greenstone/Install-2.39-vi.pdf" dest="cdrom/Documentation/Vietnamese/Install-2.39-vi.pdf"/>
+		<get src="http://prdownloads.sourceforge.net/greenstone/User-2.39-vi.pdf" dest="cdrom/Documentation/Vietnamese/User-2.39-vi.pdf"/>
+		<get src="http://prdownloads.sourceforge.net/greenstone/Paper-2.39-vi.pdf" dest="cdrom/Documentation/Vietnamese/Paper-2.39-vi.pdf"/>
+
+		<mkdir dir="cdrom/Documentation/Kazakh"/>
+		<get src="http://prdownloads.sourceforge.net/greenstone/Install-2.39-kz.pdf" dest="cdrom/Documentation/Kazakh/Install-2.39-kz.pdf"/>
+		<get src="http://prdownloads.sourceforge.net/greenstone/User-2.39-kz.pdf" dest="cdrom/Documentation/Kazakh/User-2.39-kz.pdf"/>
+		<get src="http://prdownloads.sourceforge.net/greenstone/Paper-2.39-kz.pdf" dest="cdrom/Documentation/Kazakh/Paper-2.39-kz.pdf"/>
+
+
+	</target>
+
+	<target name="insert-documented-examples">
+		<antcall target="download-documented-examples"/>
+		<antcall target="untar-documented-examples"/>
+	</target>
+
+	<target name="download-documented-examples">
+		<!-- download the documented examples -->
+		<mkdir dir="archives"/>
+		<get src="${software.archive.documented-examples}" dest="archives/documented-examples.tar.gz"/>
+	</target>
+
+	<target name="untar-documented-examples">
+		<!-- create Document Examples folder -->
+		<!-- insert the documented examples -->
+		<delete dir="cdrom/Documented Examples"/>
+		<copy toDir="cdrom">
+			<fileset dir="${cdrk2.home}/resources">
+				<include name="Documented Examples/**/*"/>
+				<include name="Documented Examples"/>
+			</fileset>
+		</copy>
+		<exec executable="tar" dir="cdrom/Documented Examples"><arg value="-xzf"/><arg value="../../archives/documented-examples.tar.gz"/></exec>
+	</target>
+
+
+	<target name="generate-gli-chapter">
+		<path id="documentation.compile.classpath">
+			<fileset dir="documentation">
+				<include name="**/*.jar"/>
+			</fileset>
+			<pathelement path="documentation/gli/classes"/>
+			<pathelement path="documentation/shared"/>
+			<pathelement path="documentation/manuals"/>
+		</path>
+		<java classname="ApplyXSLT" classpathref="documentation.compile.classpath" output="documentation/manuals/xml-source/${language}/help-${language}.xml">
+			<arg value="${language}" />
+			<arg value="documentation/manuals/processing/gen-gli-help-to-manual-chapter.xsl" />
+			<arg value="documentation/gli/help/${language}/help.xml" />
+			<arg value="compiled" />
+		</java>
+		<copy file="documentation/manuals/xml-source/${language}/help-${language}.xml" todir="documentation/manuals"/>
+	</target>
+
+	<target name="insert-readmes">
+		<copy todir="cdrom"><fileset dir="${rk.home}/greenstone2/docs"/></copy>
+		<antcall target="gsdl-set-dates-in-readmes"><param name="gsdl.basedir" value="${basedir}/cdrom"/></antcall>
+	</target>
+
+	<target name="insert-software">
+		<antcall target="insert-software-linux"/>
+		<antcall target="insert-software-windows"/>
+		<antcall target="insert-software-mac"/>
+	</target>
+
+	<target name="insert-software-linux">
+		<mkdir dir="cdrom"/>
+		<mkdir dir="archives"/>
+		<get src="${software.archive.linux}" dest="archives/linux.tar.gz"/>
+		<exec executable="tar" dir="cdrom"><arg value="-xzf"/><arg value="../archives/linux.tar.gz"/></exec>
+	</target>
+
+	<target name="insert-software-windows">
+		<mkdir dir="cdrom"/>
+		<mkdir dir="archives"/>
+		<get src="${software.archive.windows}" dest="archives/windows.tar.gz"/>
+		<exec executable="tar" dir="cdrom"><arg value="-xzf"/><arg value="../archives/windows.tar.gz"/></exec>
+	</target>
+
+	<target name="insert-software-mac">
+		<mkdir dir="cdrom"/>
+		<mkdir dir="archives"/>
+		<get src="${software.archive.mac}" dest="archives/mac.tar.gz"/>
+		<exec executable="tar" dir="cdrom"><arg value="-xzf"/><arg value="../archives/mac.tar.gz"/></exec>
+	</target>
+
+	<target name="create-autorun">
+		<exec executable="cp">
+			<arg value="${cdrk2.home}/resources/AUTORUN.INF"/>
+			<arg value="cdrom"/>
+		</exec>
+	</target>
+
+	<target name="create-image">
+
+		<mkdir dir="products"/>
+
+		<exec executable="mkisofs">
+			<arg value="-V"/>
+			<arg value="Greenstone-${version}"/>
+			<arg value="-input-charset"/>
+			<arg value="utf-8"/>
+			<arg value="-o"/>
+			<arg value="products/Greenstone-${version}-cdrom.iso"/>
+			<arg value="-J"/>
+			<arg value="-R"/>
+			<arg value="-D"/>
+			<arg value="cdrom"/>
+		</exec>
+
+		<exec executable="/bin/bash" dir="products">
+			<arg value="-c"/>
+			<arg value="cat Greenstone-${version}-cdrom.iso | gzip > Greenstone-${version}-cdrom.iso.gz"/>
+		</exec>
+
+		<exec executable="/bin/bash" dir="products">
+			<arg value="-c"/>
+			<arg value="zip Greenstone-${version}-cdrom.zip Greenstone-${version}-cdrom.iso"/>
+		</exec>
+
+	</target>
+
+</project>
Index: main/trunk/release-kits/kits/cdrk2/bin/cdrk2
===================================================================
--- main/trunk/release-kits/kits/cdrk2/bin/cdrk2	(revision 21386)
+++ main/trunk/release-kits/kits/cdrk2/bin/cdrk2	(revision 21386)
@@ -0,0 +1,6 @@
+#!/bin/bash
+export rk_name="cdrk2"
+export rk_fullname="CD Release Kit for Greenstone2"
+export RK_HOME="$(cd "$(dirname "$(dirname "$0")")" && pwd)"
+$RK_HOME/linux/rk "$*"
+
Index: main/trunk/release-kits/kits/cdrk2/resources/AUTORUN.INF
===================================================================
--- main/trunk/release-kits/kits/cdrk2/resources/AUTORUN.INF	(revision 21386)
+++ main/trunk/release-kits/kits/cdrk2/resources/AUTORUN.INF	(revision 21386)
@@ -0,0 +1,3 @@
+[autorun]
+open=Greenstone-2.82cd-windows.exe
+icon=Software\core\all\web\images\icon.ico
Index: main/trunk/release-kits/kits/cdrk2/resources/Documented Examples/README.txt
===================================================================
--- main/trunk/release-kits/kits/cdrk2/resources/Documented Examples/README.txt	(revision 21386)
+++ main/trunk/release-kits/kits/cdrk2/resources/Documented Examples/README.txt	(revision 21386)
@@ -0,0 +1,4 @@
+Copy the entire 'documented-examples' folder into the 'collect' folder of your
+Greenstone installation (GSDLHOME/collect) to install the documented example
+collections.
+
Index: main/trunk/release-kits/kits/derk/ant-scripts/build.xml
===================================================================
--- main/trunk/release-kits/kits/derk/ant-scripts/build.xml	(revision 21386)
+++ main/trunk/release-kits/kits/derk/ant-scripts/build.xml	(revision 21386)
@@ -0,0 +1,85 @@
+<?xml version="1.0" encoding="utf-8" ?>
+<!--
+		.......................................................... 
+		April 2009
+		Documented Example Release Kit (derk)
+		Oran Fry
+		..........................................................
+-->
+
+<project name="derk-build" default="derk">
+
+	<!-- CONSTANTS -->
+
+	<!-- for the benefit of the shared scripts, set release-kit home -->
+	<property name="rk.name" value="derk"/>
+	<property name="rk.home" value="${derk.home}" />
+	<property name="rk.os" value="multi" />
+	<property name="os.suffix" value="AnyPlatform"/>
+	
+	<!-- IMPORT OTHER ANT SCRIPTS -->
+	<import file="../core/ant-scripts/init.xml"/>
+
+	<!-- THE MAIN TARGET -->
+	<target name="derk" depends="init">
+		<antcall target="export-dec"/>
+		<antcall target="tweak-files"/>
+		<antcall target="prepare-gs2build"/>
+		<antcall target="build-collections"/>
+		<antcall target="create-archives"/>
+	</target>
+
+	<target name="properties">
+		<echo>Required Properties:</echo>
+		<echo>version			the version string for the release</echo>
+		<echo/>
+
+		<echo>Optional Properties:</echo>
+		<echo>branch.path 		the branch of gs2build to use to build collections. Default: trunk.</echo>
+		<echo/>
+	</target>
+
+	<target name="export-dec">
+		<if><bool><not><available file="dec"/></not></bool>
+			<svn>
+				<export srcurl="${svn.root}/documented-examples/${branch.path}" destPath="documented-examples"/>
+			</svn>
+		</if>
+	</target>
+
+	<target name="tweak-files">
+		<delete file="documented-examples/text-for-translation.txt"/>
+	</target>
+
+	<target name="prepare-gs2build">
+		<if>
+			<bool><not><available file="gs2build"/></not></bool>
+			<svn>
+				<export srcurl="${svn.root}/main/${branch.path}/gs2build" destPath="gs2build"/>
+			</svn>
+		</if>
+
+		<if>
+			<bool><not><available file="gs2build/Makefile"/></not></bool>
+			<exec dir="gs2build" executable="/bin/bash" failonerror="true"><arg value="./configure"/></exec>
+			<exec dir="gs2build/common-src" executable="make" failonerror="true"/>
+			<exec dir="gs2build/common-src" executable="make" failonerror="true"><arg value="install"/></exec>
+			<exec dir="gs2build" executable="/bin/bash" failonerror="true"><arg value="./configure"/></exec>
+			<exec dir="gs2build" executable="make" failonerror="true"/>
+			<exec dir="gs2build" executable="make" failonerror="true"><arg value="install"/></exec>
+		</if>
+	</target>
+
+	<target name="build-collections">
+		<exec dir="gs2build" executable="${derk.home}/resources/build.sh" failonerror="true"/>
+	</target>
+
+	<target name="create-archives">
+		<mkdir dir="products"/>
+		<zip destfile="products/Greenstone-documented-examples-${version}.zip"  basedir="." includes="documented-examples/**/*"/>
+		<exec executable="tar">
+			<arg line="-czf products/Greenstone-documented-examples-${version}.tar.gz documented-examples"/>
+		</exec>
+	</target>
+
+</project>
Index: main/trunk/release-kits/kits/derk/bin/derk
===================================================================
--- main/trunk/release-kits/kits/derk/bin/derk	(revision 21386)
+++ main/trunk/release-kits/kits/derk/bin/derk	(revision 21386)
@@ -0,0 +1,5 @@
+#!/bin/bash
+export rk_name="derk"
+export rk_fullname="Document Examples Release Kit"
+export RK_HOME="$(cd "$(dirname "$(dirname "$0")")" && pwd)"
+$RK_HOME/linux/rk "$*"
Index: main/trunk/release-kits/kits/derk/resources/build.sh
===================================================================
--- main/trunk/release-kits/kits/derk/resources/build.sh	(revision 21386)
+++ main/trunk/release-kits/kits/derk/resources/build.sh	(revision 21386)
@@ -0,0 +1,30 @@
+#!/bin/bash
+opwd=`pwd`
+source setup.bash
+
+if [ ! -e "collect/documented-examples" ]; then
+	cd collect
+	ln -s ../../documented-examples
+	cd $opwd
+fi
+
+cd collect
+
+for coll in documented-examples/*; do
+	cd $opwd
+
+	if [ -d "collect/$coll/etc" ]; then
+		if [ ! -e "collect/$coll/index" ]; then
+			echo
+			echo "Building collection $coll "
+			echo
+
+			import.pl --removeold $coll && \
+			buildcol.pl --removeold $coll && \
+			rm -rf collect/$coll/index collect/$coll/archives && \
+			mv collect/$coll/building collect/$coll/index || exit 1
+		else
+			echo skipping $coll
+		fi
+	fi
+done
Index: main/trunk/release-kits/kits/rk2/ant-scripts/build.xml
===================================================================
--- main/trunk/release-kits/kits/rk2/ant-scripts/build.xml	(revision 21386)
+++ main/trunk/release-kits/kits/rk2/ant-scripts/build.xml	(revision 21386)
@@ -0,0 +1,52 @@
+<?xml version="1.0" encoding="utf-8" ?>
+<!--
+		.......................................................... 
+		September 2009
+		Release Kit for Greenstone2 (rk2)
+		Oran Fry
+		..........................................................
+-->
+
+<project name="rk2-build" default="rk2">
+
+	<!-- CONSTANTS -->
+
+	<!-- for the benefit of the shared scripts, set release-kit home -->
+	<property name="rk.name" value="rk2"/>
+	<property name="rk.home" value="${rk2.home}" />
+
+	<!-- IMPORT OTHER ANT SCRIPTS -->
+	<import file="../core/ant-scripts/init.xml"/>
+	<import file="../core/ant-scripts/operations-on-gli.xml"/>
+	<import file="../greenstone2/ant-scripts/rk2-targets.xml"/>
+
+	<import file="compile.xml"/>
+	<import file="create-distribution.xml"/>
+	<import file="create-components.xml"/>
+	<import file="create-installer.xml"/>
+	<import file="wrap.xml"/>
+	<import file="create-cdrom-components.xml"/>
+
+	<import file="components.xml"/>
+
+	<!-- THE MAIN TARGET -->
+	<target name="rk2" depends="init,gs2-init">
+		<antcall target="compile"/>
+		<antcall target="create-distribution"/>
+		<antcall target="create-components"/>
+		<antcall target="create-installer"/>
+		<antcall target="wrap"/>
+		<antcall target="create-cdrom-components"/>
+	</target>
+
+	<target name="properties">
+		<echo>Required Properties:</echo>
+		<echo>version             the version string for the release</echo>
+		<echo/>
+		<echo>Optional Properties:</echo>
+		<echo>branch.path         the branch of Greenstone to make a release of. Eg: tags/2.81. Default: trunk.</echo>
+		<echo>branch.revision     the revision of Greenstone to make a release of. Eg: 18273. Default: HEAD.</echo>
+		<echo/>
+	</target>
+
+</project>
Index: main/trunk/release-kits/kits/rk2/ant-scripts/compile.xml
===================================================================
--- main/trunk/release-kits/kits/rk2/ant-scripts/compile.xml	(revision 21386)
+++ main/trunk/release-kits/kits/rk2/ant-scripts/compile.xml	(revision 21386)
@@ -0,0 +1,205 @@
+<?xml version="1.0" encoding="utf-8" ?>
+<project name="rk2-compile">
+
+	<target name="compile">
+
+		<antcall target="checkout-gsdl-gli" />
+		<antcall target="drop-in-docs"><param name="gsdl.basedir" value="${basedir}/compiled"/></antcall>
+		<antcall target="gsdl-set-version-numbers"><param name="gsdl.basedir" value="${basedir}/compiled"/></antcall>
+		<antcall target="gli-set-version-numbers"><param name="glibasedir" value="${basedir}/compiled/gli"/></antcall>
+
+		<!-- windows only -->
+		<if><bool><equals arg1="${rk.os}" arg2="windows"/></bool>
+			<antcall target="unzip-packages" />
+			<antcall target="get-winbin" />
+			<antcall target="insert-windows-perl"><param name="todir" value="compiled/bin/windows"/></antcall>
+			<antcall target="compile-c-code" />
+
+		<!-- linux only -->
+		<else><if><bool><equals arg1="${rk.os}" arg2="linux"/></bool>
+			<antcall target="add-static-to-configure-in"/>
+			<antcall target="set-environment-in-packages-configure"/>
+			<antcall target="run-configure"/>
+			<antcall target="makefiles-add-static"/>
+			<!-- make common-src and reconfigure -->
+			<!-- this is a workaround to a problem with the gsdl build code -->
+			<!-- expat needs to be compiled before the perl XML Parser is configured -->
+			<antcall target="make-common-src"/>
+			<antcall target="run-configure"/>
+			<!-- end of workaround -->
+			<antcall target="run-make"/>
+			<antcall target="run-make-install"/>
+			<antcall target="run-make-apache-for-dist"/>
+			<antcall target="strip-execs"/>
+
+		<!-- mac only -->
+		<else><if><bool><equals arg1="${rk.os}" arg2="mac"/></bool>
+			<antcall target="run-configure"/>
+			<antcall target="tweak-makefiles"/>
+			<!-- make common-src and reconfigure -->
+			<!-- this is a workaround to a problem with the gsdl build code -->
+			<!-- expat needs to be compiled before the perl XML Parser is configured -->
+			<antcall target="make-common-src"/>
+			<antcall target="run-configure"/>
+			<!-- end of workaround -->
+			<antcall target="run-make"/>
+			<antcall target="run-make-install"/>
+			<antcall target="run-make-apache-for-dist"/>
+			<antcall target="strip-execs"/>
+
+		</if></else></if></else></if>
+
+		<!-- gli -->
+		<antcall target="compile-gli">
+			<param name="glibasedir"  value="${basedir}/compiled/gli"/>
+			<param name="gsdlbasedir" value="${basedir}/compiled"/>
+		</antcall>
+
+		<!-- uninstaller -->
+		<antcall target="compile-uninstaller" />
+
+		<!-- build collections -->
+		<antcall target="build-demo-collection" />
+
+	</target>
+
+	<target name="add-static-to-configure-in">
+		<rsr
+			file="${basedir}/compiled/configure.in"
+			pattern="^LDFLAGS=.*$"
+			replacement="LDFLAGS=-static" />
+		<exec dir="${basedir}/compiled" executable="autoconf" output="${basedir}/compiled/configure"><arg value="configure.in"/></exec>
+	</target>
+
+	<target name="set-environment-in-packages-configure">
+		<rsr
+			file="${basedir}/compiled/common-src/packages/configure"
+			pattern="^ENVIRONMENT=.*$"
+			replacement="ENVIRONMENT=&quot;LDFLAGS=-static&quot;" />
+		<rsr
+			file="${basedir}/compiled/build-src/packages/configure"
+			pattern="^ENVIRONMENT=.*$"
+			replacement="ENVIRONMENT=&quot;LDFLAGS=-static&quot;" />
+	</target>
+
+	<target name="run-configure">
+		<!-- linux -->
+		<if><bool><equals arg1="${rk.os}" arg2="linux"/></bool>
+			<exec dir="${basedir}/compiled" executable="${basedir}/compiled/configure" failonerror="true">
+				<arg line="--enable-apache-httpd"/>
+				<env key="LDFLAGS" value="-static"/>
+			</exec>
+
+		<!-- mac -->
+		<else><if><bool><equals arg1="${rk.os}" arg2="mac"/></bool>
+			<exec dir="${basedir}/compiled" executable="${basedir}/compiled/configure">
+				<arg value="--enable-apache-httpd"/>
+			</exec>
+
+		<else>
+			<fail>This target does not support this rk.os: ${rk.os}</fail>
+
+		</else></if></else></if>
+	</target>
+
+	<target name="makefiles-add-static">
+		<rsr
+			file="${basedir}/compiled/build-src/packages/wv/wv-gs/Makefile"
+			pattern="^LDFLAGS =.*$"
+			replacement="LDFLAGS = -static" />
+		<rsr
+			file="${basedir}/compiled/build-src/packages/xlhtml/xlhtml-0.4.9.0/xlhtml/Makefile"
+			pattern="^LDFLAGS =.*$"
+			replacement="LDFLAGS = -static" />
+		<rsr
+			file="${basedir}/compiled/build-src/packages/xlhtml/xlhtml-0.4.9.0/ppthtml/Makefile"
+			pattern="^LDFLAGS =.*$"
+			replacement="LDFLAGS = -static" />
+		<rsr
+			file="${basedir}/compiled/build-src/packages/rtftohtml/rtftohtml_src/Makefile"
+			pattern="(-o rtftohtml.{2}EXEEXT.{1})"
+			replacement="$1 -static" />
+	</target>
+
+	<target name="run-make">
+		<exec dir="${basedir}/compiled" executable="make" failonerror="true"/>
+	</target>
+
+	<target name="run-make-install">
+		<exec dir="${basedir}/compiled" executable="make" failonerror="true"><arg value="install"/></exec>
+	</target>
+
+	<target name="run-make-apache-for-dist">
+		<exec dir="${basedir}/compiled" executable="make" failonerror="true"><arg value="apache-for-dist"/></exec>
+	</target>
+
+	<target name="strip-execs">
+		<exec dir="${basedir}/compiled/bin/${os.shell}" executable="find" failonerror="true">
+			<arg line="! -name . -type f -maxdepth 1 -exec strip {} &#59;"/>
+		</exec>
+	</target>
+
+	<target name="build-demo-collection">
+
+		<!-- linux, mac -->
+		<if><bool><equals arg1="${rk.os}" arg2="linux"/></bool>
+			<exec dir="${basedir}/compiled" executable="${rk2.home}/resources/build-demo.sh" failonerror="true"/>
+
+		<!-- windows -->
+		<else><if><bool><equals arg1="${rk.os}" arg2="windows"/></bool>
+			<!-- the envs on these execs simulate the environment when you run setup.bat -->
+			<exec dir="${basedir}/compiled" executable="${basedir}/compiled/bin/windows/perl/bin/perl.exe">
+				<arg line="bin\script\import.pl --removeold demo"/>
+				<env key="GSDLHOME" value="${basedir}/compiled"/>
+				<env key="GSDLCOLLECTDIR" value="${basedir}/compiled/collect"/>
+				<env key="GSDLOS" value="windows"/>
+				<env key="PATH" value="${basedir}\compiled\bin\windows\perl\bin;${basedir}\compiled\bin\windows;${basedir}\compiled\bin\script"/>
+			</exec>
+			<exec dir="${basedir}/compiled" executable="${basedir}/compiled/bin/windows/perl/bin/perl.exe">
+				<arg line="bin\script\buildcol.pl --removeold demo"/>
+				<env key="GSDLHOME" value="${basedir}/compiled"/>
+				<env key="GSDLCOLLECTDIR" value="${basedir}/compiled/collect"/>
+				<env key="GSDLOS" value="windows"/>
+				<env key="PATH" value="${basedir}\compiled\bin\windows\perl\bin;${basedir}\compiled\bin\windows;${basedir}\compiled\bin\script"/>
+			</exec>
+			<delete dir="${basedir}/compiled/collect/demo/index"/>
+			<move file="${basedir}/compiled/collect/demo/building" tofile="${basedir}/compiled/collect/demo/index"/>
+
+		<else>
+			<fail>This target does not support the current rk.os: ${rk.os}</fail>
+
+		</else></if></else></if>
+
+	</target>
+
+	<target name="tweak-makefiles">
+		<rsr file="${basedir}/compiled/runtime-src/src/recpt/Makefile" pattern="^(LIBS =.*)-L(.)\(PACKAGES_DIR\)/expat/lib -lexpat(.*)$" replacement="$1$2(PACKAGES_DIR)/expat/lib/libexpat.a$3" />
+		<rsr file="${basedir}/compiled/runtime-src/src/oaiservr/Makefile" pattern="^(LIBS =.*)-L(.)\(PACKAGES_DIR\)/expat/lib -lexpat(.*)$" replacement="$1$2(PACKAGES_DIR)/expat/lib/libexpat.a$3" />
+	</target>
+
+	<target name="unzip-packages">
+		<unzip src="${basedir}/compiled/common-src/packages/windows/crypt/crypt.zip" dest="${basedir}/compiled/common-src/packages/windows/crypt"/>
+		<unzip src="${basedir}/compiled/common-src/packages/windows/expat/expat.zip" dest="${basedir}/compiled/common-src/packages/windows/expat"/>
+		<unzip src="${basedir}/compiled/common-src/packages/windows/stlport/stlport.zip" dest="${basedir}/compiled/common-src/packages/windows/stlport"/>
+		<unzip src="${basedir}/compiled/common-src/indexers/packages/windows/iconv/iconv.zip" dest="${basedir}/compiled/common-src/indexers/packages/windows/iconv"/>
+		<untar src="${basedir}/compiled/common-src/packages/sqlite/sqlite-amalgamation-3.5.9.tar.gz" dest="${basedir}/compiled/common-src/packages/sqlite" compression="gzip"/>
+	</target>
+
+	<target name="get-winbin">
+		<if>
+			<bool><not><available file="${basedir}/compiled/bin/windows"/></not></bool>
+			<svn><export srcUrl="${svn.root}/main/${branch.path}/binaries/windows/bin" destPath="${basedir}/compiled/bin/windows" revision="${branch.revision}"/></svn>
+		</if>
+	</target>
+
+	<target name="compile-c-code">
+		<copy file="${wirk2.home}/resources/compile.bat" todir="${basedir}/compiled" overwrite="true"/>
+		<exec dir="${basedir}/compiled" executable="nmake"><arg value="/f"/><arg value="win32.mak"/><arg value="clean"/></exec>
+		<exec dir="${basedir}/compiled" executable="nmake"><arg value="/f"/><arg value="win32.mak"/><arg value="APACHE_HTTPD=1"/></exec>
+		<exec dir="${basedir}/compiled" executable="nmake"><arg value="/f"/><arg value="win32.mak"/><arg value="LOCAL_LIBRARY=1"/></exec>
+		<mkdir dir="products"/>
+		<copy file="${basedir}/compiled/server.exe" tofile="${basedir}/products/server-${version}.exe"/>
+		<move file="${basedir}/compiled/server.exe" todir="${basedir}/compiled/bin/windows"/>
+	</target>
+
+</project>
Index: main/trunk/release-kits/kits/rk2/ant-scripts/components.xml
===================================================================
--- main/trunk/release-kits/kits/rk2/ant-scripts/components.xml	(revision 21386)
+++ main/trunk/release-kits/kits/rk2/ant-scripts/components.xml	(revision 21386)
@@ -0,0 +1,48 @@
+<!-- an ant project containing authoritative definitions of the components of greenstone3 -->
+<project name="components">
+
+	<!-- source component - files that get compiled and could be safely removed from a binary distribution -->
+	<patternset id="greenstone2.source.component">
+		<include name="gli/src"/>
+		<include name="gli/src/**/*"/>
+		<include name="common-src"/>
+		<include name="common-src/**/*"/>
+		<include name="build-src"/>
+		<include name="build-src/**/*"/>
+		<include name="runtime-src"/>
+		<include name="runtime-src/**/*"/>
+		<include name="aclocal.m4"/>
+		<include name="config.guess"/>
+		<include name="config.h.in"/>
+		<include name="config.sub"/>
+		<include name="configure"/>
+		<include name="configure.in"/>
+		<include name="install-sh"/>
+		<include name="Makefile.in"/>
+		<include name="win32.mak"/>
+		<include name="win32cfg.h"/>
+	</patternset>
+
+	<!-- imagemagick -->
+	<patternset id="greenstone2.imagemagick.component">
+		<include name="bin/**/imagemagick"/>
+                <include name="bin/**/imagemagick/**/*"/>
+	</patternset>
+
+        <!-- ghostscript -->
+        <patternset id="greenstone2.ghostscript.component">
+                <include name="bin/**/ghostscript"/>
+                <include name="bin/**/ghostscript/**/*"/>
+        </patternset>
+
+        <!-- the core component - defined by antithesis -->
+        <patternset id="greenstone2.core.component">
+		<invert>
+			<patternset refid="greenstone2.source.component"/>
+			<patternset refid="greenstone2.imagemagick.component"/>
+			<patternset refid="greenstone2.ghostscript.component"/>
+		</invert>
+        </patternset>
+
+</project>
+
Index: main/trunk/release-kits/kits/rk2/ant-scripts/create-cdrom-components.xml
===================================================================
--- main/trunk/release-kits/kits/rk2/ant-scripts/create-cdrom-components.xml	(revision 21386)
+++ main/trunk/release-kits/kits/rk2/ant-scripts/create-cdrom-components.xml	(revision 21386)
@@ -0,0 +1,200 @@
+<?xml version="1.0" encoding="utf-8" ?>
+<project name="rk2-create-cdrom-components" default="create-cdrom-components">
+
+	<!--
+		cd components
+		produce components for cdrom distributions, to be picked up and used by cdrk2 release kit
+		split components into linux only files (linux) and general files (all)
+	-->
+
+	<target name="create-cdrom-components">
+		<antcall target="compile-cdrom-installer"/> <!-- from init -->
+		<antcall target="prepare-cdrom-components"/>
+		<antcall target="compile-cdrom-wrapper"/>
+		<antcall target="create-cdrom-components-archive"/>
+	</target>
+
+	<target name="prepare-cdrom-components">
+
+		<!-- clean up -->
+		<delete dir="cdrom"/>
+
+		<!-- setup directory structure -->
+		<mkdir dir="cdrom/build"/>
+		<mkdir dir="cdrom/dist/Software"/>
+		<mkdir dir="cdrom/dist/Java/Jars"/>
+
+		<!-- create core component -->
+		<mkdir dir="cdrom/dist/Software/core/all"/>
+		<mkdir dir="cdrom/dist/Software/core/${rk.os}"/>
+
+
+		<!-- core linux -->
+		<if><bool><equals arg1="${rk.os}" arg2="linux"/></bool>
+			<copy todir="cdrom/dist/Software/core/all" overwrite="true">
+				<fileset dir="components/tmp/core"/>
+			</copy>
+			<move todir="cdrom/dist/Software/core/linux" overwrite="true">
+				<fileset dir="cdrom/dist/Software/core/all">
+					<include name="bin/linux"/>
+					<include name="bin/linux/**/*"/>
+					<include name="bin/windows"/>
+					<include name="bin/windows/**/*"/>
+					<include name="cgi-bin/library.cgi"/>
+					<include name="cgi-bin/oaiserver.cgi"/>
+					<include name="apache-httpd/**/*"/>
+					<include name="*.sh"/>
+					<include name="*.csh"/>
+					<include name="*.bash"/>
+				</fileset>
+			</move>
+			<!-- delete the apache manual to save space -->
+			<delete dir="cdrom/dist/Software/core/linux/apache-httpd/linux/manual"/>
+
+		<!-- core windows -->
+		<else><if><bool><equals arg1="${rk.os}" arg2="windows"/></bool>
+			<copy todir="cdrom/dist/Software/core/windows" overwrite="true">
+				<fileset dir="components/tmp/core">
+					<include name="bin/windows"/>
+					<include name="server.exe"/>
+					<include name="bin/windows/**/*"/>
+					<include name="cgi-bin/library.cgi"/>
+					<include name="cgi-bin/oaiserver.cgi"/>
+					<include name="*.bat"/>
+					<include name="gli/*.bat"/>
+				</fileset>
+			</copy>
+
+		<!-- core mac -->
+		<else><if><bool><equals arg1="${rk.os}" arg2="mac"/></bool>
+			<copy todir="cdrom/dist/Software/core/mac" overwrite="true">
+				<fileset dir="components/tmp/core">
+					<include name="bin/darwin"/>
+					<include name="bin/darwin/**/*"/>
+					<include name="bin/windows"/>
+					<include name="bin/windows/**/*"/>
+					<include name="cgi-bin/library.cgi"/>
+					<include name="cgi-bin/oaiserver.cgi"/>
+					<include name="apache-httpd"/>
+					<include name="apache-httpd/**/*"/>
+					<include name="*.sh"/>
+					<include name="*.csh"/>
+					<include name="*.bash"/>
+				</fileset>
+			</copy>
+			<!-- delete the httpd manual to save space -->
+			<delete dir="cdrom/dist/Software/core/mac/apache-httpd/darwin/manual"/>
+
+		</if></else></if></else></if>
+
+		<!-- imagemagick -->
+		<mkdir dir="cdrom/dist/Software/imagemagick/${rk.os}"/>
+		<copy todir="cdrom/dist/Software/imagemagick/${rk.os}" overwrite="true">
+			<fileset dir="components/tmp/imagemagick"/>
+		</copy>
+
+		<!-- ghostscript: windows and mac only -->
+		<if><bool><or><equals arg1="${rk.os}" arg2="windows"/><equals arg1="${rk.os}" arg2="mac"/></or></bool>
+			<mkdir dir="cdrom/dist/Software/ghostscript/${rk.os}"/>
+			<copy todir="cdrom/dist/Software/ghostscript/${rk.os}" overwrite="true">
+				<fileset dir="components/tmp/ghostscript"/>
+			</copy>
+		</if>
+
+		<!-- jre linux -->
+		<if><bool><equals arg1="${rk.os}" arg2="linux"/></bool>
+			<mkdir dir="cdrom/dist/Java/Linux"/>
+			<exec executable="cp">
+				<arg value="${rk2.home}/linux/jre_bin"/>
+				<arg value="cdrom/dist/Java/Linux"/>
+			</exec>
+			<!--
+			don't extract to save space
+			<exec dir="cdrom/dist/Java/Linux" executable="${rk2.home}/linux/jre_bin"/>
+			<exec dir="cdrom/dist/Java/Linux" executable="tar"><arg value="-xf"/><arg value="jre.tar"/></exec>
+			<delete file="cdrom/dist/Java/Linux/jre.tar"/>
+			-->
+		<!-- jre windows -->
+		<else><if><bool><or><equals arg1="${rk.os}" arg2="windows"/></or></bool>
+			<mkdir dir="cdrom/dist/Java/Windows"/>
+			<exec dir="cdrom/dist/Java/Windows" executable="${rk2.home}/windows/wrapper/jre.exe"/>
+
+		</if></else></if>
+
+		<!-- jar installer: windows and linux only -->
+		<if><bool><or><equals arg1="${rk.os}" arg2="windows"/><equals arg1="${rk.os}" arg2="mac"/></or></bool>
+			<copy file="installer/cdrom.jar" tofile="cdrom/dist/Java/Jars/${rk.os}.jar"/>
+		</if>
+
+	</target>
+
+	<target name="compile-cdrom-wrapper">
+
+		<!-- windows -->
+		<if><bool><equals arg1="${rk.os}" arg2="windows"/></bool>
+			<antcall target="get-copy-of-wrapper-source"><param name="todir" value="cdrom/build"/></antcall>
+			<exec executable="rc" dir="cdrom/build">
+				<arg line="wrapper.rc"/>
+			</exec>
+			<exec executable="cl" dir="cdrom/build">
+				<arg line="/c -GX -DCDROM wrapper.cpp"/>
+			</exec>
+			<exec executable="link" dir="cdrom/build">
+				<arg line="/OUT:../dist/Greenstone-${version}-windows.exe gdi32.lib advapi32.lib shell32.lib user32.lib wrapper.obj wrapper.RES"/>
+			</exec>
+
+		<!-- linux -->
+		<else><if><bool><equals arg1="${rk.os}" arg2="linux"/></bool>
+			<copy file="${rk.home}/linux/wrapper.cpp" todir="cdrom/build" overwrite="true"/>
+
+			<echo level="info">compile the cdrom wrapper</echo>
+			<exec executable="g++" dir="cdrom/build">
+				<arg line="-Wall -static -static-libgcc -c -DCDROM -o wrapper.o wrapper.cpp"/>
+			</exec>
+
+			<echo level="info">link the compiled code</echo>
+			<exec executable="g++" dir="cdrom/build">
+				<arg line="-static -static-libgcc -o ../dist/Greenstone-${version}-linux wrapper.o"/>
+			</exec>
+
+		<!-- mac -->
+		<else><if><bool><equals arg1="${rk.os}" arg2="mac"/></bool>
+
+			<mkdir dir="wrapped-installer/cdrom"/>
+			<!-- create app for cdrom installer -->
+			<copy todir="cdrom/dist/Greenstone-${version}-MacOS.app"><fileset dir="${rk2.home}/mac/Wrapper.app"/></copy>
+			<copy todir="cdrom/dist/Greenstone-${version}-MacOS.app/Contents/Resources" file="${rk2.home}/greenstone2/icon/icon.icns"/>
+			<chmod file="cdrom/dist/Greenstone-${version}-MacOS.app/Contents/MacOS/JavaApplicationStub" perm="+x"/>
+
+			<!-- copy bundled files -->
+			<copy todir="cdrom/dist/Greenstone-${version}-MacOS.app/Contents/Resources/Java" file="${basedir}/installer/cdrom.jar"/>
+
+			<!-- substitute in real values -->
+			<rsr file="cdrom/dist/Greenstone-${version}-MacOS.app/Contents/Info.plist" pattern="@jar@" replacement="cdrom.jar"/>
+			<rsr file="cdrom/dist/Greenstone-${version}-MacOS.app/Contents/Info.plist" pattern="@version@" replacement="${version}"/>
+			
+		</if></else></if></else></if>
+
+	</target>
+
+
+
+	<target name="create-cdrom-components-archive">
+		<mkdir dir="products"/>
+		<!-- windows -->
+		<if><bool><equals arg1="${rk.os}" arg2="windows"/></bool>
+			<tar destfile="products/cdrom-components-${version}-windows.tar.gz" compression="gzip">
+				<tarfileset dir="cdrom/dist"><include name="**/*"/></tarfileset>
+			</tar>
+
+		<!-- linux and mac -->
+		<else><if><bool><or><equals arg1="${rk.os}" arg2="linux"/><equals arg1="${rk.os}" arg2="mac"/></or></bool>
+			<exec dir="cdrom/dist" executable="bash">
+				<arg value="-c"/>
+				<arg value="tar -czf ../../products/cdrom-components-${version}-linux.tar.gz *"/>
+			</exec>
+		</if></else></if>
+	</target>
+
+
+</project>
Index: main/trunk/release-kits/kits/rk2/ant-scripts/create-components.xml
===================================================================
--- main/trunk/release-kits/kits/rk2/ant-scripts/create-components.xml	(revision 21386)
+++ main/trunk/release-kits/kits/rk2/ant-scripts/create-components.xml	(revision 21386)
@@ -0,0 +1,20 @@
+<?xml version="1.0" encoding="utf-8" ?>
+<project name="rk2-create-components">
+
+	<target name="create-components">
+
+		<antcall target="prepare-component"><param name="component" value="core"/></antcall>
+		<antcall target="compress-component"><param name="component" value="core"/></antcall>
+
+		<antcall target="prepare-component"><param name="component" value="imagemagick"/></antcall>
+		<antcall target="compress-component"><param name="component" value="imagemagick"/></antcall>
+
+		<!-- windows and mac only -->
+		<if><bool><or><equals arg1="${rk.os}" arg2="windows"/><equals arg1="${rk.os}" arg2="mac"/></or></bool>
+			<antcall target="prepare-component"><param name="component" value="ghostscript"/></antcall>
+			<antcall target="compress-component"><param name="component" value="ghostscript"/></antcall>
+		</if>
+
+	</target>
+
+</project>
Index: main/trunk/release-kits/kits/rk2/ant-scripts/create-distribution.xml
===================================================================
--- main/trunk/release-kits/kits/rk2/ant-scripts/create-distribution.xml	(revision 21386)
+++ main/trunk/release-kits/kits/rk2/ant-scripts/create-distribution.xml	(revision 21386)
@@ -0,0 +1,38 @@
+<?xml version="1.0" encoding="utf-8" ?>
+<project name="rk2-create-distribution">
+
+	<target name="create-distribution">
+
+		<antcall target="copy-compiled-to-dist"/>
+		<antcall target="dist-clean-sourcecode"/>
+		<antcall target="insert-uninstaller"></antcall>
+		<antcall target="strip-svn-dirs"><param name="dir" value="${basedir}/distributions/web"/></antcall>
+
+		<!-- windows -->
+		<if><bool><equals arg1="${rk.os}" arg2="windows"/></bool>
+			<antcall target="copy-server"/>
+			<antcall target="remove-unneeded-files" />
+			<antcall target="create-needed-empty-files"><param name="gsdl.basedir" value="distributions/web"/></antcall>
+			<antcall target="create-binary-zip-windows"/>
+
+		<!-- linux -->
+		<else><if><bool><equals arg1="${rk.os}" arg2="linux"/></bool>
+			<antcall target="insert-export-to-cd-package"><param name="gsdl.basedir" value="distributions/web"/></antcall> <!-- from rk2-targets -->
+			<antcall target="export-imagemagick-linux-binaries"/>
+			<antcall target="export-wvware-linux-binaries"/>
+			<antcall target="remove-unneeded-files" />
+			<antcall target="create-needed-empty-files"><param name="gsdl.basedir" value="distributions/web"/></antcall>
+
+		<!-- mac -->
+		<else><if><bool><equals arg1="${rk.os}" arg2="mac"/></bool>
+			<antcall target="insert-export-to-cd-package"><param name="gsdl.basedir" value="distributions/web"/></antcall> <!-- from rk2-targets -->
+			<antcall target="export-imagemagick-darwin-binaries" />
+			<antcall target="export-ghostscript-darwin-binaries" />
+			<antcall target="remove-unneeded-files"/>
+			<antcall target="create-needed-empty-files"><param name="gsdl.basedir" value="distributions/web"/></antcall>
+
+		</if></else></if></else></if>
+
+	</target>
+
+</project>
Index: main/trunk/release-kits/kits/rk2/ant-scripts/create-installer.xml
===================================================================
--- main/trunk/release-kits/kits/rk2/ant-scripts/create-installer.xml	(revision 21386)
+++ main/trunk/release-kits/kits/rk2/ant-scripts/create-installer.xml	(revision 21386)
@@ -0,0 +1,27 @@
+<?xml version="1.0" encoding="utf-8" ?>
+<project name="rk2-create-installer">
+
+	<target name="create-installer">
+		<antcall target="copy-installer-files"/>
+		<antcall target="make-installer-files-concrete"/>
+		<antcall target="compile-binary-installer"/>
+	</target>
+
+	<target name="copy-installer-files" depends="copy-main-installer-files,copy-greenstone2-installer-files">
+
+		<copy todir="installer/classes" overwrite="true" file="distributions/web/LICENSE.txt"/>
+		<unjar src="${rk2.home}/core/ant-tasks/greenstone/anttasks.jar" dest="installer/classes"/>
+		<unjar src="${rk2.home}/core/lib/crypt.jar" dest="installer/classes"/>
+
+		<!-- windows -->
+		<if><bool><equals arg1="${rk.os}" arg2="windows"/></bool>
+			<fileset dir="${rk2.home}/windows/7za" includes="7za.exe"/>
+		<!-- linux and mac -->
+		<else><if><bool><or><equals arg1="${rk.os}" arg2="linux"/><equals arg1="${rk.os}" arg2="mac"/></or></bool>
+			<unjar src="${rk2.home}/core/ant-tasks/7z-ant/7z.jar" dest="installer/classes"/>
+		</if></else></if>
+
+		<delete dir="installer/classes/META-INF"/>
+	</target>
+
+</project>
Index: main/trunk/release-kits/kits/rk2/ant-scripts/wrap.xml
===================================================================
--- main/trunk/release-kits/kits/rk2/ant-scripts/wrap.xml	(revision 21386)
+++ main/trunk/release-kits/kits/rk2/ant-scripts/wrap.xml	(revision 21386)
@@ -0,0 +1,155 @@
+<?xml version="1.0" encoding="utf-8" ?>
+<project name="rk2-wrap" default="wrap">
+
+	<target name="wrap">
+
+		<mkdir dir="products"/>
+
+		<!-- windows -->
+		<if><bool><equals arg1="${rk.os}" arg2="windows"/></bool>
+
+			<!--create a directory to build the wrapped installer in -->
+			<mkdir dir="${basedir}/wrapped-installer"/>
+
+			<!-- copy wrapper source into place -->
+			<antcall target="get-copy-of-wrapper-source"><param name="todir" value="wrapped-installer"/></antcall>
+
+			<!-- tweak files for wrapping -->
+			<rsr file="${basedir}/wrapped-installer/wrapper.cpp">
+				<job pattern="@java.installer@" replacement="${windows-java.installer}"/>
+				<job pattern="@java.min.version@" replacement="${java.min.version}"/>
+				<job pattern="@bundled.version.java@" replacement="${bundled.version.windows-java}"/>
+				<job pattern="@java.extracted@" replacement="${java.extracted}"/>
+			</rsr>
+
+			<!-- split the resources into chunks, creating a resource script of the chunks -->
+			<copy todir="${basedir}/wrapped-installer" file="${rk2.home}/windows/wrapper/wrapper.rc" overwrite="true"/>
+			<rsplit
+				resource="${rk2.home}/windows/wrapper/${windows-java.installer}"
+				outputDir="${basedir}/wrapped-installer"					
+				resourceScript="${basedir}/wrapped-installer/wrapper.rc"
+				resourceName="JAVA"
+				resourceType="EXE"
+				chunkSize="${resources.chunksize}"/>
+			<rsplit
+				resource="${basedir}/installer/Greenstone-${version}-${os.suffix}.jar"
+				outputDir="${basedir}/wrapped-installer"
+				resourceScript="${basedir}/wrapped-installer/wrapper.rc"
+				resourceName="JAR"
+				resourceType="JAR"
+				chunkSize="${resources.chunksize}"
+				/>
+				
+			<!-- compile the resources -->
+			<exec executable="rc" dir="${basedir}/wrapped-installer">
+				<arg line="wrapper.rc"/>
+			</exec>
+
+			<!-- compile the wrapper -->
+			<exec executable="cl" dir="${basedir}/wrapped-installer">
+				<arg line="/c -GX /DWINDOWS=yes libsearch4j.cpp /out:libsearch4j.obj"/>
+			</exec>
+
+			<exec executable="cl" dir="${basedir}/wrapped-installer">
+				<arg line="/c -GX /DWINDOWS=yes wrapper.cpp /out:wrapper.obj"/>
+			</exec>
+
+			<!-- link the wrapper -->
+			<exec executable="link" dir="${basedir}/wrapped-installer">
+				<arg line="/OUT:..\products\Greenstone-${version}-${os.suffix}.exe gdi32.lib advapi32.lib shell32.lib user32.lib libsearch4j.obj wrapper.obj wrapper.res"/>
+			</exec>
+
+		<!-- linux -->
+		<else><if><bool><equals arg1="${rk.os}" arg2="linux"/></bool>
+			<!-- create and setup the build directory -->
+			<mkdir dir="${basedir}/wrapped-installer"/>
+			<copy todir="${basedir}/wrapped-installer" file="${rk2.home}/linux/wrapper.cpp"/>
+			<copy todir="${basedir}/wrapped-installer" file="${rk2.home}/core/search4j/libsearch4j.cpp"/>
+			<copy todir="${basedir}/wrapped-installer" file="${rk2.home}/core/search4j/libsearch4j.h"/>
+
+			<!-- copy bundled files -->
+			<copy todir="${basedir}/wrapped-installer" file="${rk2.home}/linux/${linux-java.installer}"/>
+			<copy tofile="${basedir}/wrapped-installer/greenstone2.jar" file="${basedir}/installer/Greenstone-${version}-linux.jar"/>
+
+			<!-- substitute in real values -->
+			<rsr file="${basedir}/wrapped-installer/wrapper.cpp">
+				<job pattern="@java.installer@" replacement="${linux-java.installer}"/>
+				<job pattern="@installer.name@" replacement="greenstone2"/>
+				<job pattern="@java.extracted@" replacement="${java.extracted}"/>
+				<job pattern="@java.min.version@" replacement="${java.min.version}"/>
+			</rsr>
+
+			<!-- create an object file (extension .o) for each file to bundle -->
+			<exec executable="/usr/bin/objcopy" dir="${basedir}/wrapped-installer">
+				<arg line="-I binary -O elf32-i386 -B i386 --redefine-sym _binary_greenstone2_jar_start=greenstone2jar --readonly-text greenstone2.jar greenstone2.jar.o"/>
+			</exec>
+			<exec executable="/usr/bin/objcopy" dir="${basedir}/wrapped-installer">
+				<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>
+
+			<!-- compile libsearch4j -->
+			<exec executable="g++" dir="wrapped-installer">
+				<arg line="-Wall -static -static-libgcc -c -o libsearch4j.o libsearch4j.cpp"/>
+			</exec>
+
+			<!-- creating wrapper header file -->
+			<delete file="wrapper.h"/>
+			<exec executable="echo" output="${basedir}/wrapped-installer/wrapper.h"><arg line="extern const char greenstone2jar[${greenstone2.jar.size}];"/></exec>
+			<exec executable="echo" output="${basedir}/wrapped-installer/wrapper.h" append="true"><arg line="extern const char java[${java.size}];"/></exec>
+			<exec executable="echo" output="${basedir}/wrapped-installer/wrapper.h" append="true"><arg line="#define java_is_bundled yes"/></exec>
+
+			<!-- compile the wrapper program -->
+			<exec executable="g++" dir="wrapped-installer">
+				<arg line="-Wall -static -static-libgcc -c -o wrapper.o wrapper.cpp"/>
+			</exec>
+
+			<!-- link the compiled code and bundled files -->
+			<exec executable="g++" dir="${basedir}/wrapped-installer">
+				<arg line="-static -static-libgcc -o ../products/Greenstone-${version}-linux wrapper.o libsearch4j.o greenstone2.jar.o java.o"/>
+			</exec>
+
+		<!-- mac -->
+		<else><if><bool><equals arg1="${rk.os}" arg2="mac"/></bool>
+
+			<!-- create and setup the build directory -->
+			<delete dir="${basedir}/wrapped-installer"/>
+			<mkdir dir="${basedir}/wrapped-installer"/>
+
+			<!-- create app for main installer -->
+			<copy todir="${basedir}/wrapped-installer/Greenstone${version}.app"><fileset dir="${rk2.home}/mac/Wrapper.app"/></copy>
+			<copy todir="${basedir}/wrapped-installer/Greenstone${version}.app/Contents/Resources" file="${rk2.home}/greenstone2/icon/icon.icns"/>
+			<chmod file="${basedir}/wrapped-installer/Greenstone${version}.app/Contents/MacOS/JavaApplicationStub" perm="ug+x"/>
+
+			<!-- copy bundled files -->
+			<copy todir="${basedir}/wrapped-installer/Greenstone${version}.app/Contents/Resources/Java" file="${basedir}/installer/Greenstone-${version}-MacOS-${processor}.jar"/>
+
+			<!-- substitute in real values -->
+			<rsr file="${basedir}/wrapped-installer/Greenstone${version}.app/Contents/Info.plist" pattern="@jar@" replacement="Greenstone-${version}-MacOS-${processor}.jar"/>
+			<rsr file="${basedir}/wrapped-installer/Greenstone${version}.app/Contents/Info.plist" pattern="@version@" replacement="${version}"/>
+
+			<!-- turn app into a dmg -->
+
+			<!-- get size of app -->
+			<exec executable="du" dir="${basedir}/wrapped-installer" outputproperty="app.du"><arg line="-ks Greenstone${version}.app"/></exec>
+			<echo>app.du: ${app.du}</echo>
+			<exec executable="sed" inputstring="${app.du}" outputproperty="app.size"><arg line="-e 's/^\([0-9]*\).*$/\1/g'"/></exec>
+			<echo>app.size: ${app.size}</echo>
+			<math result="dmg.size" operand1="${app.size}" operation="+" operand2="${dmg.overhead}" datatype="int"/>
+			<echo>dmg.size: ${dmg.size}</echo>
+
+
+			<!-- create disk image -->
+			<property name="dmg.name" value="Greenstone-${version}-${os.suffix}"/>
+			<exec dir="${basedir}/products" executable="hdiutil"><arg line="create -ov -size ${dmg.size}k -fs HFS+ -volname ${dmg.name} ${dmg.name}.dmg"/></exec>
+			<!-- mount it -->
+			<exec executable="hdiutil" dir="${basedir}/products"><arg line="attach ${dmg.name}.dmg"/></exec>
+			<!-- copy file into it -->
+			<exec executable="cp"><arg line="-r ${basedir}/wrapped-installer/Greenstone${version}.app /Volumes/${dmg.name}"/></exec>
+			<!-- unmount it-->
+			<exec executable="hdiutil"><arg line="detach /Volumes/${dmg.name}"/></exec>
+		</if></else></if></else></if>
+
+	</target>
+
+
+</project>
Index: main/trunk/release-kits/kits/rk2/build.xml
===================================================================
--- main/trunk/release-kits/kits/rk2/build.xml	(revision 21386)
+++ main/trunk/release-kits/kits/rk2/build.xml	(revision 21386)
@@ -0,0 +1,7 @@
+<project name="rk2-compile" default="compile">
+
+	<target name="compile">
+		<ant dir="core"/>
+	</target>
+
+</project>
Index: main/trunk/release-kits/kits/rk2/resources/build-demo.sh
===================================================================
--- main/trunk/release-kits/kits/rk2/resources/build-demo.sh	(revision 21386)
+++ main/trunk/release-kits/kits/rk2/resources/build-demo.sh	(revision 21386)
@@ -0,0 +1,7 @@
+#!/bin/bash
+source setup.bash
+import.pl --removeold demo && \
+buildcol.pl --removeold demo && \
+rm -rf collect/demo/index collect/demo/archives && \
+mv collect/demo/building collect/demo/index
+
Index: main/trunk/release-kits/kits/rk2/setup.bat
===================================================================
--- main/trunk/release-kits/kits/rk2/setup.bat	(revision 21386)
+++ main/trunk/release-kits/kits/rk2/setup.bat	(revision 21386)
@@ -0,0 +1,16 @@
+@echo off
+
+pushd %~dp0
+
+if not "%RK2_HOME%" == "" goto already
+set RK2_HOME=%CD%
+set ANT_HOME=%RK2_HOME%\core\ant
+set PATH=%RK2_HOME%\bin;%ANT_HOME%\bin;%PATH%
+echo Done
+goto end
+
+:already
+echo rk2 environment already set up
+
+:end
+popd
Index: main/trunk/release-kits/kits/rk3/ant-scripts/build.xml
===================================================================
--- main/trunk/release-kits/kits/rk3/ant-scripts/build.xml	(revision 21386)
+++ main/trunk/release-kits/kits/rk3/ant-scripts/build.xml	(revision 21386)
@@ -0,0 +1,50 @@
+<?xml version="1.0" encoding="utf-8" ?>
+<!--
+		.......................................................... 
+		August 2009
+		Release Kit for Greenstone3 (rk3)
+		Oran Fry
+		..........................................................
+-->
+
+<project name="rk3-build" default="rk3">
+
+	<!-- CONSTANTS -->
+
+	<!-- for the benefit of the shared scripts, set release-kit home -->
+	<property name="rk.name" value="rk3"/>
+	<property name="rk.home" value="${rk3.home}" />
+
+	<!-- IMPORT OTHER ANT SCRIPTS -->
+	<import file="../core/ant-scripts/init.xml"/>
+	<import file="../core/ant-scripts/operations-on-gli.xml"/>
+	<import file="../greenstone3/ant-scripts/rk3-targets.xml"/>
+
+	<import file="compile.xml"/>
+	<import file="create-distribution.xml"/>
+	<import file="create-installer.xml"/>
+	<import file="wrap.xml"/>
+
+	<!-- THE MAIN TARGET -->
+	<target name="rk3" depends="init,gs3-init">
+		<antcall target="compile"/>
+		<antcall target="create-distribution"/>
+		<ant inheritRefs="true" dir="." antfile="${rk3.home}/ant-scripts/create-components.xml" target="create-components"/>
+		<antcall target="create-installer"/>
+		<antcall target="wrap"/>
+		<antcall target="create-minimal-distribution"/>
+
+	</target>
+
+	<target name="properties">
+		<echo>Required Properties:</echo>
+		<echo>version             the version string for the release</echo>
+		<echo/>
+		<echo>Optional Properties:</echo>
+		<echo>branch.path         the branch of Greenstone3 to make a release of. Eg: tags/2.81. Default: trunk.</echo>
+		<echo>branch.revision     the revision of Greenstone3 to make a release of. Eg: 18273. Default: HEAD.</echo>
+		<echo/>
+	</target>
+
+
+</project>
Index: main/trunk/release-kits/kits/rk3/ant-scripts/compile.xml
===================================================================
--- main/trunk/release-kits/kits/rk3/ant-scripts/compile.xml	(revision 21386)
+++ main/trunk/release-kits/kits/rk3/ant-scripts/compile.xml	(revision 21386)
@@ -0,0 +1,39 @@
+<?xml version="1.0" encoding="utf-8" ?>
+<project name="rk3-compile">
+
+	<target name="compile">
+		<antcall target="checkout-greenstone3"/>
+		<ant dir="compiled" inheritAll="false">
+			<target name="prepare"/>
+			<propertyset refid="forward.properties"/>
+		</ant>
+		<antcall target="greenstone3-set-version-numbers">
+			<param name="greenstone3basedir" value="compiled"/>
+		</antcall>
+		<antcall target="gli-set-version-numbers">
+			<param name="glibasedir" value="compiled/gli"/>
+		</antcall>
+		<antcall target="gsdl-set-version-numbers">
+			<param name="gsdl.basedir" value="compiled/gs2build"/>
+		</antcall>
+		<ant dir="compiled" inheritAll="false">
+			<target name="install"/>
+			<target name="dist-tidy"/>
+			<propertyset refid="forward.properties"/>
+		</ant>
+		<antcall target="insert-xml-parser"/>
+		<antcall target="insert-ant"/>
+		<antcall target="insert-documented-examples"/>
+		<antcall target="compile-uninstaller" />
+		<antcall target="prepare-documentation"/>
+
+		<!-- windows only -->
+		<if><bool><equals arg1="${rk.os}" arg2="windows"/></bool>
+			<antcall target="insert-windows-perl">
+				<param name="todir" value="compiled/gs2build/bin/windows"/>
+			</antcall>
+			<antcall target="insert-windows-icon"/>
+		</if>
+	</target>
+
+</project>
Index: main/trunk/release-kits/kits/rk3/ant-scripts/create-components.xml
===================================================================
--- main/trunk/release-kits/kits/rk3/ant-scripts/create-components.xml	(revision 21386)
+++ main/trunk/release-kits/kits/rk3/ant-scripts/create-components.xml	(revision 21386)
@@ -0,0 +1,29 @@
+<?xml version="1.0" encoding="utf-8" ?>
+<project name="rk3-create-components">
+
+	<import file="${basedir}/distributions/web/resources/xml/components.xml"/>
+	<import file="${rk.home}/core/ant-scripts/init.xml"/>
+
+	<!-- create components from the distributions folder -->
+
+	<target name="create-components">
+
+		<antcall target="prepare-component"><param name="component" value="core"/></antcall>
+		<antcall target="compress-component"><param name="component" value="core"/></antcall>
+
+		<antcall target="prepare-component"><param name="component" value="tomcat"/></antcall>
+		<antcall target="compress-component"><param name="component" value="tomcat"/></antcall>
+
+		<antcall target="prepare-component"><param name="component" value="imagemagick"/></antcall>
+		<antcall target="compress-component"><param name="component" value="imagemagick"/></antcall>
+
+		<!-- windows and mac only -->
+		<if><bool><or><equals arg1="${rk.os}" arg2="windows"/><equals arg1="${rk.os}" arg2="mac"/></or></bool>
+			<antcall target="prepare-component"><param name="component" value="ghostscript"/></antcall>
+			<antcall target="compress-component"><param name="component" value="ghostscript"/></antcall>
+		</if>
+
+	</target>
+
+
+</project>
Index: main/trunk/release-kits/kits/rk3/ant-scripts/create-distribution.xml
===================================================================
--- main/trunk/release-kits/kits/rk3/ant-scripts/create-distribution.xml	(revision 21386)
+++ main/trunk/release-kits/kits/rk3/ant-scripts/create-distribution.xml	(revision 21386)
@@ -0,0 +1,60 @@
+<?xml version="1.0" encoding="utf-8" ?>
+<project name="rk3-create-distribution">
+	<target name="create-distribution">
+		<!-- create distribution -->
+		<antcall target="copy-compiled-to-dist"/> <!-- from init -->
+		<antcall target="insert-uninstaller"/>
+		<antcall target="clean-user-manual"/>
+		<antcall target="clean-uninstaller"/>
+		<antcall target="minify-tomcat"/>
+		<antcall target="gli-tidy-for-dist"><param name="glibasedir" value="distributions/web/gli"/></antcall>
+		<antcall target="strip-svn-dirs"><param name="dir" value="distributions"/></antcall> <!-- from init -->
+
+		<!-- linux only -->
+		<if><bool><equals arg1="${rk.os}" arg2="linux"/></bool>
+			<antcall target="export-imagemagick-linux-binaries"/>
+			<antcall target="export-wvware-linux-binaries"/>
+
+		<!-- mac only -->
+		<else><if><bool><equals arg1="${rk.os}" arg2="mac"/></bool>
+			<antcall target="export-imagemagick-darwin-binaries"/>
+			<antcall target="export-ghostscript-darwin-binaries"/>
+
+		</if></else></if>
+		
+	</target>
+
+	<target name="export-imagemagick-linux-binaries">
+		<delete dir="distributions/web/bin/linux/imagemagick"/>
+		<svn>
+			<export srcurl="${svn.root}/main/${branch.path}/binaries/linux/imagemagick" destPath="distributions/web/gs2build/bin/linux/imagemagick"/>
+		</svn>
+	</target>
+
+	<target name="export-wvware-linux-binaries">
+		<delete dir="distributions/web/bin/linux/wv"/>
+		<svn>
+			<export srcurl="${svn.root}/main/${branch.path}/binaries/linux/wv" destPath="distributions/web/gs2build/bin/linux/wv"/>
+		</svn>
+	</target>
+
+	<target name="export-imagemagick-darwin-binaries">
+		<delete dir="distributions/web/bin/darwin/imagemagick"/>
+		<svn>
+			<export srcurl="${svn.root}/main/${branch.path}/binaries/mac/intel/imagemagick" destPath="distributions/web/gs2build/bin/darwin/imagemagick"/>
+		</svn>
+	</target>
+
+	<target name="export-ghostscript-darwin-binaries">
+		<delete dir="distributions/web/bin/darwin/ghostscript"/>
+		<svn>
+			<export srcurl="${svn.root}/main/${branch.path}/binaries/mac/intel/ghostscript" destPath="distributions/web/gs2build/bin/darwin/ghostscript"/>
+		</svn>
+	</target>
+
+	<target name="minify-tomcat">
+		<delete dir="distributions/web/packages/tomcat/webapps/docs"/>
+		<delete dir="distributions/web/packages/tomcat/webapps/examples"/>
+	</target>
+
+</project>
Index: main/trunk/release-kits/kits/rk3/ant-scripts/create-installer.xml
===================================================================
--- main/trunk/release-kits/kits/rk3/ant-scripts/create-installer.xml	(revision 21386)
+++ main/trunk/release-kits/kits/rk3/ant-scripts/create-installer.xml	(revision 21386)
@@ -0,0 +1,43 @@
+<?xml version="1.0" encoding="utf-8" ?>
+<project name="rk3-create-installer">
+
+	<target name="create-installer">
+		<antcall target="copy-installer-files"/>
+		<antcall target="make-installer-files-concrete"/>
+		<antcall target="compile-binary-installer"/>
+	</target>
+
+	<target name="copy-installer-files" depends="copy-main-installer-files">
+
+		<!-- the installer descriptors -->
+		<copy todir="installer" file="${rk.home}/greenstone3/installer/antinstall-config.xml" overwrite="true"/>
+		<copy todir="installer" file="${rk.home}/greenstone3/installer/build.xml" overwrite="true"/>
+
+		<!-- the licence -->
+		<copy file="${basedir}/distributions/web/LICENSE.txt" todir="${basedir}/installer/classes" overwrite="true"/>
+
+		<!-- greenstone's ant tasks -->
+		<unjar src="${rk3.home}/core/ant-tasks/greenstone/anttasks.jar" dest="${basedir}/installer/classes"/>
+
+		<!-- windows only -->
+		<if><bool><equals arg1="${rk.os}" arg2="windows"/></bool>
+			<!-- 7za.exe tool -->
+			<copy todir="${basedir}/installer/classes" overwrite="true" file="${rk3.home}/windows/7za/7za.exe"/>
+
+			<!-- roxes and orangevolt for windows tricks in ant -->
+			<unjar src="${rk3.home}/core/ant-tasks/orangevolt/roxes-win32forjava-1.1.1.jar" dest="${basedir}/installer/classes"/>
+			<unjar src="${rk3.home}/core/ant-tasks/orangevolt/orangevolt-ant-tasks-1.3.8.jar" dest="${basedir}/installer/classes"/>
+
+		<!-- linux and mac only -->
+		<else><if><bool><or><equals arg1="${rk.os}" arg2="linux"/><equals arg1="${rk.os}" arg2="mac"/></or></bool>
+			<!-- 7zip ant task -->
+			<unjar src="${rk3.home}/core/ant-tasks/7z-ant/7z.jar" dest="${basedir}/installer/classes"/>
+
+		</if></else></if>
+
+		<!-- clean up meta directory -->
+		<delete dir="${basedir}/installer/classes/META-INF"/>
+
+	</target>
+
+</project>
Index: main/trunk/release-kits/kits/rk3/ant-scripts/wrap.xml
===================================================================
--- main/trunk/release-kits/kits/rk3/ant-scripts/wrap.xml	(revision 21386)
+++ main/trunk/release-kits/kits/rk3/ant-scripts/wrap.xml	(revision 21386)
@@ -0,0 +1,223 @@
+<?xml version="1.0" encoding="utf-8" ?>
+<project name="rk3-wrap" default="wrap">
+
+	<target name="wrap">
+		<!-- windows -->
+		<if><bool><equals arg1="${rk.os}" arg2="windows"/></bool>
+			<antcall target="windows-wrap"/>
+		<!-- linux -->
+		<else><if><bool><equals arg1="${rk.os}" arg2="linux"/></bool>
+			<antcall target="linux-wrap"/>
+		<!-- mac -->
+		<else><if><bool><equals arg1="${rk.os}" arg2="mac"/></bool>
+			<antcall target="mac-wrap"/>
+		</if></else></if></else></if>
+
+	</target>
+
+	<target name="linux-wrap">
+		<antcall target="linux-setup-for-wrapping"/>
+		<antcall target="linux-compile-wrapper"/>
+	</target>
+
+	<target name="windows-wrap">
+		<!-- the size of the resourse chunks to be put in the wrapped installer -->
+		<property name="resources.chunksize" value="8388608"/><!-- 8MiB -->
+	
+		<antcall target="windows-copy-files-for-wrapping"/>
+		<antcall target="windows-tweak-files-for-wrapping"/>
+		<antcall target="windows-compile-resources"/>
+		<antcall target="windows-compile-wrapper"/>
+		<antcall target="windows-link-wrapper"/>
+	</target>
+
+	<target name="mac-wrap">
+	 	<property name="dmg.overhead" value="4096"/>
+
+		<!-- create and setup the build directory -->
+		<delete dir="${basedir}/wrapped-installer"/>
+		<mkdir dir="${basedir}/wrapped-installer"/>
+		<mkdir dir="products"/>
+		<copy todir="${basedir}/wrapped-installer/Greenstone${version}.app"><fileset dir="${rk3.home}/mac/Wrapper.app"/></copy>
+		<copy todir="${basedir}/wrapped-installer/Greenstone${version}.app/Contents/Resources" file="${rk3.home}/greenstone3/icon/icon.icns"/>
+		<chmod file="${basedir}/wrapped-installer/Greenstone${version}.app/Contents/MacOS/JavaApplicationStub" perm="ug+x"/>
+
+		<!-- copy bundled files -->
+		<copy todir="${basedir}/wrapped-installer/Greenstone${version}.app/Contents/Resources/Java" file="${basedir}/installer/Greenstone-${version}-${os.suffix}.jar"/>
+
+		<!-- substitute in real values -->
+		<rsr file="${basedir}/wrapped-installer/Greenstone${version}.app/Contents/Info.plist" pattern="@jar@" replacement="Greenstone-${version}-${os.suffix}.jar"/>
+		<rsr file="${basedir}/wrapped-installer/Greenstone${version}.app/Contents/Info.plist" pattern="@version@" replacement="${version}"/>
+
+		<!-- get size of app -->
+		<exec executable="du" dir="${basedir}/wrapped-installer" outputproperty="app.du"><arg line="-ks Greenstone${version}.app"/></exec>
+		<echo>app.du: ${app.du}</echo>
+		<exec executable="sed" inputstring="${app.du}" outputproperty="app.size"><arg line="-e 's/^\([0-9]*\).*$/\1/g'"/></exec>
+		<echo>app.size: ${app.size}</echo>
+		<math result="dmg.size" operand1="${app.size}" operation="+" operand2="${dmg.overhead}" datatype="int"/>
+		<echo>dmg.size: ${dmg.size}</echo>
+
+		<!-- create disk image -->
+		<property name="dmg.name" value="Greenstone-${version}-${os.suffix}"/>
+		<exec dir="${basedir}/products" executable="hdiutil"><arg line="create -size ${dmg.size}k -fs HFS+ -volname ${dmg.name} ${dmg.name}.dmg"/></exec>
+		<!-- mount it -->
+		<exec executable="hdiutil" dir="${basedir}/products"><arg line="attach ${dmg.name}.dmg"/></exec>
+		<!-- copy file into it -->
+		<exec executable="cp"><arg line="-r ${basedir}/wrapped-installer/Greenstone${version}.app /Volumes/${dmg.name}"/></exec>
+		<!-- unmount it-->
+		<exec executable="hdiutil"><arg line="detach /Volumes/${dmg.name}"/></exec>
+	</target>
+
+	<target name="linux-setup-for-wrapping">
+
+		<!-- create and setup the build directory -->
+		<mkdir dir="${basedir}/wrapped-installer/build"/>
+		<copy todir="${basedir}/wrapped-installer/build" file="${rk3.home}/linux/wrapper.cpp" overwrite="true" />
+		<copy todir="${basedir}/wrapped-installer/build" file="${rk3.home}/core/search4j/libsearch4j.cpp" overwrite="true" />
+		<copy todir="${basedir}/wrapped-installer/build" file="${rk3.home}/core/search4j/libsearch4j.h" overwrite="true" />
+
+		<!-- copy bundled files -->
+		<copy todir="${basedir}/wrapped-installer/build" file="${rk3.home}/linux/${linux-java.installer}"/>
+		<copy tofile="${basedir}/wrapped-installer/build/greenstone3.jar" file="${basedir}/installer/Greenstone-${version}-${os.suffix}.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="${java.extracted}"/>
+		<rsr file="${basedir}/wrapped-installer/build/wrapper.cpp" pattern="@java.min.version@" replacement="${java.min.version}"/>
+
+	</target>
+
+	<target name="linux-compile-wrapper">
+		<mkdir dir="products"/>
+		<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_${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 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">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">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.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  ../../products/Greenstone-${version}-${os.suffix} wrapper.o libsearch4j.o greenstone3.jar.o java.o"/>
+		</exec>
+
+	</target>
+
+	<target name="windows-copy-files-for-wrapping">
+		<echo>Copying wrapper source files</echo>
+		<mkdir dir="${basedir}/wrapped-installer"/>
+		<copy todir="${basedir}/wrapped-installer" file="${rk3.home}/windows/wrapper/wrapper.cpp"/>
+		<copy todir="${basedir}/wrapped-installer" file="${rk3.home}/core/search4j/libsearch4j.cpp"/>
+		<copy todir="${basedir}/wrapped-installer" file="${rk3.home}/core/search4j/libsearch4j.h"/>
+	</target>
+	
+	<target name="windows-tweak-files-for-wrapping">
+		<echo>Substituting concrete values into source files</echo>
+		<rsr file="${basedir}/wrapped-installer/wrapper.cpp" pattern="@java.min.version@" replacement="${java.min.version}"/>
+		<rsr file="${basedir}/wrapped-installer/wrapper.cpp" pattern="@java.installer@" replacement="${windows-java.installer}"/>
+		<rsr file="${basedir}/wrapped-installer/wrapper.cpp" pattern="@java.extracted@" replacement="${java.extracted}"/>
+		<rsr file="${basedir}/wrapped-installer/wrapper.cpp" pattern="@bundled.version.java@" replacement="${bundled.version.windows-java}"/>
+	</target>
+
+	<target name="windows-compile-resources">
+		<if>
+			<bool>
+				<not>
+					<uptodate targetfile="${basedir}/wrapped-installer/wrapper.RES">
+						<srcfiles dir="${rk3.home}/greenstone3/icon" includes="icon.ico"/>
+						<srcfiles dir="${rk3.home}/windows/wrapper" includes="${windows-java.installer}"/>
+						<srcfiles dir="${rk3.home}/windows/wrapper" includes="*.bmp"/>
+						<srcfiles dir="${rk3.home}/windows/wrapper" includes="*.rc"/>
+						<srcfiles dir="${rk3.home}/greenstone3/wrapper" includes="*.bmp"/>
+						<srcfiles dir="${basedir}/installer" includes="Greenstone-${version}-${os.suffix}.jar"/>
+					</uptodate>
+				</not>
+			</bool>
+			
+			<echo>Compiling resources</echo>
+			
+			<echo>getting the template resource script</echo>
+			<copy todir="${basedir}/wrapped-installer" file="${rk3.home}/windows/wrapper/wrapper.rc" overwrite="true"/>
+			
+			<echo>copying the small resource files into place</echo>
+			<copy todir="${basedir}/wrapped-installer">
+				<fileset dir="${rk3.home}/windows/wrapper" includes="*.bmp"/>
+				<fileset dir="${rk3.home}/greenstone3/wrapper" includes="*.bmp"/>
+				<fileset dir="${rk3.home}/greenstone3/icon" includes="icon.ico"/>
+			</copy>
+			
+			<echo>adding greenstone3.jar to the resource script as chunks</echo>
+			<rsplit
+				resource="${basedir}/installer/Greenstone-${version}-${os.suffix}.jar"
+				outputDir="${basedir}/wrapped-installer"
+				resourceScript="${basedir}/wrapped-installer/wrapper.rc"
+				resourceName="JAR"
+				resourceType="JAR"
+				chunkSize="${resources.chunksize}"
+				/>
+			
+			<echo>adding ${windows-java.installer} to the copy as chunks</echo>
+			<rsplit
+				resource="${rk3.home}/windows/wrapper/${windows-java.installer}"
+				outputDir="${basedir}/wrapped-installer"					
+				resourceScript="${basedir}/wrapped-installer/wrapper.rc"
+				resourceName="JAVA"
+				resourceType="EXE"
+				chunkSize="${resources.chunksize}"
+				/>
+
+			<echo>resource compiling the generated resource script</echo>
+			<exec executable="rc" dir="${basedir}/wrapped-installer">
+				<arg line="wrapper.rc"/>
+			</exec>
+			
+			<else>
+				<echo>Resourses are up-to-date, will not compile</echo>
+			</else>
+		</if>
+	</target>
+
+	<target name="windows-compile-wrapper">
+		<exec executable="cl" dir="${basedir}/wrapped-installer">
+			<arg line="/c -GX /DWINDOWS=yes libsearch4j.cpp /out:libsearch4j.obj"/>
+		</exec>
+		<exec executable="cl" dir="${basedir}/wrapped-installer">
+			<arg line="/c -GX /DWINDOWS=yes /DWEB wrapper.cpp /out:wrapper.obj"/>
+		</exec>
+	</target>
+
+	<target name="windows-link-wrapper">
+		<mkdir dir="products"/>
+		<exec executable="link" dir="${basedir}/wrapped-installer">
+			<arg line="/OUT:..\products\Greenstone-${version}-${os.suffix}.exe gdi32.lib advapi32.lib shell32.lib user32.lib libsearch4j.obj wrapper.obj wrapper.res"/>
+		</exec>
+	</target>
+
+
+</project>
Index: main/trunk/release-kits/kits/rk3/bin/rk3
===================================================================
--- main/trunk/release-kits/kits/rk3/bin/rk3	(revision 21386)
+++ main/trunk/release-kits/kits/rk3/bin/rk3	(revision 21386)
@@ -0,0 +1,5 @@
+#!/bin/bash
+export rk_name="rk3"
+export rk_fullname="Release Kit for Greenstone3"
+export RK_HOME="$(cd "$(dirname "$(dirname "$0")")" && pwd)"
+$RK_HOME/linux/rk "$*"
Index: main/trunk/release-kits/kits/rk3/bin/rk3.bat
===================================================================
--- main/trunk/release-kits/kits/rk3/bin/rk3.bat	(revision 21386)
+++ main/trunk/release-kits/kits/rk3/bin/rk3.bat	(revision 21386)
@@ -0,0 +1,21 @@
+@echo off
+
+if "%JAVA_HOME%"=="" (
+ echo Please set JAVA_HOME before running release kit
+ goto end
+)
+if "%RK3_HOME%"=="" (
+ echo Please set RK3_HOME before running release kit
+ goto end
+)
+set ANT_HOME=%RK3_HOME%\core\ant
+
+set CMD=cmd.exe /c %RK3_HOME%\core\ant\bin\ant.bat -f "%RK3_HOME%\ant-scripts\build.xml" -addressing "-Drk3.home=%RK3_HOME%"
+set CMD=%CMD% "-Dbasedir=%CD%"
+set PIPETO="%RK_HOME%\windows\utils\tee.exe" "%CD%\rk3.out"
+
+echo %CMD%
+%CMD% 
+::| %PIPETO%
+
+:end
Index: main/trunk/release-kits/kits/rk3/build.xml
===================================================================
--- main/trunk/release-kits/kits/rk3/build.xml	(revision 21386)
+++ main/trunk/release-kits/kits/rk3/build.xml	(revision 21386)
@@ -0,0 +1,17 @@
+<project name="rk3-compile" default="compile">
+
+	<target name="compile">
+		<ant dir="core"/>
+		<!--
+		compile c++ code for launching rk3
+		<exec executable="cl" dir="bin">
+			<arg value="-GX"/>
+			<arg value="/DXXX=3"/>
+			<arg value="..\windows\rk.cpp"/>
+			<arg value="-o"/><arg value="rk3.exe"/>
+		</exec>
+		<delete file="bin/rk.obj"/>
+		-->
+	</target>
+
+</project>
Index: main/trunk/release-kits/kits/rk3/setup.bat
===================================================================
--- main/trunk/release-kits/kits/rk3/setup.bat	(revision 21386)
+++ main/trunk/release-kits/kits/rk3/setup.bat	(revision 21386)
@@ -0,0 +1,16 @@
+@echo off
+
+pushd %~dp0
+
+if not "%RK3_HOME%" == "" goto already
+set RK3_HOME=%CD%
+set ANT_HOME=%RK3_HOME%\core\ant
+set PATH=%RK3_HOME%\bin;%ANT_HOME%\bin;%PATH%
+echo Done
+goto end
+
+:already
+echo rk3 environment already set up
+
+:end
+popd
Index: main/trunk/release-kits/kits/sork2/ant-scripts/build.xml
===================================================================
--- main/trunk/release-kits/kits/sork2/ant-scripts/build.xml	(revision 21386)
+++ main/trunk/release-kits/kits/sork2/ant-scripts/build.xml	(revision 21386)
@@ -0,0 +1,139 @@
+<?xml version="1.0" encoding="utf-8" ?>
+<!--
+		.......................................................... 
+		November 2008
+		Source Release Kit for Greenstone2 (sork2)
+		Oran Fry
+		..........................................................
+-->
+
+<project name="sork2-build" default="sork2">
+
+	<!-- CONSTANTS -->
+
+	<!-- for the benefit of the shared scripts, set release-kit home -->
+	<property name="rk.name" value="sork2"/>
+	<property name="rk.home" value="${sork2.home}" />
+	<property name="rk.os" value="multi" />
+	<property name="os.suffix" value="AnyPlatform"/>
+	
+	<!-- IMPORT OTHER ANT SCRIPTS -->
+	<import file="../core/ant-scripts/init.xml"/>
+	<import file="../core/ant-scripts/operations-on-gli.xml"/>
+	<import file="../greenstone2/ant-scripts/rk2-targets.xml"/>
+
+	<!-- THE MAIN TARGET -->
+	<target name="sork2" depends="init">
+		<antcall target="export-gsdl-gli"><param name="dest" value="distributions/Greenstone-${version}-source-distribution"/></antcall>
+		<antcall target="gsdl-set-version-numbers"><param name="gsdl.basedir" value="${basedir}/distributions/Greenstone-${version}-source-distribution"/></antcall>
+		<antcall target="gli-set-version-numbers"><param name="glibasedir" value="${basedir}/distributions/Greenstone-${version}-source-distribution/gli"/></antcall>
+		<antcall target="insert-winbin"/>
+		<antcall target="insert-windows-perl"><param name="todir" value="${basedir}/distributions/Greenstone-${version}-source-distribution/bin/windows"/></antcall>
+		<antcall target="tweak-files" />
+		<antcall target="create-archives"/>
+		<antcall target="create-sourcecode"/>
+	</target>
+
+	<target name="properties">
+		<echo>Required Properties:</echo>
+		<echo>version             the version string for the release</echo>
+		<echo/>
+
+		<echo>Optional Properties:</echo>
+		<echo>branch.path         the branch of gsdl to make a release of. Eg: tags/2.81. Default: trunk.</echo>
+		<echo>branch.revision     the revision of gsdl to make a release of. Eg: 18273. Default: HEAD.</echo>
+		<echo/>
+	</target>
+
+
+	<target name="tweak-files">
+		<delete file="distributions/Greenstone-${version}-source-distribution/bin/linux/mgquery_old" />
+	</target>
+
+	<target name="insert-winbin">
+		<delete dir="distributions/Greenstone-${version}-source-distribution/bin/windows"/>
+		<svn>
+			<export srcurl="${svn.root}/main/${branch.path}/binaries/windows/bin" destPath="distributions/Greenstone-${version}-source-distribution/bin/windows"/>
+		</svn>
+		<get src="${server.exe.location}" dest="distributions/Greenstone-${version}-source-distribution/bin/windows/server.exe"/>
+		
+		<delete dir="distributions/Greenstone-${version}-source-distribution/bin/windows/imagemagick"/>
+		<delete dir="distributions/Greenstone-${version}-source-distribution/bin/windows/ghostscript"/>
+	</target>
+
+	<target name="create-archives">
+		<mkdir dir="products"/>
+		<delete file="products/Greenstone-${version}-source-distribution.zip"/>
+		<zip destfile="products/Greenstone-${version}-source-distribution.zip"  basedir="distributions" includes="Greenstone-${version}-source-distribution/**/*"/>
+		<exec dir="distributions" executable="tar">
+			<arg line="-czf ../products/Greenstone-${version}-source-distribution.tar.gz Greenstone-${version}-source-distribution"/>
+		</exec>
+	</target>
+
+	<target name="create-sourcecode">
+		<!-- create a directory for the sourcecode -->
+		<mkdir dir="distributions/source-component"/>
+
+		<!-- copy the files in -->
+		<exec dir="distributions/Greenstone-${version}-source-distribution" executable="cp">
+			<arg value="-r"/>
+
+			<!-- the bulk sourcecode -->
+			<arg value="build-src"/>
+			<arg value="common-src"/>
+			<arg value="runtime-src"/>
+
+			<!-- unix build files -->
+			<arg value="acconfig.h"/>
+			<arg value="aclocal.m4"/>
+			<arg value="config.sub"/>
+			<arg value="config.guess"/>
+			<arg value="configtest.pl"/>
+			<arg value="configure"/>
+			<arg value="configure.in"/>
+			<arg value="install-sh"/>
+			<arg value="Makefile.in"/>
+			<arg value="micotest.cpp"/>
+			<arg value="config.h.in"/>
+			<arg value="Install.txt"/>
+
+			<!-- windows build files -->
+			<arg value="win32.mak"/>
+			<arg value="win32cfg.h"/>
+			<arg value="makegs2.bat"/>
+
+			<!-- destination -->
+			<arg value="../source-component"/>
+
+		</exec>
+
+		<!-- unzip some windows packages -->
+		<unzip src="distributions/source-component/common-src/indexers/packages/windows/iconv/iconv.zip" dest="distributions/source-component/common-src/indexers/packages/windows/iconv"/>
+		<delete file="distributions/source-component/common-src/indexers/packages/windows/iconv/iconv.zip"/>
+		
+		<unzip src="distributions/source-component/common-src/packages/windows/crypt/crypt.zip" dest="distributions/source-component/common-src/packages/windows/crypt"/>
+		<delete file="distributions/source-component/common-src/packages/windows/crypt/crypt.zip"/>
+		
+		<unzip src="distributions/source-component/common-src/packages/windows/expat/expat.zip" dest="distributions/source-component/common-src/packages/windows/expat"/>
+		<delete file="distributions/source-component/common-src/packages/windows/expat/expat.zip"/>
+		
+		<unzip src="distributions/source-component/common-src/packages/windows/stlport/stlport.zip" dest="distributions/source-component/common-src/packages/windows/stlport"/>
+		<delete file="distributions/source-component/common-src/packages/windows/stlport/stlport.zip"/>
+
+		<exec executable="tar" dir="distributions/source-component/common-src/packages/sqlite"><arg value="-xzf"/><arg value="sqlite-amalgamation-3.5.9.tar.gz"/></exec>
+		<delete file="distributions/source-component/common-src/packages/sqlite/sqlite-amalgamation-3.5.9.tar.gz"/>
+
+		<exec executable="tar" dir="distributions/source-component/common-src/packages/expat"><arg value="-xzf"/><arg value="expat-1.95.8.tar.gz"/></exec>
+		<delete file="distributions/source-component/common-src/packages/sqlite/sqlite-amalgamation-3.5.9.tar.gz"/>
+
+		<!-- archive it -->
+		<delete file="products/Greenstone-${version}-source-component.zip"/>
+		<zip destfile="products/Greenstone-${version}-source-component.zip" basedir="distributions/source-component" includes="**/*"/>
+		<exec dir="distributions/source-component" executable="bash">
+			<arg value="-c"/>
+			<arg value="tar -czf ../../products/Greenstone-${version}-source-component.tar.gz *"/>
+		</exec>
+	</target>
+
+
+</project>
Index: main/trunk/release-kits/kits/sork2/bin/sork2
===================================================================
--- main/trunk/release-kits/kits/sork2/bin/sork2	(revision 21386)
+++ main/trunk/release-kits/kits/sork2/bin/sork2	(revision 21386)
@@ -0,0 +1,6 @@
+#!/bin/bash
+export rk_name="sork2"
+export rk_fullname="Source Release Kit for Greenstone2"
+export RK_HOME="$(cd "$(dirname "$(dirname "$0")")" && pwd)"
+$RK_HOME/linux/rk "$*"
+
Index: main/trunk/release-kits/kits/sork3/ant-scripts/build.xml
===================================================================
--- main/trunk/release-kits/kits/sork3/ant-scripts/build.xml	(revision 21386)
+++ main/trunk/release-kits/kits/sork3/ant-scripts/build.xml	(revision 21386)
@@ -0,0 +1,148 @@
+<?xml version="1.0" encoding="utf-8" ?>
+<!--
+		.......................................................... 
+		July 2009
+		Source Release Kit for Greenstone3 (sork3)
+		Oran Fry
+		..........................................................
+-->
+
+<project name="sork3-build" default="sork3">
+
+	<!-- CONSTANTS -->
+
+	<!-- for the benefit of the shared scripts, set release-kit home -->
+	<property name="rk.name" value="sork3"/>
+	<property name="rk.home" value="${sork3.home}" />
+	<property name="rk.os" value="multi" />
+	<property name="os.suffix" value="AnyPlatform"/>
+	
+	<!-- IMPORT OTHER ANT SCRIPTS -->
+	<import file="../core/ant-scripts/init.xml"/>
+	<import file="../core/ant-scripts/operations-on-gli.xml"/>
+	<import file="../greenstone3/ant-scripts/rk3-targets.xml"/>
+
+	<!-- helper constant -->
+	<property name="dist.dirname" value="Greenstone-${version}-source-distribution"/>
+
+	<!-- THE MAIN TARGET -->
+	<target name="sork3" depends="init">
+		<antcall target="export-greenstone3"><param name="dest" value="distributions/${dist.dirname}"/></antcall>
+		<antcall target="greenstone3-set-version-numbers"><param name="greenstone3basedir" value="${basedir}/distributions/${dist.dirname}"/></antcall>
+		<ant dir="distributions/${dist.dirname}" target="prepare">
+			<property name="properties.accepted" value="true"/>
+			<property name="app.version" value="${version}"/>
+		</ant>
+		<antcall target="gli-set-version-numbers"><param name="glibasedir" value="${basedir}/distributions/${dist.dirname}/gli"/></antcall>
+		<antcall target="insert-winbin"/>
+		<antcall target="insert-ant"/>
+		<antcall target="insert-windows-perl"><param name="todir" value="${basedir}/distributions/${dist.dirname}/gs2build/bin/windows"/></antcall>
+		<antcall target="tweak-files"/>
+		<ant dir="distributions/${dist.dirname}">
+			<target name="fix-execute-permissions"/>
+			<target name="fix-execute-permissions-source"/>
+		</ant>
+		<antcall target="create-archives"/>
+		<ant dir="." antfile="${sork3.home}/ant-scripts/create-sourcecode-component.xml" target="create-sourcecode-component"/>
+	</target>
+
+	<target name="properties">
+		<echo>Required Properties:</echo>
+		<echo>version             the version string for the release</echo>
+		<echo/>
+
+		<echo>Optional Properties:</echo>
+		<echo>branch.path         the branch of gsdl to make a release of. Eg: tags/2.81. Default: trunk.</echo>
+		<echo>branch.revision     the revision of gsdl to make a release of. Eg: 18273. Default: HEAD.</echo>
+		<echo/>
+	</target>
+
+
+	<target name="tweak-files">
+		<delete file="distributions/${dist.dirname}/gs2build/bin/linux/mgquery_old" />
+		<delete file="distributions/${dist.dirname}/build.properties.in"/>
+		<delete><fileset dir="distributions/${dist.dirname}/packages" includes="**/*.zip,**/*.tar.gz"/></delete>
+	</target>
+
+	<target name="insert-ant">
+		<copy todir="distributions/${dist.dirname}/packages/ant">
+			<fileset dir="${rk.home}/core/ant"/>
+		</copy>
+	</target>
+
+	<target name="insert-winbin">
+		<delete dir="distributions/${dist.dirname}/gs2build/bin/windows"/>
+		<svn>
+			<export srcurl="${svn.root}/main/${branch.path}/binaries/windows/bin" destPath="distributions/${dist.dirname}/gs2build/bin/windows"/>
+		</svn>
+		<delete dir="distributions/${dist.dirname}/gs2build/bin/windows/imagemagick"/>
+		<delete dir="distributions/${dist.dirname}/gs2build/bin/windows/ghostscript"/>
+	</target>
+
+	<target name="create-archives">
+		<mkdir dir="products"/>
+		<delete file="products/${dist.dirname}.zip"/>
+		<zip destfile="products/${dist.dirname}.zip"  basedir="distributions" includes="${dist.dirname}/**/*"/>
+		<exec dir="distributions" executable="tar">
+			<arg line="-czf ../products/${dist.dirname}.tar.gz ${dist.dirname}"/>
+		</exec>
+	</target>
+
+	<target name="create-sourcecode">
+		<!-- create a directory for the sourcecode -->
+		<mkdir dir="distributions/source-component/gs2build"/>
+
+		<!-- copy the files in -->
+		<exec dir="distributions/${dist.dirname}" executable="cp">
+			<arg value="-r"/>
+
+			<!-- the bulk sourcecode -->
+			<arg value="gs2build/build-src"/>
+			<arg value="gs2build/common-src"/>
+
+			<!-- destination -->
+			<arg value="../source-component/gs2build"/>
+
+		</exec>
+		
+		<!-- copy the files in -->
+		<exec dir="distributions/${dist.dirname}" executable="cp">
+			<arg value="-r"/>
+
+			<!-- the bulk sourcecode -->
+			<arg value="src"/>
+
+			<!-- destination -->
+			<arg value="../source-component"/>
+
+		</exec>
+
+		<!-- unzip some packages -->
+		<unzip src="distributions/source-component/gs2build/common-src/indexers/packages/windows/iconv/iconv.zip" dest="distributions/source-component/gs2build/common-src/indexers/packages/windows/iconv"/>
+		<delete file="distributions/source-component/gs2build/common-src/indexers/packages/windows/iconv/iconv.zip"/>
+		
+		<unzip src="distributions/source-component/gs2build/common-src/packages/windows/crypt/crypt.zip" dest="distributions/source-component/gs2build/common-src/packages/windows/crypt"/>
+		<delete file="distributions/source-component/gs2build/common-src/packages/windows/crypt/crypt.zip"/>
+		
+		<unzip src="distributions/source-component/gs2build/common-src/packages/windows/expat/expat.zip" dest="distributions/source-component/gs2build/common-src/packages/windows/expat"/>
+		<delete file="distributions/source-component/gs2build/common-src/packages/windows/expat/expat.zip"/>
+		
+		<unzip src="distributions/source-component/gs2build/common-src/packages/windows/stlport/stlport.zip" dest="distributions/source-component/gs2build/common-src/packages/windows/stlport"/>
+		<delete file="distributions/source-component/gs2build/common-src/packages/windows/stlport/stlport.zip"/>
+
+		<exec executable="tar" dir="distributions/source-component/gs2build/common-src/packages/sqlite"><arg value="-xzf"/><arg value="sqlite-amalgamation-3.5.9.tar.gz"/></exec>
+		<delete file="distributions/source-component/gs2build/common-src/packages/sqlite/sqlite-amalgamation-3.5.9.tar.gz"/>
+
+		<exec executable="tar" dir="distributions/source-component/gs2build/common-src/packages/expat"><arg value="-xzf"/><arg value="expat-1.95.8.tar.gz"/></exec>
+		<delete file="distributions/source-component/gs2build/common-src/packages/sqlite/sqlite-amalgamation-3.5.9.tar.gz"/>
+
+		<!-- archive it -->
+		<delete file="products/Greenstone-${version}-source-component.zip"/>
+		<zip destfile="products/Greenstone-${version}-source-component.zip" basedir="distributions/source-component" includes="**/*"/>
+		<exec dir="distributions/source-component" executable="bash">
+			<arg value="-c"/>
+			<arg value="tar -czf ../../products/Greenstone-${version}-source-component.tar.gz *"/>
+		</exec>
+	</target>
+
+</project>
Index: main/trunk/release-kits/kits/sork3/ant-scripts/create-sourcecode-component.xml
===================================================================
--- main/trunk/release-kits/kits/sork3/ant-scripts/create-sourcecode-component.xml	(revision 21386)
+++ main/trunk/release-kits/kits/sork3/ant-scripts/create-sourcecode-component.xml	(revision 21386)
@@ -0,0 +1,32 @@
+<?xml version="1.0" encoding="utf-8" ?>
+<!-- this is in a separate file because <import> can only load files that exist before build starts. This separate project is exeuted using <ant> AFTER greenstone3 has been checked out, to allow us to import the source-fileset.xml file -->
+<project name="create-sourcecode-component" default="csc">
+	<echo>basedir: ${basedir}</echo>
+
+	<import file="${basedir}/distributions/${dist.dirname}/resources/xml/components.xml"/>
+	<import file="${basedir}/distributions/${dist.dirname}/resources/xml/executables.xml"/>
+
+	<target name="create-sourcecode-component">
+
+		<copy todir="distributions/source-component">
+			<fileset dir="distributions/${dist.dirname}">
+				<patternset refid="greenstone3.source.component"/>
+			</fileset>
+		</copy>
+
+		<!-- fix permissions -->
+		<chmod perm="775">
+			<fileset dir="distributions/source-component"><patternset refid="greenstone3.source.executables"/></fileset>
+		</chmod>
+
+		<!-- archive it -->
+		<delete file="products/Greenstone-${version}-source-component.zip"/>
+		<zip destfile="products/Greenstone-${version}-source-component.zip" basedir="distributions/source-component" includes="**/*"/>
+		<exec dir="distributions/source-component" executable="bash">
+			<arg value="-c"/>
+			<arg value="tar -czf ../../products/Greenstone-${version}-source-component.tar.gz *"/>
+		</exec>
+	</target>
+
+
+</project>
Index: main/trunk/release-kits/kits/sork3/bin/sork3
===================================================================
--- main/trunk/release-kits/kits/sork3/bin/sork3	(revision 21386)
+++ main/trunk/release-kits/kits/sork3/bin/sork3	(revision 21386)
@@ -0,0 +1,6 @@
+#!/bin/bash
+export rk_name="sork3"
+export rk_fullname="Source Release Kit for Greenstone3"
+export RK_HOME="$(cd "$(dirname "$(dirname "$0")")" && pwd)"
+$RK_HOME/linux/rk "$*"
+
Index: main/trunk/release-kits/rk2/build.xml
===================================================================
--- main/trunk/release-kits/rk2/build.xml	(revision 21385)
+++ 	(revision )
@@ -1,7 +1,0 @@
-<project name="rk2-compile" default="compile">
-
-	<target name="compile">
-		<ant dir="core"/>
-	</target>
-
-</project>
Index: main/trunk/release-kits/rk2/setup.bat
===================================================================
--- main/trunk/release-kits/rk2/setup.bat	(revision 21385)
+++ 	(revision )
@@ -1,16 +1,0 @@
-@echo off
-
-pushd %~dp0
-
-if not "%RK2_HOME%" == "" goto already
-set RK2_HOME=%CD%
-set ANT_HOME=%RK2_HOME%\core\ant
-set PATH=%RK2_HOME%\bin;%ANT_HOME%\bin;%PATH%
-echo Done
-goto end
-
-:already
-echo rk2 environment already set up
-
-:end
-popd
