Index: main/trunk/release-kits/kits/rk2/ant-scripts/build.xml
===================================================================
--- main/trunk/release-kits/kits/rk2/ant-scripts/build.xml	(revision 21610)
+++ main/trunk/release-kits/kits/rk2/ant-scripts/build.xml	(revision 21623)
@@ -16,7 +16,6 @@
 
 	<import file="compile.xml"/>
-	<import file="create-distribution.xml"/>
 	<import file="create-components.xml"/>
-	<import file="create-installer.xml"/>
+	<import file="${rk.home}/shared/core/ant-scripts/create-installer.xml"/>
 	<import file="wrap.xml"/>
 	<import file="create-cdrom-components.xml"/>
@@ -25,5 +24,5 @@
 
 	<!-- THE MAIN TARGET -->
-	<target name="rk2" depends="init,gs2-init,compile,create-distribution,create-components,create-installer,wrap,create-cdrom-components"/>
+	<target name="rk2" depends="init,gs2-init,compile,create-components,create-installer,wrap,create-cdrom-components"/>
 
 	<target name="properties">
@@ -38,23 +37,4 @@
 
 	<!-- TODO: Move the targets below to the xml file that calls it -->
-	<target name="checkout-gsdl-gli">
-		<exec executable="svn">
-			<arg value="checkout"/>
-			<arg value="${svn.root}/main/${branch.path}/greenstone2"/>
-			<arg value="${basedir}/compiled"/>
-		</exec>
-                <exec executable="svn">
-			<arg value="checkout"/>
-			<arg value="${svn.root}/main/${branch.path}/gli"/>
-			<arg value="${basedir}/compiled/gli"/>
-		</exec>
-	</target>
-
-	<target name="insert-export-to-cd-package">
-		<mkdir dir="${gsdl.basedir}/bin/windows"/>
-		<get src="${server.exe.location}" dest="${gsdl.basedir}/bin/windows/server.exe"/>
-		<get src="${svn.root}/main/${branch.path}/binaries/windows/bin/Setup.exe" dest="${gsdl.basedir}/bin/windows/Setup.exe"/>
-		<get src="${svn.root}/main/${branch.path}/binaries/windows/bin/gssetup.exe" dest="${gsdl.basedir}/bin/windows/gssetup.exe"/>
-	</target>
 
 	<target name="create-binary-zip-unix">
@@ -79,71 +59,7 @@
 	</target>
 
-	<target name="create-binary-zip-windows">
-		<property name="binzip.dir" value="distributions/Greenstone-${version}-${os.suffix}-binary"/>
-		<copy todir="${binzip.dir}">
-			<fileset dir="distributions/web"/>
-		</copy>
-
-		<!-- delete sourcecode -->
-		<delete dir="${binzip.dir}/common-src"/>
-		<delete dir="${binzip.dir}/build-src"/>
-		<delete dir="${binzip.dir}/runtime-src"/>
-
-		<!-- delete loose files -->
-		<delete>
-			<fileset dir="${binzip.dir}" includes="README*.txt,Uninstall.bat,Uninst.bat,uninst.jar,win32.mak,win32cfg.h,makegs2.bat" excludes="READMEen.txt"/>
-		</delete>
-	</target>
-
-	<target name="dist-clean-sourcecode">
-
-		<!-- delete the sourcecode -->
-		<delete>
-			<fileset dir="distributions/web" includes="Makefile,config.cache,config.h,config.log,stamp-h,config.status"/>
-		</delete>
-		<delete dir="distributions/web/common-src"/>
-		<delete dir="distributions/web/build-src"/>
-		<delete dir="distributions/web/runtime-src"/>
-		<delete>
-			<fileset dir="distributions/web" includes="Install.txt,acconfig.h,aclocal.m4,config.guess,config.sub,configtest.pl,configure,configure.in,install-sh,Makefile.in,micotest.cpp,config.h.in,win32.mak,win32cfg.h"/>
-		</delete>
-
-       	</target>
-
 	<target name="dist-unzip-packages">
 		<untar src="${basedir}/distributions/web/common-src/packages/sqlite/sqlite-amalgamation-3.5.9.tar.gz" dest="${basedir}/distributions/web/common-src/packages/sqlite" compression="gzip"/>
 		<delete file="${basedir}/distributions/web/common-src/packages/sqlite/sqlite-amalgamation-3.5.9.tar.gz"/>
