Index: /release-kits/lirk2/ant-scripts/build.xml
===================================================================
--- /release-kits/lirk2/ant-scripts/build.xml	(revision 19591)
+++ /release-kits/lirk2/ant-scripts/build.xml	(revision 19592)
@@ -30,4 +30,5 @@
 	<import file="create-installer.xml"/>
 	<import file="wrap.xml"/>
+	<import file="create-cdrom-components.xml"/>
 
 	<!-- THE MAIN TARGET -->
@@ -38,4 +39,5 @@
 		<antcall target="create-installer"/>
 		<antcall target="wrap"/>
+		<antcall target="create-cdrom-components"/>
 	</target>
 
Index: /release-kits/lirk2/ant-scripts/create-cdrom-components.xml
===================================================================
--- /release-kits/lirk2/ant-scripts/create-cdrom-components.xml	(revision 19592)
+++ /release-kits/lirk2/ant-scripts/create-cdrom-components.xml	(revision 19592)
@@ -0,0 +1,85 @@
+<project name="lirk2-create-cdrom-components">
+
+	<!--
+		cd components
+		produce components for cdrom distributions, to be picked up and used by cdrk2 release kit
+		split components into linux only files (linux) and general files (all)
+	-->
+
+	<target name="create-cdrom-components">
+		<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">
+		<delete dir="cdrom"/>
+		<mkdir dir="cdrom/build"/>
+		<mkdir dir="cdrom/dist/Software"/>
+		<mkdir dir="cdrom/dist/Java/Linux"/>
+		<mkdir dir="cdrom/dist/Java/Jars"/>
+
+		<!-- core -->
+		<mkdir dir="cdrom/dist/Software/core/all"/>
+		<mkdir dir="cdrom/dist/Software/core/linux"/>
+		<copy todir="cdrom/dist/Software/core/all" overwrite="true">
+			<fileset dir="components/tmp/core"/>
+		</copy>
+		<move todir="cdrom/dist/Software/core/linux" overwrite="true">
+			<fileset dir="cdrom/dist/Software/core/all">
+				<include name="bin/linux"/>
+				<include name="bin/linux/**/*"/>
+				<include name="bin/windows"/>
+				<include name="bin/windows/**/*"/>
+				<include name="apache-httpd/"/>
+				<include name="apache-httpd/**/*"/>
+				<include name="*.sh"/>
+				<include name="*.csh"/>
+				<include name="*.bash"/>
+			</fileset>
+		</move>
+
+		<!-- imagemagick (completely linux specific) -->
+		<mkdir dir="cdrom/dist/Software/imagemagick/linux"/>
+		<copy todir="cdrom/dist/Software/imagemagick/linux" overwrite="true">
+			<fileset dir="components/tmp/imagemagick"/>
+		</copy>
+
+		<!-- jre -->
+		<exec dir="cdrom/dist/Java/Linux" executable="${lirk2.home}/linux/jre_bin"/>
+		<exec dir="cdrom/dist/Java/Linux" executable="tar"><arg value="-xf"/><arg value="jre.tar"/></exec>
+		<delete file="cdrom/dist/Java/Linux/jre.tar"/>
+
+		<!-- jar installer -->
+		<copy file="installer/cdrom.jar" tofile="cdrom/dist/Java/Jars/linux.jar"/>
+
+		
+	</target>
+
+	<target name="compile-cdrom-wrapper">
+		<copy file="${rk.home}/linux/cdrom-wrapper.cpp" todir="cdrom/build"/>
+
+		<echo level="info">compile the cdrom wrapper</echo>
+		<exec executable="g++" dir="cdrom/build">
+			<arg line="-Wall -static -static-libgcc -c -o cdrom-wrapper.o cdrom-wrapper.cpp"/>
+		</exec>
+
+		<echo level="info">link the compiled code</echo>
+		<exec executable="g++" dir="cdrom/build">
+			<arg line="-static -static-libgcc -o ../dist/Greenstone-${version}-linux cdrom-wrapper.o"/>
+		</exec>
+
+	</target>
+
+	<target name="create-cdrom-components-archive">
+		<mkdir dir="products"/>
+		<exec dir="cdrom/dist" executable="bash">
+			<arg value="-c"/>
+			<arg value="tar -czf ../../products/cdrom-components-${version}-linux.tar.gz *"/>
+		</exec>
+	</target>
+
+
+
+</project>
Index: /release-kits/lirk2/ant-scripts/create-components.xml
===================================================================
--- /release-kits/lirk2/ant-scripts/create-components.xml	(revision 19591)
+++ /release-kits/lirk2/ant-scripts/create-components.xml	(revision 19592)
@@ -8,5 +8,4 @@
 		<antcall target="prepare-components" />
 		<antcall target="compress-components" />
