Index: main/trunk/release-kits/kits/rk2/ant-scripts/build.xml
===================================================================
--- main/trunk/release-kits/kits/rk2/ant-scripts/build.xml	(revision 21649)
+++ main/trunk/release-kits/kits/rk2/ant-scripts/build.xml	(revision 21650)
@@ -10,9 +10,6 @@
 <project name="rk2-build" default="rk2">
 
-	<property name="version.major" value="2"/>
-
 	<!-- IMPORT OTHER ANT SCRIPTS -->
 	<import file="${rk.home}/shared/core/ant-scripts/shared.xml"/>
-	<import file="${rk.home}/shared/core/ant-scripts/operations-on-gli.xml"/>
 	<import file="${rk.home}/shared/greenstone2/ant-scripts/greenstone2-shared.xml"/>
 
Index: main/trunk/release-kits/kits/rk3/ant-scripts/build.xml
===================================================================
--- main/trunk/release-kits/kits/rk3/ant-scripts/build.xml	(revision 21649)
+++ main/trunk/release-kits/kits/rk3/ant-scripts/build.xml	(revision 21650)
@@ -14,5 +14,4 @@
 	<!-- IMPORT OTHER ANT SCRIPTS -->
 	<import file="${rk.home}/shared/core/ant-scripts/shared.xml"/>
-	<import file="${rk.home}/shared/core/ant-scripts/operations-on-gli.xml"/>
 	<import file="${rk.home}/shared/greenstone2/ant-scripts/greenstone3-shared.xml"/>
 
Index: main/trunk/release-kits/kits/sork2/ant-scripts/build.xml
===================================================================
--- main/trunk/release-kits/kits/sork2/ant-scripts/build.xml	(revision 21649)
+++ main/trunk/release-kits/kits/sork2/ant-scripts/build.xml	(revision 21650)
@@ -10,73 +10,57 @@
 <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="${rk.home}/shared/core/ant-scripts/shared.xml"/>
 	<import file="${rk.home}/shared/greenstone2/ant-scripts/greenstone2-shared.xml"/>
-	<import file="${rk.home}/shared/core/ant-scripts/operations-on-gli.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/>
+		<!-- store the name of the distribution -->
+		<property name="dist.name" value="${dist.name}"/>
 
-		<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>
+		<!-- create distributions dir -->
+		<mkdir dir="distributions"/>
 
+		<!-- export greenstone2 and gli -->
+		<exec executable="svn"><arg value="export"/><arg value="${svn.root}/main/${branch.path}/greenstone2"/><arg value="distributions/${dist.name}"/></exec>
+		<exec executable="svn"><arg value="export"/><arg value="${svn.root}/main/${branch.path}/gli"/><arg value="distributions/${dist.name}/gli"/></exec>
 
-	<target name="tweak-files">
-		<delete file="distributions/Greenstone-${version}-source-distribution/bin/linux/mgquery_old" />
-	</target>
+		<!-- set version numbers -->
+		<antcall target="gsdl-set-version-numbers"><param name="gsdl.basedir" value="${basedir}/distributions/${dist.name}"/></antcall>
+		<antcall target="gli-set-version-numbers"><param name="glibasedir" value="${basedir}/distributions/${dist.name}/gli"/></antcall>
 
-	<target name="insert-winbin">
-		<delete dir="distributions/Greenstone-${version}-source-distribution/bin/windows"/>
+		<!-- insert windows binaries -->
+		<delete dir="distributions/${dist.name}/bin/windows"/>
 		<exec executable="svn">
 			<arg value="export"/>
 			<arg value="${svn.root}/main/${branch.path}/binaries/windows/bin"/>
-			<arg value="distributions/Greenstone-${version}-source-distribution/bin/windows"/>
+			<arg value="distributions/${dist.name}/bin/windows"/>
 		</exec>
-		<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>
+		<get src="${server.exe.location}" dest="distributions/${dist.name}/bin/windows/server.exe"/>
+		<delete dir="distributions/${dist.name}/bin/windows/imagemagick"/>
+		<delete dir="distributions/${dist.name}/bin/windows/ghostscript"/>
 
-	<target name="create-archives">
+		<!-- insert windows perl -->
+		<unzip src="${rk.home}/shared/windows/perl.zip" dest="distributions/${dist.name}/bin/windows"/>
+
+		<!-- clean up -->
+		<delete file="distributions/${dist.name}/bin/linux/mgquery_old" />
+
+		<!-- create the archives (source code distribution) -->
 		<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/**/*"/>
+		<delete file="products/${dist.name}.zip"/>
+		<zip destfile="products/${dist.name}.zip"  basedir="distributions" includes="${dist.name}/**/*"/>
 		<exec dir="distributions" executable="tar">
-			<arg line="-czf ../products/Greenstone-${version}-source-distribution.tar.gz Greenstone-${version}-source-distribution"/>
+			<arg line="-czf ../products/${dist.name}.tar.gz ${dist.name}"/>
 		</exec>
-	</target>
 
-	<target name="create-sourcecode">
+		<!-- CREATE THE SOURCE CODE COMPONENT (SOURCE CODE TOP-UP TO THE BINARY RELEASE) -->
+
 		<!-- create a directory for the sourcecode -->
 		<mkdir dir="distributions/source-component"/>
 
 		<!-- copy the files in -->