-	</target>
-
-	<target name="make-common-src">
-		<exec dir="${basedir}/compiled/common-src" executable="make" failonerror="true"/>
-		<!--<exec dir="${basedir}/compiled/common-src" executable="make" failonerror="true"><arg value="install"/></exec>-->
-	</target>
-
-	<target name="compile-gli">
-
-		<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>
-		<exec dir="${glibasedir}" executable="${glibasedir}/makegli.${script.format}"/>
-
-		<echo>Creating jar...</echo>
-		<exec dir="${glibasedir}" executable="${glibasedir}/makejar.${script.format}"/>
-
-		<echo>Cleaning up intermediate files...</echo>
-		<delete dir="${glibasedir}/jar"/>
-		<delete dir="${glibasedir}/classes/org"/>
-
-		<if><bool><isset property="gsdlbasedir"/></bool>
-			<echo>Putting gli server jar in a better place</echo>
-			<exec executable="mv" failonerror="true">
-				<arg line="${glibasedir}/GLIServer.jar ${gsdlbasedir}/bin/java" />
-			</exec>
-		</if>
-
 	</target>
 
Index: main/trunk/release-kits/kits/rk2/ant-scripts/compile.xml
===================================================================
--- main/trunk/release-kits/kits/rk2/ant-scripts/compile.xml	(revision 21610)
+++ main/trunk/release-kits/kits/rk2/ant-scripts/compile.xml	(revision 21623)
@@ -4,6 +4,22 @@
 	<target name="compile" depends="init,gs2-init">
 
-		<antcall target="checkout-gsdl-gli" />
-		<antcall target="drop-in-docs"><param name="gsdl.basedir" value="${basedir}/compiled"/></antcall>
+		<!-- checkout gsdl and gli -->
+		<exec executable="svn">
+			<arg value="checkout"/>
+			<arg value="${svn.root}/main/${branch.path}/greenstone2"/>
+			<arg value="${basedir}/compiled"/>
+		</exec>
+                <exec executable="svn">
+			<arg value="checkout"/>
+			<arg value="${svn.root}/main/${branch.path}/gli"/>
+			<arg value="${basedir}/compiled/gli"/>
+		</exec>
+
+		<!-- drop in documentation -->
+		<copy todir="compiled" overwrite="true">
+			<fileset dir="${rk.home}/shared/greenstone2/docs" excludes="READMEar.txt,READMEes.txt,READMEfr.txt,READMEru.txt"/>
+		</copy>
+
+		<!-- set version numbers -->
 		<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>
@@ -11,79 +27,43 @@
 		<!-- 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" />
+
+			<!-- 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"/>
+
+			<!-- 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>
+
+			<!-- insert windows perl -->
+			<unzip src="${rk.home}/shared/windows/perl.zip" dest="compiled/bin/windows"/>
+
+			<!-- compile c code -->
+			<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"/>
+
 
 		<!-- 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>
+
+			<!-- 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>
+
+			<!-- 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;"/>
+
+			<!-- run configure -->
 			<exec dir="${basedir}/compiled" executable="${basedir}/compiled/configure" failonerror="true">
 				<arg line="--enable-apache-httpd"/>
@@ -91,58 +71,73 @@
 			</exec>
 
-		<!-- mac -->
+			<!-- add -static to makefiles -->
+			<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"/>
+
+		<!-- mac only -->
 		<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">