-		<antcall target="produce-cd-components"/>
 	</target>
 
@@ -66,40 +65,3 @@
 	</target>
 
-	<!--
-		cd components
-		produce components for cdrom distributions, to be picked up and used by cdrk2 release kit
-		split components into linux only files (linux) and general files (all)
-	-->
-	<target name="produce-cd-components">
-		<delete dir="components/tmp/cdrom"/>
-		<mkdir dir="components/tmp/cdrom"/>
-
-		<!-- core -->
-		<mkdir dir="components/tmp/cdrom/core/all"/>
-		<mkdir dir="components/tmp/cdrom/core/linux"/>
-		<copy todir="components/tmp/cdrom/core/all" overwrite="true">
-			<fileset dir="components/tmp/core"/>
-		</copy>
-		<move todir="components/tmp/cdrom/core/linux" overwrite="true">
-			<fileset dir="components/tmp/cdrom/core/all">
-				<include name="bin/linux"/>
-				<include name="bin/linux/**/*"/>
-				<include name="bin/windows"/>
-				<include name="bin/windows/**/*"/>
-				<include name="apache-httpd/linux"/>
-				<include name="apache-httpd/linux/**/*"/>
-				<include name="*.sh"/>
-				<include name="*.csh"/>
-				<include name="*.bash"/>
-			</fileset>
-		</move>
-
-		<!-- imagemagick (completely linux specific) -->
-		<mkdir dir="components/tmp/cdrom/imagemagick/linux"/>
-		<copy todir="components/tmp/cdrom/imagemagick/linux" overwrite="true">
-			<fileset dir="components/tmp/imagemagick"/>
-		</copy>
-		
-	</target>
-
 </project>
Index: /release-kits/lirk2/ant-scripts/create-installer.xml
===================================================================
--- /release-kits/lirk2/ant-scripts/create-installer.xml	(revision 19591)
+++ /release-kits/lirk2/ant-scripts/create-installer.xml	(revision 19592)
@@ -6,5 +6,4 @@
 		<antcall target="make-installer-files-concrete"><param name="java.os" value="linux"/></antcall> <!-- from init -->
 		<antcall target="compile-binary-installer"/> <!-- from init -->
-		<antcall target="compile-cdrom-installer"/> <!-- from init -->
 	</target>
 
Index: /release-kits/lirk2/ant-scripts/wrap.xml
===================================================================
--- /release-kits/lirk2/ant-scripts/wrap.xml	(revision 19591)
+++ /release-kits/lirk2/ant-scripts/wrap.xml	(revision 19592)
@@ -6,6 +6,4 @@
 		<antcall target="create-objects"/>
 		<antcall target="compile-wrapper-web"/>
-		<antcall target="compile-wrapper-cdrom"/>
-		<antcall target="archive-cdrom-components-and-installer"/>
 	</target>
 
@@ -34,11 +32,7 @@
 
 		<echo level="info">create an object file (extension .o) for each file to bundle</echo>
-		<!-- jar (web) -->
+		<!-- jar -->
 		<exec executable="/usr/bin/objcopy" dir="${basedir}/wrapped-installer">
 			<arg line="-I binary -O elf32-i386 -B i386 --redefine-sym _binary_greenstone2_jar_start=greenstone2jar --readonly-text greenstone2.jar greenstone2.jar.o"/>
-		</exec>
-		<!-- jar (cdrom) -->
-		<exec executable="/usr/bin/objcopy" dir="installer">
-			<arg line="-I binary -O elf32-i386 -B i386 --redefine-sym _binary_cdrom_jar_start=greenstone2jar --readonly-text cdrom.jar ../wrapped-installer/cdrom.jar.o"/>
 		</exec>
 		<!-- java -->
@@ -60,8 +54,4 @@
 		<exec executable="ls" dir="wrapped-installer" outputproperty="greenstone2.jar.ls"><arg line="-l greenstone2.jar"/></exec>
 		<exec executable="sed" inputstring="${greenstone2.jar.ls}" outputproperty="greenstone2.jar.size"><arg line="-e 's/^[^\ ]*\ *[^\ ]*\ *[^\ ]*\ *[^\ ]*\ *\([0-9]*\).*$/\1/g'"/></exec>
