Index: /main/trunk/release-kits/kits/rk2/ant-scripts/compile.xml
===================================================================
--- /main/trunk/release-kits/kits/rk2/ant-scripts/compile.xml	(revision 23648)
+++ /main/trunk/release-kits/kits/rk2/ant-scripts/compile.xml	(revision 23649)
@@ -271,4 +271,135 @@
 		<antcall target="insert-and-compile-uninstaller" />
 
+		<!-- 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,lib/**/*.a"/></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 and wv (if less than 2.84) binaries -->
+			<delete dir="compiled/bin/linux/imagemagick"/>
+
+			<if><bool><equals arg1="${post.2.83.version}" arg2="true"/></bool>
+			        <if><bool><equals arg1="${x64}" arg2="true"/></bool>
+					<exec executable="svn">
+					        <arg value="export"/>
+					        <arg value="${svn.root}/gs2-extensions/imagemagick/trunk/imagemagick-linux-x64.tar.gz"/>
+					        <arg value="compiled/ext/imagemagick-linux-x64.tar.gz"/>
+				        </exec>
+
+					<exec executable="tar" dir="compiled/ext">
+					        <arg value="xvzf"/>
+						<arg value="imagemagick-linux-x64.tar.gz"/>
+					</exec>
+					<delete file="compiled/ext/imagemagick-linux-x64.tar.gz"/>
+				<else>
+				        <exec executable="svn">
+					        <arg value="export"/>
+						<arg value="${svn.root}/main/${branch.path}/binaries/linux/imagemagick"/>
+						<arg value="compiled/bin/linux/imagemagick"/>
+					</exec>
+				</else>
+				</if>
+				<else>
+					<delete dir="compiled/bin/linux/wv"/>	
+					<exec executable="svn">
+						<arg value="export"/>
+						<arg value="${svn.root}/main/trunk/binaries/linux/imagemagick"/>
+						<arg value="compiled/bin/linux/imagemagick"/>
+					</exec>
+
+					<exec executable="svn">
+						<arg value="export"/>
+						<arg value="${svn.root}/main/trunk/binaries/linux/wv"/>
+						<arg value="compiled/bin/linux/wv"/>
+					</exec>
+				</else>
+			</if>
+
+			<!-- 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 and ghostscript binaries -->
+			<delete dir="compiled/bin/darwin/imagemagick"/>
+			<delete dir="compiled/bin/darwin/ghostscript"/>
+
+			<if><bool><equals arg1="${post.2.83.version}" arg2="true"/></bool>
+
+				<exec executable="svn">
+					<arg value="export"/>
+					<arg value="${svn.root}/main/${branch.path}/binaries/mac/intel/imagemagick"/>
+					<arg value="compiled/bin/darwin/imagemagick"/>
+				</exec>
+			  
+				<exec executable="svn">
+					<arg value="export"/>
+					<arg value="${svn.root}/main/${branch.path}/binaries/mac/intel/ghostscript"/>
+					<arg value="compiled/bin/darwin/ghostscript"/>
+				</exec>
+
+				<else>			    
+					<exec executable="svn">
+						<arg value="export"/>
+						<arg value="${svn.root}/main/trunk/binaries/mac/intel/imagemagick"/>
+						<arg value="compiled/bin/darwin/imagemagick"/>
+					</exec>
+			    
+					<exec executable="svn">
+						<arg value="export"/>
+						<arg value="${svn.root}/main/trunk/binaries/mac/intel/ghostscript"/>
+						<arg value="compiled/bin/darwin/ghostscript"/>
+					</exec>
+				</else>
+			</if>
+
+			<!-- 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>
+
 		<!-- build demo collection -->
 		<!-- the envs on these execs simulate the environment when you run setup.bat -->
@@ -309,135 +440,4 @@
 		</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,lib/**/*.a"/></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 and wv (if less than 2.84) binaries -->
-			<delete dir="compiled/bin/linux/imagemagick"/>
-
-			<if><bool><equals arg1="${post.2.83.version}" arg2="true"/></bool>
-			        <if><bool><equals arg1="${x64}" arg2="true"/></bool>
-					<exec executable="svn">
-					        <arg value="export"/>
-					        <arg value="${svn.root}/gs2-extensions/imagemagick/trunk/imagemagick-linux-x64.tar.gz"/>
-					        <arg value="compiled/ext/imagemagick-linux-x64.tar.gz"/>
-				        </exec>
-
-					<exec executable="tar" dir="compiled/ext">
-					        <arg value="xvzf"/>
-						<arg value="imagemagick-linux-x64.tar.gz"/>
-					</exec>
-					<delete file="compiled/ext/imagemagick-linux-x64.tar.gz"/>
-				<else>
-				        <exec executable="svn">
-					        <arg value="export"/>
-						<arg value="${svn.root}/main/${branch.path}/binaries/linux/imagemagick"/>
-						<arg value="compiled/bin/linux/imagemagick"/>
-					</exec>
-				</else>
-				</if>
-				<else>
-					<delete dir="compiled/bin/linux/wv"/>	
-					<exec executable="svn">
-						<arg value="export"/>
-						<arg value="${svn.root}/main/trunk/binaries/linux/imagemagick"/>
-						<arg value="compiled/bin/linux/imagemagick"/>
-					</exec>
-
-					<exec executable="svn">
-						<arg value="export"/>
-						<arg value="${svn.root}/main/trunk/binaries/linux/wv"/>
-						<arg value="compiled/bin/linux/wv"/>
-					</exec>
-				</else>
-			</if>
-
-			<!-- 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 and ghostscript binaries -->
-			<delete dir="compiled/bin/darwin/imagemagick"/>
-			<delete dir="compiled/bin/darwin/ghostscript"/>
-
-			<if><bool><equals arg1="${post.2.83.version}" arg2="true"/></bool>
-
-				<exec executable="svn">
-					<arg value="export"/>
-					<arg value="${svn.root}/main/${branch.path}/binaries/mac/intel/imagemagick"/>
-					<arg value="compiled/bin/darwin/imagemagick"/>
-				</exec>
-			  
-				<exec executable="svn">
-					<arg value="export"/>
-					<arg value="${svn.root}/main/${branch.path}/binaries/mac/intel/ghostscript"/>
-					<arg value="compiled/bin/darwin/ghostscript"/>
-				</exec>
-
-				<else>			    
-					<exec executable="svn">
-						<arg value="export"/>
-						<arg value="${svn.root}/main/trunk/binaries/mac/intel/imagemagick"/>
-						<arg value="compiled/bin/darwin/imagemagick"/>
-					</exec>
-			    
-					<exec executable="svn">
-						<arg value="export"/>
-						<arg value="${svn.root}/main/trunk/binaries/mac/intel/ghostscript"/>
-						<arg value="compiled/bin/darwin/ghostscript"/>
-					</exec>
-				</else>
-			</if>
-
-			<!-- 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" />