-
+			<!-- run configure -->
+			<exec dir="${basedir}/compiled" executable="${basedir}/compiled/configure" failonerror="true">
+				<arg line="--enable-apache-httpd"/>
+			</exec>
+
+			<!-- 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"/>
+
+		</if></else></if></else></if>
+
+		<!-- mac and linux: compile -->
+		<if><bool><or><equals arg1="${rk.os}" arg2="mac"/><equals arg1="${rk.os}" arg2="linux"/></or></bool>
+
+			<!-- WORKAROUND: 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 -->
+			<exec dir="${basedir}/compiled/common-src" executable="make" failonerror="true"/>
+			<exec dir="${basedir}/compiled" executable="${basedir}/compiled/configure" failonerror="true">
+				<arg line="--enable-apache-httpd"/>
+				<env key="LDFLAGS" value="-static"/>
+			</exec>
+			<!-- /WORKAROUND -->
+
+			<!-- make -->
+			<exec dir="${basedir}/compiled" executable="make" failonerror="true"/>
+
+			<!-- make install -->
+			<exec dir="${basedir}/compiled" executable="make" failonerror="true"><arg value="install"/></exec>
+
+			<!-- make apache-for-dist -->
+			<exec dir="${basedir}/compiled" executable="make" failonerror="true"><arg value="apache-for-dist"/></exec>
+
+			<!-- strip executables -->
+			<exec dir="${basedir}/compiled/bin/${os.shell}" executable="find" failonerror="true">
+				<arg line=". ! -name . -type f -maxdepth 1 -exec strip {} &#59;"/>
+			</exec>
+		</if>
+
+		<!-- compile gli -->
+		<exec dir="compiled/gli" executable="compiled/gli/makegli.${os.script.format}"/>
+		<exec dir="compiled/gli" executable="compiled/gli/makejar.${os.script.format}"/>
+		<delete dir="${glibasedir}/jar"/>
+		<delete dir="${glibasedir}/classes/org"/>
+		<move file="compiled/gli/GLIServer.jar" todir="compiled/bin/java"/>
+
+		<!-- compile uninstaller -->
+		<antcall target="insert-and-compile-uninstaller" />
+
+		<!-- build demo collection -->
 		<!-- linux, mac -->
 		<if><bool><or><equals arg1="${rk.os}" arg2="linux"/><equals arg1="${rk.os}" arg2="mac"/></or></bool>
-			<exec dir="${basedir}/compiled" executable="${rk.home}/kits/rk2/resources/build-demo.sh" failonerror="true"/>
+			<exec dir="${basedir}/compiled" executable="/bin/bash" failonerror="true">
+				<arg value="-c"/>
+				<arg value="
+					source setup.bash &amp;&amp; \
+					import.pl --removeold demo &amp;&amp; \
+					buildcol.pl --removeold demo &amp;&amp; \
+					rm -rf collect/demo/index collect/demo/archives &amp;&amp; \
+					mv collect/demo/building collect/demo/index"/>
+			</exec>
 
 		<!-- windows -->
@@ -166,47 +161,109 @@
 			<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>