-		<exec dir="distributions/Greenstone-${version}-source-distribution" executable="cp">
+		<exec dir="distributions/${dist.name}" executable="cp">
 			<arg value="-r"/>
 
@@ -136,20 +120,8 @@
 			<arg value="tar -czf ../../products/Greenstone-${version}-source-component.tar.gz *"/>
 		</exec>
+
 	</target>
 
-	<target name="export-gsdl-gli">
-		<delete dir="${dest}"/>
-		<exec executable="svn">
-			<arg value="export"/>
-			<arg value="${svn.root}/main/${branch.path}/greenstone2"/>
-			<arg value="${dest}"/>
-		</exec>
-		<exec executable="svn">
-			<arg value="export"/>
-			<arg value="${svn.root}/main/${branch.path}/gli"/>
-			<arg value="${dest}/gli"/>
-		</exec>
-	</target>
-
+	<target name="properties" depends="core-properties"/>
 
 </project>
Index: main/trunk/release-kits/kits/sork3/ant-scripts/build.xml
===================================================================
--- main/trunk/release-kits/kits/sork3/ant-scripts/build.xml	(revision 21649)
+++ main/trunk/release-kits/kits/sork3/ant-scripts/build.xml	(revision 21650)
@@ -20,131 +20,60 @@
 	<!-- IMPORT OTHER ANT SCRIPTS -->
 	<import file="${rk.home}/shared/core/ant-scripts/shared.xml"/>
-	<import file="${rk.home}/shared/core/ant-scripts/operations-on-gli.xml"/>
 	<import file="${rk.home}/shared/greenstone3/ant-scripts/greenstone3-shared.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">
+
+		<!-- store the name of the distribution -->
+		<property name="dist.name" value="Greenstone-${version}-source-distribution"/>
+
+		<!-- export the greenstone3 base code -->
+		<exec executable="svn"><arg value="export"/><arg value="${svn.root}/main/${branch.path}/greenstone3"/><arg value="distributions/${dist.name}"/></exec>
+
+		<!-- set version numbers -->
+		<antcall target="greenstone3-set-version-numbers"><param name="greenstone3basedir" value="${basedir}/distributions/${dist.name}"/></antcall>
+
+		<!-- run ant prepare -->
+		<ant dir="distributions/${dist.name}" 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}">
+
+		<!-- set gli version numbers -->
+		<antcall target="gli-set-version-numbers"><param name="glibasedir" value="${basedir}/distributions/${dist.name}/gli"/></antcall>
+
+		<!-- insert windows binaries -->
+		<delete dir="distributions/${dist.name}/gs2build/bin/windows"/>
+		<exec executable="svn"><arg value="export"/><arg value="${svn.root}/main/${branch.path}/binaries/windows/bin"/><arg value="distributions/${dist.name}/gs2build/bin/windows"/></exec>
+		<delete dir="distributions/${dist.name}/gs2build/bin/windows/imagemagick"/>
+		<delete dir="distributions/${dist.name}/gs2build/bin/windows/ghostscript"/>
+
+		<!-- insert windows perl -->
+		<unzip src="${rk.home}/shared/windows/perl.zip" dest="distributions/${dist.name}/gs2build/bin/windows"/>
+
+		<!-- clean up -->
+		<delete file="distributions/${dist.name}/gs2build/bin/linux/mgquery_old" />
+		<delete file="distributions/${dist.name}/build.properties.in"/>
+		<delete><fileset dir="distributions/${dist.name}/packages" includes="**/*.zip,**/*.tar.gz"/></delete>
+
+		<!-- run greenstone3's own targets for fixing execute permissions -->
+		<ant dir="distributions/${dist.name}">
 			<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"/>
+
+		<!-- create the archives -->
+		<mkdir dir="products"/>
+		<delete file="products/${dist.name}.zip"/>
+		<zip destfile="products/${dist.name}.zip"  basedir="distributions" includes="${dist.name}/**/*"/>
+		<exec dir="distributions" executable="tar">
+			<arg line="-czf ../products/${dist.name}.tar.gz ${dist.name}"/>
+		</exec>
+
+		<!-- create the sourcecode component -->
+		<ant dir="." antfile="${rk.home}/kits/${rk.name}/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"/>
-		<exec executable="svn">
-			<arg value="export"/>
-			<arg value="${svn.root}/main/${branch.path}/binaries/windows/bin"/>
-			<arg value="distributions/${dist.dirname}/gs2build/bin/windows"/>
-		</exec>
-		<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>
+	<target name="properties" depends="core-properties"/>
 
 </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 21649)
+++ main/trunk/release-kits/kits/sork3/ant-scripts/create-sourcecode-component.xml	(revision 21650)
@@ -1,14 +1,13 @@
 <?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>
+<project name="create-sourcecode-component">
 
-	<import file="${basedir}/distributions/${dist.dirname}/resources/xml/components.xml"/>
-	<import file="${basedir}/distributions/${dist.dirname}/resources/xml/executables.xml"/>
+	<import file="distributions/${dist.name}/resources/xml/components.xml"/>
+	<import file="distributions/${dist.name}/resources/xml/executables.xml"/>
 
 	<target name="create-sourcecode-component">
 
 		<copy todir="distributions/source-component">
-			<fileset dir="distributions/${dist.dirname}">
+			<fileset dir="distributions/${dist.name}">
 				<patternset refid="greenstone3.source.component"/>
 			</fileset>