-
-		<!-- jar(cdrom) -->
-		<exec executable="ls" dir="installer" outputproperty="cdrom.jar.ls"><arg line="-l cdrom.jar"/></exec>
-		<exec executable="sed" inputstring="${cdrom.jar.ls}" outputproperty="cdrom.jar.size"><arg line="-e 's/^[^\ ]*\ *[^\ ]*\ *[^\ ]*\ *[^\ ]*\ *\([0-9]*\).*$/\1/g'"/></exec>
 
 		<!-- java -->
@@ -91,30 +81,3 @@
 	</target>
 
-	<target name="compile-wrapper-cdrom" depends="calculate-object-sizes">
-		<echo level="info">creating wrapper header file</echo>
-		<delete file="wrapper.h"/>
-		<exec executable="echo" output="${basedir}/wrapped-installer/wrapper.h"><arg line="extern const char greenstone2jar[${cdrom.jar.size}];"/></exec>
-		<exec executable="echo" output="${basedir}/wrapped-installer/wrapper.h" append="true"><arg line="extern const char java[${java.size}];"/></exec>
-		<exec executable="echo" output="${basedir}/wrapped-installer/wrapper.h" append="true"><arg line="#define java_is_bundled yes"/></exec>
-
-		<echo level="info">compile the wrapper program</echo>
-		<exec executable="g++" dir="wrapped-installer">
-			<arg line="-Wall -static -static-libgcc -c -o wrapper.o wrapper.cpp"/>
-		</exec>
-
-		<echo level="info">link the compiled code and bundled files</echo>
-		<exec executable="g++" dir="${basedir}/wrapped-installer">
-			<arg line="-static -static-libgcc -o ../wrapped-installer/cdrom-linux wrapper.o libsearch4j.o cdrom.jar.o java.o"/>
-		</exec>
-
-	</target>
-
-	<target name="archive-cdrom-components-and-installer">
-		<mkdir dir="products"/>
-		<tar destfile="products/cdrom-components-${version}-linux.tar.gz" compression="gzip">
-			<tarfileset dir="components/tmp"><include name="cdrom/**/*"/></tarfileset>
-			<tarfileset dir="wrapped-installer"><include name="cdrom-linux"/></tarfileset>
-		</tar>
-	</target>
-
 </project>
Index: /release-kits/mark2/ant-scripts/build.xml
===================================================================
--- /release-kits/mark2/ant-scripts/build.xml	(revision 19591)
+++ /release-kits/mark2/ant-scripts/build.xml	(revision 19592)
@@ -32,4 +32,5 @@
 	<import file="create-installer.xml"/>
 	<import file="wrap.xml"/>
+	<import file="create-cdrom-components.xml"/>
 
 	<!-- TARGET TO PERFORM ADDITIONAL PRECONDITION CHECKS -->
@@ -57,4 +58,5 @@
 		<antcall target="create-installer"/>
 		<antcall target="wrap"/>
+		<antcall target="create-cdrom-components"/>
 	</target>
 