+		</if></else></if>
+
+		<!-- delete the source code -->
+		<delete><fileset dir="compiled" includes="Makefile,config.cache,config.h,config.log,stamp-h,config.status"/></delete>
+		<delete dir="compiled/common-src"/>
+		<delete dir="compiled/build-src"/>
+		<delete dir="compiled/runtime-src"/>
+		<delete><fileset dir="compiled" includes="Install.txt,acconfig.h,aclocal.m4,config.guess,config.sub,configtest.pl,configure,configure.in,install-sh,Makefile.in,micotest.cpp,config.h.in,win32.mak,win32cfg.h"/></delete>
+
+		<!-- strip .svn working-copy dirs -->
+		<antcall target="strip-svn-dirs"><param name="dir" value="compiled"/></antcall>
+
+		<!-- create needed empty files -->
+		<mkdir dir="compiled/tmp"/>
+		<chmod dir="compiled/tmp" perm="a+rwx"/>
+		<echo file="compiled/etc/usage.txt"></echo>
+
+		<!-- windows -->
+		<if><bool><equals arg1="${rk.os}" arg2="windows"/></bool>
+
+			<!-- make a copy of server.exe in the root -->
+			<copy file="compiled/bin/windows/server.exe" tofile="compiled/server.exe"/>
+
+			<!-- delete sourcecode -->
+			<delete dir="${binzip.dir}/common-src"/>
+			<delete dir="${binzip.dir}/build-src"/>
+			<delete dir="${binzip.dir}/runtime-src"/>
+
+			<!-- create simple zipped binary distribution 
+			<mkdir dir="distributions"/>
+			<property name="binzip.dir" value="distributions/Greenstone-${version}-${os.suffix}-binary"/>
+			<copy todir="${binzip.dir}"><fileset dir="compiled"/></copy>
+			<delete><fileset dir="${binzip.dir}" includes="README*.txt,Uninstall.bat,Uninst.bat,uninst.jar,win32.mak,win32cfg.h,makegs2.bat" excludes="READMEen.txt"/></delete>
+			-->
+
+			<!-- delete unneeded files -->
+			<delete dir="compiled/bin/linux" />
+			<delete><fileset dir="compiled" includes="*.bash,*.sh,*.csh,.gstermrc"/></delete>
+			<delete><fileset dir="compiled/gli" includes="*.sh,*4gs3.bat"/></delete>
+			<delete dir="compiled/autom4te.cache" />
+
+		<!-- linux -->
+		<else><if><bool><equals arg1="${rk.os}" arg2="linux"/></bool>
+			<!-- grab imagemagick binaries -->
+			<delete dir="compiled/bin/linux/imagemagick"/>
+			<exec executable="svn">
+				<arg value="export"/>
+				<arg value="${svn.root}/main/${branch.path}/binaries/linux/imagemagick"/>
+				<arg value="compiled/bin/linux/imagemagick"/>
+			</exec>
+
+			<!-- grab wv binaries -->
+			<delete dir="compiled/bin/linux/wv"/>
+			<exec executable="svn">
+				<arg value="export"/>
+				<arg value="${svn.root}/main/${branch.path}/binaries/linux/wv"/>
+				<arg value="compiled/bin/linux/wv"/>
+			</exec>
+
+			<!-- delete unneeded files -->
+			<delete><fileset dir="compiled" includes="win32.mak,win32cfg.h,Install.sh,Support.htm,micotest.cpp"/></delete>
+			<delete><fileset dir="compiled/gli" includes="*.bat"/></delete>
+			<delete><fileset dir="compiled" includes="*.bat"/></delete>
+			<delete dir="compiled/common-src/packages/windows"/>
+			<delete dir="compiled/common-src/indexers/packages/windows"/>
+
+		<!-- mac -->
+		<else><if><bool><equals arg1="${rk.os}" arg2="mac"/></bool>
+			<!-- grab imagemagick binaries -->
+			<delete dir="compiled/bin/darwin/imagemagick"/>
+			<exec executable="svn">
+				<arg value="export"/>
+				<arg value="${svn.root}/main/${branch.path}/binaries/mac/intel/imagemagick"/>
+				<arg value="compiled/bin/darwin/imagemagick"/>
+			</exec>
+
+			<!-- grab ghostscript binaries -->
+			<delete dir="compiled/bin/darwin/imagemagick"/>
+			<exec executable="svn">
+				<arg value="export"/>
+				<arg value="${svn.root}/main/${branch.path}/binaries/mac/intel/ghostscript"/>
+				<arg value="compiled/bin/darwin/ghostscript"/>
+			</exec>
+
+			<!-- delete unneeded files -->
+			<delete><fileset dir="compiled" includes="win32.mak,win32cfg.h,Install.sh,Support.htm,*.bat"/></delete>
+			<delete><fileset dir="compiled/gli" includes="*.bat"/></delete>
+			<delete dir="compiled/common-src/packages/windows"/>
+
+		</if></else></if></else></if>
+
+		<!-- delete unneeded files -->
+		<delete dir="compiled/uninstaller" />
+		<delete file="compiled/gli/.greenstonestore" />
+		<delete file="compiled/bin/java/SignedGatherer.jar" />
+
+		<!-- mac and linux: insert export to cdrom package -->
+		<if><bool><or><equals arg1="${rk.os}" arg2="mac"/><equals arg1="${rk.os}" arg2="linux"/></or></bool>
+			<mkdir dir="compiled/bin/windows"/>
+			<get src="${server.exe.location}" dest="compiled/bin/windows/server.exe"/>
+			<get src="${svn.root}/main/${branch.path}/binaries/windows/bin/Setup.exe" dest="compiled/bin/windows/Setup.exe"/>
+			<get src="${svn.root}/main/${branch.path}/binaries/windows/bin/gssetup.exe" dest="compiled/bin/windows/gssetup.exe"/>
+		</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">
-		<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>
-
-	<target name="drop-in-docs">
-		<echo level="info">Dropping gsdl docs into distribution</echo>
-		<copy todir="${gsdl.basedir}" overwrite="true">
-			<fileset dir="${rk.home}/shared/greenstone2/docs" excludes="READMEar.txt,READMEes.txt,READMEfr.txt,READMEru.txt"/>
-		</copy>
-	</target>
-
-
 </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 21610)
