Index: release-kits/lirk2/ant-scripts/compile.xml
===================================================================
--- release-kits/lirk2/ant-scripts/compile.xml	(revision 20649)
+++ release-kits/lirk2/ant-scripts/compile.xml	(revision 20721)
@@ -43,71 +43,4 @@
 	</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">
-		<exec dir="${basedir}/compiled" executable="${basedir}/compiled/configure" failonerror="true">
-			<arg line="--enable-apache-httpd"/>
-			<env key="LDFLAGS" value="-static"/>
-		</exec>
-	</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/linux" executable="find" failonerror="true">
-			<arg line="! -name . -type f -maxdepth 1 -exec strip {} &#59;"/>
-		</exec>
-	</target>
-
-	<target name="build-demo-collection">
-		<exec dir="${basedir}/compiled" executable="${lirk2.home}/resources/build-demo.sh" failonerror="true"/>
-	</target>
 
 
Index: release-kits/mark2/ant-scripts/compile.xml
===================================================================
--- release-kits/mark2/ant-scripts/compile.xml	(revision 20649)
+++ release-kits/mark2/ant-scripts/compile.xml	(revision 20721)
@@ -41,36 +41,4 @@
 	</target>
 
-	<target name="run-configure">
-		<exec dir="${basedir}/compiled" executable="${basedir}/compiled/configure">
-			<arg value="--enable-apache-httpd"/>
-		</exec>
-	</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="run-make">
-		<exec dir="${basedir}/compiled" executable="make"/>
-	</target>
-
-	<target name="run-make-install">
-		<exec dir="${basedir}/compiled" executable="make"><arg value="install"/></exec>
-	</target>
-
-	<target name="run-make-apache-for-dist">
-		<exec dir="${basedir}/compiled" executable="make"><arg value="apache-for-dist"/></exec>
-	</target>
-
-	<target name="strip-execs">
-		<exec dir="${basedir}/compiled/bin/darwin" executable="find">
-			<arg line=". ! -name . -type f -maxdepth 1 -exec strip {} &#59;"/>
-		</exec>
-	</target>
-
-	<target name="build-demo-collection">
-		<exec dir="${basedir}/compiled" executable="${mark2.home}/resources/build-demo.sh"/>
-	</target>
 
 </project>
