Index: main/trunk/release-kits/kits/cdrk2/ant-scripts/build.xml
===================================================================
--- main/trunk/release-kits/kits/cdrk2/ant-scripts/build.xml	(revision 21649)
+++ main/trunk/release-kits/kits/cdrk2/ant-scripts/build.xml	(revision 21651)
@@ -10,12 +10,4 @@
 <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="${rk.home}/shared/core/ant-scripts/shared.xml"/>
@@ -23,42 +15,27 @@
 
 	<!-- 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">
+	<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"/>
+
+
+	<!-- THE MAIN TARGET -->
+	<target name="cdrk2" depends="init">
+
+		<!-- show the properties we're using -->
 		<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">
+
+		<!-- create a directory for the cdrom contents -->
+		<mkdir dir="cdrom"/>
+
+		<!-- checkout and compile documentation java/fop code -->
 		<exec executable="svn">
 			<arg value="export"/>
@@ -70,8 +47,5 @@
 		</javac>
 
-	</target>
-
-	<target name="build-tutorials">
-
+		<!-- checkout tutorials and build them -->
 		<exec executable="svn"><arg value="checkout"/><arg value="${svn.root}/documentation/${branch.path}/tutorials"/><arg value="documentation/tutorials"/></exec>
 		<exec executable="svn"><arg value="checkout"/><arg value="${svn.root}/main/${branch.path}/gli"/><arg value="documentation/gli"/></exec>
@@ -79,5 +53,4 @@
 		<exec executable="svn"><arg value="checkout"/><arg value="${svn.root}/main/${branch.path}/greenstone2/macros"/><arg value="documentation/macros"/></exec>
 		<exec executable="svn"><arg value="checkout"/><arg value="${svn.root}/documentation/${branch.path}/tutorial_sample_files"/><arg value="documentation/tutorial_sample_files"/></exec>
-
 		<delete dir="documentation/tutorials/html"/>
 		<exec dir="documentation/tutorials" executable="/bin/bash">
@@ -85,9 +58,8 @@
 			<env key="GSDLHOME" value="${basedir}/documentation"/>
 		</exec>
-
 		<delete dir="cdrom/Tutorial Exercises"/>
 		<mkdir dir="cdrom/Tutorial Exercises/sample_files"/>
 
-		<!-- tutorial html -->
+		<!-- copy tutorial html into place on the cd -->
 		<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>
@@ -95,5 +67,5 @@
 		<copy todir="cdrom/Tutorial Exercises/Russian"><fileset dir="documentation/tutorials/html/ru"/></copy>
 
-		<!-- sample files -->
+		<!-- create tutorial sample files zips in place on the cdrom -->
 		<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"/>
@@ -109,8 +81,5 @@
 		<zip destfile="cdrom/Tutorial Exercises/sample_files/Word_and_PDF.zip" basedir="documentation/tutorial_sample_files/Word_and_PDF"/>
 
-	</target>
-
-	<target name="build-documentation">
-		
+		<!-- checkout manuals ad build them -->
 		<exec executable="svn"><arg value="checkout"/><arg value="${svn.root}/documentation/${branch.path}/manuals"/><arg value="documentation/manuals"/></exec>
 		<exec executable="svn"><arg value="checkout"/><arg value="${svn.root}/documentation/${branch.path}/shared"/><arg value="documentation/shared"/></exec>
@@ -138,4 +107,5 @@
 		</exec>
 
+		<!-- put manuals in place on cdrom -->
 		<delete dir="cdrom/Documentation"/>
 		<copy todir="cdrom/Documentation/English"><fileset dir="documentation/manuals/build/en/pdf"/></copy>
@@ -145,5 +115,5 @@
 		<copy todir="cdrom/Documentation/Arabic"><fileset dir="documentation/manuals/build/ar/pdf"/></copy>
 
-		<!-- top it off with a few more -->
+		<!-- top off manuals with a few more from the web -->
 		<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"/>
@@ -165,24 +135,10 @@
 		<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 -->
+		<!-- insert the documented examples onto cdrom -->
 		<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">
+			<fileset dir="${rk.home}/kits/${rk.name}/resources">
 				<include name="Documented Examples/**/*"/>
 				<include name="Documented Examples"/>
@@ -190,7 +146,68 @@
 		</copy>
 		<exec executable="tar" dir="cdrom/Documented Examples"><arg value="-xzf"/><arg value="../../archives/documented-examples.tar.gz"/></exec>
+
+		<!-- 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>
+
+		<!-- insert linux software -->
+		<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>
+
+		<!-- insert windows software -->
+		<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>
+
+		<!-- insert mac software -->
+		<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>
+
+		<!-- create autorun (windows) -->
+		<exec executable="cp">
+			<arg value="${rk.home}/kits/${rk.name}/resources/AUTORUN.INF"/>
+			<arg value="cdrom"/>
+		</exec>
+
+		<!-- finally create the cdrom 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>
 
-
+	<target name="properties" depends="core-properties">
+		<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 to generate the manual chapter about gli in a given language -->
 	<target name="generate-gli-chapter">
 		<path id="documentation.compile.classpath">
@@ -211,71 +228,3 @@
 	</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>