+++ main/trunk/release-kits/kits/rk2/ant-scripts/create-cdrom-components.xml	(revision 21623)
@@ -10,10 +10,4 @@
 	<target name="create-cdrom-components" depends="init,gs2-init">
 		<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 -->
@@ -28,5 +22,4 @@
 		<mkdir dir="cdrom/dist/Software/core/all"/>
 		<mkdir dir="cdrom/dist/Software/core/${rk.os}"/>
-
 
 		<!-- core linux -->
@@ -109,4 +102,5 @@
 			<delete file="cdrom/dist/Java/Linux/jre.tar"/>
 			-->
+
 		<!-- jre windows -->
 		<else><if><bool><or><equals arg1="${rk.os}" arg2="windows"/></or></bool>
@@ -121,9 +115,6 @@
 		</if>
 
-	</target>
-
-	<target name="compile-cdrom-wrapper">
-
-		<!-- windows -->
+		<!-- compile cdrom wrapper -->
+		<!-- (windows) -->
 		<if><bool><equals arg1="${rk.os}" arg2="windows"/></bool>
 			<copy todir="cdrom/build" overwrite="true">
@@ -143,5 +134,5 @@
 			</exec>
 
-		<!-- linux -->
+		<!-- (linux) -->
 		<else><if><bool><equals arg1="${rk.os}" arg2="linux"/></bool>
 			<copy file="${rk.home}/shared/linux/wrapper.cpp" todir="cdrom/build" overwrite="true"/>
@@ -157,5 +148,5 @@
 			</exec>
 
-		<!-- mac -->
+		<!-- (mac) -->
 		<else><if><bool><equals arg1="${rk.os}" arg2="mac"/></bool>
 
@@ -175,11 +166,8 @@
 		</if></else></if></else></if>
 
-	</target>
 
-
-
-	<target name="create-cdrom-components-archive">
+		<!-- create cdrom components -archive -->
 		<mkdir dir="products"/>
-		<!-- windows -->
+		<!-- (windows) -->
 		<if><bool><equals arg1="${rk.os}" arg2="windows"/></bool>
 			<tar destfile="products/cdrom-components-${version}-windows.tar.gz" compression="gzip">
@@ -187,5 +175,5 @@
 			</tar>
 
-		<!-- linux and mac -->
+		<!-- (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">
@@ -196,4 +184,3 @@
 	</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 21610)
+++ main/trunk/release-kits/kits/rk2/ant-scripts/create-components.xml	(revision 21623)
@@ -4,14 +4,14 @@
 	<target name="create-components" depends="init,gs2-init">
 
-		<antcall target="prepare-component"><param name="component" value="core"/></antcall>
-		<antcall target="compress-component"><param name="component" value="core"/></antcall>
+		<!-- core  -->
+		<antcall target="create-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>
+		<!-- imagemagick -->
+		<antcall target="create-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>
+			<!-- ghostscript -->
+			<antcall target="create-component"><param name="component" value="ghostscript"/></antcall>
 		</if>
 