Index: release-kits/rk2/ant-scripts/build.xml
===================================================================
--- release-kits/rk2/ant-scripts/build.xml	(revision 20721)
+++ release-kits/rk2/ant-scripts/build.xml	(revision 20721)
@@ -0,0 +1,50 @@
+<?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"/>
+
+	<!-- 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 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: release-kits/rk2/ant-scripts/compile.xml
===================================================================
--- release-kits/rk2/ant-scripts/compile.xml	(revision 20721)
+++ release-kits/rk2/ant-scripts/compile.xml	(revision 20721)
@@ -0,0 +1,203 @@
+<?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-linux"/>
+			<!-- 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-mac"/>
+			<!-- 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="windows"/></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="windows"/></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}/other-projects/trunk/winbin/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="${basedir}/compiled/compile.bat" />
+		<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: release-kits/rk2/ant-scripts/create-cdrom-components.xml
===================================================================
--- release-kits/rk2/ant-scripts/create-cdrom-components.xml	(revision 20721)
+++ release-kits/rk2/ant-scripts/create-cdrom-components.xml	(revision 20721)
@@ -0,0 +1,19 @@
+<?xml version="1.0" encoding="utf-8" ?>
+<project name="rk2-create-cdrom-components" default="create-cdrom-components">
+
+	<target name="create-cdrom-components">
+		<!-- windows -->
+		<if><bool><equals arg1="${rk.os}" arg2="windows"/></bool>
+
+		<!-- linux -->
+		<else><if><bool><equals arg1="${rk.os}" arg2="linux"/></bool>
+
+		<!-- mac -->
+		<else><if><bool><equals arg1="${rk.os}" arg2="mac"/></bool>
+
+		</if></else></if></else></if>
+
+	</target>
+
+
+</project>
Index: release-kits/rk2/ant-scripts/create-components.xml
===================================================================
--- release-kits/rk2/ant-scripts/create-components.xml	(revision 20721)
+++ release-kits/rk2/ant-scripts/create-components.xml	(revision 20721)
@@ -0,0 +1,18 @@
+<?xml version="1.0" encoding="utf-8" ?>
+<project name="rk2-create-components">
+
+	<target name="create-components">
+		<!-- windows -->
+		<if><bool><equals arg1="${rk.os}" arg2="windows"/></bool>
+
+		<!-- linux -->
+		<else><if><bool><equals arg1="${rk.os}" arg2="linux"/></bool>
+
+		<!-- mac -->
+		<else><if><bool><equals arg1="${rk.os}" arg2="mac"/></bool>
+
+		</if></else></if></else></if>
+
+	</target>
+
+</project>
Index: release-kits/rk2/ant-scripts/create-distribution.xml
===================================================================
--- release-kits/rk2/ant-scripts/create-distribution.xml	(revision 20721)
+++ release-kits/rk2/ant-scripts/create-distribution.xml	(revision 20721)
@@ -0,0 +1,42 @@
+<?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: release-kits/rk2/ant-scripts/create-installer.xml
===================================================================
--- release-kits/rk2/ant-scripts/create-installer.xml	(revision 20721)
+++ release-kits/rk2/ant-scripts/create-installer.xml	(revision 20721)
@@ -0,0 +1,18 @@
+<?xml version="1.0" encoding="utf-8" ?>
+<project name="rk2-create-installer">
+
+	<target name="create-installer">
+		<!-- windows -->
+		<if><bool><equals arg1="${rk.os}" arg2="windows"/></bool>
+
+		<!-- linux -->
+		<else><if><bool><equals arg1="${rk.os}" arg2="linux"/></bool>
+
+		<!-- mac -->
+		<else><if><bool><equals arg1="${rk.os}" arg2="mac"/></bool>
+
+		</if></else></if></else></if>
+
+	</target>
+
+</project>
Index: release-kits/rk2/ant-scripts/wrap.xml
===================================================================
--- release-kits/rk2/ant-scripts/wrap.xml	(revision 20721)
+++ release-kits/rk2/ant-scripts/wrap.xml	(revision 20721)
@@ -0,0 +1,19 @@
+<?xml version="1.0" encoding="utf-8" ?>
+<project name="rk2-wrap" default="wrap">
+
+	<target name="wrap">
+		<!-- windows -->
+		<if><bool><equals arg1="${rk.os}" arg2="windows"/></bool>
+
+		<!-- linux -->
+		<else><if><bool><equals arg1="${rk.os}" arg2="linux"/></bool>
+
+		<!-- mac -->
+		<else><if><bool><equals arg1="${rk.os}" arg2="mac"/></bool>
+
+		</if></else></if></else></if>
+
+	</target>
+
+
+</project>
Index: release-kits/rk2/bin/rk2
===================================================================
--- release-kits/rk2/bin/rk2	(revision 20721)
+++ release-kits/rk2/bin/rk2	(revision 20721)
@@ -0,0 +1,5 @@
+#!/bin/bash
+export rk_name="rk2"
+export rk_fullname="Release Kit for Greenstone2"
+export RK_HOME=$RK2_HOME
+$RK2_HOME/linux/rk $*
Index: release-kits/rk2/build.xml
===================================================================
--- release-kits/rk2/build.xml	(revision 20721)
+++ release-kits/rk2/build.xml	(revision 20721)
@@ -0,0 +1,7 @@
+<project name="rk2-compile" default="compile">
+
+	<target name="compile">
+		<ant dir="core"/>
+	</target>
+
+</project>
Index: release-kits/rk2/core
===================================================================
--- release-kits/rk2/core	(revision 20721)
+++ release-kits/rk2/core	(revision 20721)
@@ -0,0 +1,1 @@
+link ../shared/core
Index: release-kits/rk2/greenstone2
===================================================================
--- release-kits/rk2/greenstone2	(revision 20721)
+++ release-kits/rk2/greenstone2	(revision 20721)
@@ -0,0 +1,1 @@
+link ../shared/greenstone2
Index: release-kits/rk2/linux
===================================================================
--- release-kits/rk2/linux	(revision 20721)
+++ release-kits/rk2/linux	(revision 20721)
@@ -0,0 +1,1 @@
+link ../shared/linux
Index: release-kits/rk2/mac
===================================================================
--- release-kits/rk2/mac	(revision 20721)
+++ release-kits/rk2/mac	(revision 20721)
@@ -0,0 +1,1 @@
+link ../shared/mac
Index: release-kits/rk2/resources/build-demo.sh
===================================================================
--- release-kits/rk2/resources/build-demo.sh	(revision 20721)
+++ release-kits/rk2/resources/build-demo.sh	(revision 20721)
@@ -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: release-kits/rk2/setup.bat
===================================================================
--- release-kits/rk2/setup.bat	(revision 20721)
+++ release-kits/rk2/setup.bat	(revision 20721)
@@ -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: release-kits/rk2/setup.sh
===================================================================
--- release-kits/rk2/setup.sh	(revision 20721)
+++ release-kits/rk2/setup.sh	(revision 20721)
@@ -0,0 +1,8 @@
+if [ "$RK2_HOME" != "" ]; then
+	echo "rk2 envorinment already set up"
+else
+	home_possibly_relative=`dirname ${BASH_SOURCE:-$0}`
+	export RK2_HOME="`cd $home_possibly_relative && pwd`"
+	export PATH=$RK2_HOME/bin:$PATH
+fi
+
Index: release-kits/rk2/windows
===================================================================
--- release-kits/rk2/windows	(revision 20721)
+++ release-kits/rk2/windows	(revision 20721)
@@ -0,0 +1,1 @@
+link ../shared/windows
Index: release-kits/shared/greenstone2/ant-scripts/rk2-targets.xml
===================================================================
--- release-kits/shared/greenstone2/ant-scripts/rk2-targets.xml	(revision 20649)
+++ release-kits/shared/greenstone2/ant-scripts/rk2-targets.xml	(revision 20721)
@@ -125,6 +125,9 @@
 	<target name="compile-gli">
 
-		<!-- default to sh -->
-		<property name="script.format" value="sh"/>
+		<if><bool><or><equals arg1="${rk.os}" arg2="linux"/><equals arg1="${rk.os}" arg2="mac"/></or></bool>
+			<property name="script.format" value="sh"/>
+		<else><if><bool><equals arg1="${rk.os}" arg2="windows"/></bool>
+			<property name="script.format" value="bat"/>
+		</if></else></if>
 		
 		<echo>Compiling gli...</echo>
Index: release-kits/wirk2/ant-scripts/compile.xml
===================================================================
--- release-kits/wirk2/ant-scripts/compile.xml	(revision 20649)
+++ release-kits/wirk2/ant-scripts/compile.xml	(revision 20721)
@@ -26,47 +26,5 @@
 	</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}/other-projects/trunk/winbin/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="${basedir}/compiled/compile.bat" />
-		<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>
 	
-	<target name="build-demo-collection">
-		<!-- 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"/>
-	</target>
 	
 </project>