Index: /release-kits/mark2/ant-scripts/create-cdrom-components.xml
===================================================================
--- /release-kits/mark2/ant-scripts/create-cdrom-components.xml	(revision 19592)
+++ /release-kits/mark2/ant-scripts/create-cdrom-components.xml	(revision 19592)
@@ -0,0 +1,52 @@
+<project name="mark2-create-cdrom-components">
+
+	<!--
+		cd components
+		produce components for cdrom distributions, to be picked up and used by cdrk2 release kit
+		only include files that aren't for all operating systems, as those files are taken care of by lirk2
+	-->
+
+	<target name="create-cdrom-components">
+		<antcall target="compile-cdrom-installer"/> <!-- from init -->
+		<antcall target="prepare-cdrom-components"/>
+	</target>
+
+	<target name="prepare-cdrom-components">
+
+		<delete dir="cdrom"/>
+		<mkdir dir="cdrom/build"/>
+		<mkdir dir="cdrom/dist/Software"/>
+		<mkdir dir="cdrom/dist/Java/Mac"/>
+		<mkdir dir="cdrom/dist/Java/Jars"/>
+
+		<!-- core -->
+		<mkdir dir="cdrom/dist/Software/core/mac"/>
+		<copy todir="components/tmp/cdrom/Software/core/mac" overwrite="true">
+			<fileset dir="components/tmp/core">
+				<include name="bin/darwin"/>
+				<include name="bin/darwin/**/*"/>
+				<include name="bin/windows"/>
+				<include name="bin/windows/**/*"/>
+				<include name="apache-httpd"/>
+				<include name="apache-httpd/**/*"/>
+				<include name="*.sh"/>
+				<include name="*.csh"/>
+				<include name="*.bash"/>
+			</fileset>
+		</copy>
+
+		<!-- imagemagick -->
+		<mkdir dir="cdrom/dist/Software/imagemagick/mac"/>
+		<copy todir="cdrom/dist/Software/imagemagick/mac" overwrite="true">
+			<fileset dir="components/tmp/imagemagick"/>
+		</copy>
+
+		<!-- ghostscript -->
+		<mkdir dir="cdrom/dist/Software/ghostscript/mac"/>
+		<copy todir="cdrom/dist/Software/ghostscript/mac" overwrite="true">
+			<fileset dir="components/tmp/ghostscript"/>
+		</copy>
+		
+	</target>
+
+</project>
Index: /release-kits/mark2/ant-scripts/create-components.xml
===================================================================
--- /release-kits/mark2/ant-scripts/create-components.xml	(revision 19591)
+++ /release-kits/mark2/ant-scripts/create-components.xml	(revision 19592)
@@ -8,5 +8,4 @@
 		<antcall target="prepare-components" />
 		<antcall target="compress-components" />
-		<antcall target="produce-cd-components"/>
 	</target>
 
@@ -98,47 +97,3 @@
 	</target>
 
-	<!--
-		cd components
-		produce components for cdrom distributions, to be picked up and used by cdrk2 release kit
-		split components into mac only files (mac) and general files (all)
-	-->
-	<target name="produce-cd-components">
-		<delete dir="components/tmp/cdrom"/>
-		<mkdir dir="components/tmp/cdrom"/>
-
-		<!-- core -->
-		<mkdir dir="components/tmp/cdrom/core/all"/>
-		<mkdir dir="components/tmp/cdrom/core/mac"/>
-		<copy todir="components/tmp/cdrom/core/all" overwrite="true">
-			<fileset dir="components/tmp/core"/>
-		</copy>
-		<move todir="components/tmp/cdrom/core/mac" overwrite="true">
-			<fileset dir="components/tmp/cdrom/core/all">
-				<include name="bin/darwin"/>
-				<include name="bin/darwin/**/*"/>
-				<include name="bin/windows"/>
-				<include name="bin/windows/**/*"/>
-				<include name="apache-httpd/darwin"/>
-				<include name="apache-httpd/darwin/**/*"/>
-				<include name="*.sh"/>
-				<include name="*.csh"/>
-				<include name="*.bash"/>
-			</fileset>
-		</move>
-
-		<!-- imagemagick (completely mac specific) -->
-		<mkdir dir="components/tmp/cdrom/imagemagick/mac"/>
-		<copy todir="components/tmp/cdrom/imagemagick/mac" overwrite="true">
-			<fileset dir="components/tmp/imagemagick"/>
-		</copy>
-
-		<!-- ghostscript (completely mac specific) -->
-		<mkdir dir="components/tmp/cdrom/ghostscript/mac"/>
-		<copy todir="components/tmp/cdrom/ghostscript/mac" overwrite="true">
-			<fileset dir="components/tmp/ghostscript"/>
-		</copy>
-		
-	</target>
-
-
 </project>
Index: /release-kits/mark2/ant-scripts/create-installer.xml
===================================================================
--- /release-kits/mark2/ant-scripts/create-installer.xml	(revision 19591)
+++ /release-kits/mark2/ant-scripts/create-installer.xml	(revision 19592)
@@ -6,5 +6,4 @@
 		<antcall target="make-installer-files-concrete"/>  <!-- from init -->
 		<antcall target="compile-binary-installer"/> <!-- from init -->
-		<antcall target="compile-cdrom-installer"/> <!-- from init -->
 	</target>
 
Index: /release-kits/shared/linux/cdrom-wrapper.cpp
===================================================================
--- /release-kits/shared/linux/cdrom-wrapper.cpp	(revision 19592)
+++ /release-kits/shared/linux/cdrom-wrapper.cpp	(revision 19592)
@@ -0,0 +1,5 @@
+#include <cstdlib>
+
+int main(int argc, char** argv) {
+	system( "Java/Linux/jre/bin/java -jar Java/Jars/linux.jar" );
+}