Index: main/trunk/release-kits/kits/rk2/ant-scripts/create-distribution.xml
===================================================================
--- main/trunk/release-kits/kits/rk2/ant-scripts/create-distribution.xml	(revision 21610)
+++ 	(revision )
@@ -1,99 +1,0 @@
-<?xml version="1.0" encoding="utf-8" ?>
-<project name="rk2-create-distribution">
-
-	<target name="create-distribution" depends="init,gs2-init">
-
-		<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>
-
-		<!-- create needed empty files -->
-		<mkdir dir="distributions/web/tmp"/>
-		<chmod dir="distributions/web/tmp" perm="a+rwx"/>
-		<echo file="distributions/web/etc/usage.txt"></echo>
-
-		<!-- windows -->
-		<if><bool><equals arg1="${rk.os}" arg2="windows"/></bool>
-			<antcall target="copy-server"/>
-			<antcall target="create-binary-zip-windows"/>
-
-			<!-- unneeded files -->
-			<delete dir="${basedir}/distributions/web/bin/linux" />
-			<delete><fileset dir="${basedir}/distributions/web" includes="*.bash,*.sh,*.csh,.gstermrc"/></delete>
-			<delete><fileset dir="${basedir}/distributions/web/gli" includes="*.sh,*4gs3.bat"/></delete>
-			<delete dir="${basedir}/distributions/web/autom4te.cache" />
-
-		<!-- 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>
-			<antcall target="export-imagemagick-linux-binaries"/>
-			<antcall target="export-wvware-linux-binaries"/>
-
-			<!-- unneeded files -->
-			<delete><fileset dir="${basedir}/distributions/web" includes="win32.mak,win32cfg.h,Install.sh,Support.htm,micotest.cpp"/></delete>
-			<delete><fileset dir="${basedir}/distributions/web/gli" includes="*.bat"/></delete>
-			<delete><fileset dir="${basedir}/distributions/web" includes="*.bat"/></delete>
-			<delete dir="${basedir}/distributions/web/common-src/packages/windows"/>
-			<delete dir="${basedir}/distributions/web/common-src/indexers/packages/windows"/>
-
-		<!-- 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>
-			<antcall target="export-imagemagick-darwin-binaries" />
-			<antcall target="export-ghostscript-darwin-binaries" />
-
-			<!-- unneeded files -->
-			<delete><fileset dir="${basedir}/distributions/web" includes="win32.mak,win32cfg.h,Install.sh,Support.htm"/></delete>
-			<delete><fileset dir="${basedir}/distributions/web/gli" includes="*.bat"/></delete>
-			<delete><fileset dir="${basedir}/distributions/web" includes="*.bat"/></delete>
-			<delete dir="${basedir}/distributions/web/common-src/packages/windows"/>
-
-
-		</if></else></if></else></if>
-
-		<!-- unneeded files -->
-		<delete dir="${basedir}/distributions/web/uninstaller" />
-		<delete file="${basedir}/distributions/web/gli/.greenstonestore" />
-		<delete file="${basedir}/distributions/web/bin/java/SignedGatherer.jar" />
-
-	</target>
-	
-	<target name="copy-server">
-		<copy file="distributions/web/bin/windows/server.exe" tofile="distributions/web/server.exe"/>
-	</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/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/bin/linux/wv"/>
-		</svn>
-	</target>
-
-	<target name="export-imagemagick-darwin-binaries">
-		<delete dir="distributions/web/bin/darwin/imagemagick"/>
-		<exec executable="svn">
-			<arg value="export"/>
-			<arg value="${svn.root}/main/${branch.path}/binaries/mac/intel/imagemagick"/>
-			<arg value="distributions/web/bin/darwin/imagemagick"/>
-		</exec>
-	</target>
-	
-	<target name="export-ghostscript-darwin-binaries">
-		<delete dir="distributions/web/bin/darwin/ghostscript"/>
-		<exec executable="svn">
-			<arg value="export"/>
-			<arg value="${svn.root}/main/${branch.path}/binaries/mac/intel/ghostscript"/>
-			<arg value="distributions/web/bin/darwin/ghostscript"/>
-		</exec>
-	</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 21610)
+++ 	(revision )
@@ -1,27 +1,0 @@
-<?xml version="1.0" encoding="utf-8" ?>
-<project name="rk2-create-installer">
-
-	<target name="create-installer" depends="init,gs2-init">
-		<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="${rk.home}/shared/core/ant-tasks/greenstone/anttasks.jar" dest="installer/classes"/>
-		<unjar src="${rk.home}/shared/core/lib/crypt.jar" dest="installer/classes"/>
-
-		<!-- windows -->
-		<if><bool><equals arg1="${rk.os}" arg2="windows"/></bool>
-			<copy todir="installer/classes" file="${rk.home}/shared/windows/7za/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="${rk.home}/shared/core/ant-tasks/7z-ant/7z.jar" dest="installer/classes"/>
-		</if></else></if>
-
-		<delete dir="installer/classes/META-INF"/>
-	</target>
-
-</project>
