Index: /release-kits/shared/greenstone2/ant-scripts/rk2-targets.xml
===================================================================
--- /release-kits/shared/greenstone2/ant-scripts/rk2-targets.xml	(revision 17383)
+++ /release-kits/shared/greenstone2/ant-scripts/rk2-targets.xml	(revision 17384)
@@ -15,30 +15,24 @@
 		<echo>Calculating the size of some components</echo>
 
-		<!-- core greenstone2 system (keep in sync with installer build.xml files) -->
-		<length property="component.bytesize.core" mode="all">
-			<fileset dir="${basedir}/distributions/web" includes="gli/**/*,bin/**/*,cgi-bin/**/*,etc/**/*,mappings/**/*,images/**/*,perllib/**/*,indexers/**/*,macros/**/*,collect/**/*"/>
-		</length>
+		<!-- core greenstone2 system -->
+		<length property="component.bytesize.core" mode="all"><fileset file="${basedir}/components/core.comp"/></length>
 		<math result="component.megabytesize.core" operand1="${component.bytesize.core}" operation="/" operand2="1048576" datatype="int"/>
 		<property name="component.size.core" value="${component.megabytesize.core} MB"/>
 
-		<!-- source code (keep in sync with installer build.xml files) -->
-		<length property="component.bytesize.sourcecode" mode="all">
-			<fileset dir="${basedir}/distributions/web" includes="common-src/**/*,runtime-src/**/*build-src/**/*,packages/**/*"/>
-		</length>
+		<!-- source code -->
+		<length property="component.bytesize.sourcecode" mode="all"><fileset file="${basedir}/components/sourcecode.comp"/></length>
 		<math result="component.megabytesize.sourcecode" operand1="${component.bytesize.sourcecode}" operation="/" operand2="1048576" datatype="int"/>
 		<property name="component.size.sourcecode" value="${component.megabytesize.sourcecode} MB"/>
-
-		<!-- show the calculated sizes -->
-		<echo>component.size.core: ${component.size.core}</echo>
-		<echo>component.size.sourcecode: ${component.size.sourcecode}</echo>
-		<if>
-			<bool><equals arg1="windows" arg2="${rk.os}"/></bool>
-			<echo>component.size.windows-java: ${component.size.windows-java}</echo>
-		<else><if>
-			<bool><equals arg1="linux" arg2="${rk.os}"/></bool>
-			<echo>component.size.linux-java: ${component.size.linux-java}</echo>
-			</if></else>
-		</if>
-
+		
+		<!-- imagemagick -->
+		<length property="component.bytesize.imagemagick" mode="all"><fileset file="${basedir}/components/imagemagick.comp"/></length>
+		<math result="component.megabytesize.imagemagick" operand1="${component.bytesize.imagemagick}" operation="/" operand2="1048576" datatype="int"/>
+		<property name="component.size.imagemagick" value="${component.megabytesize.imagemagick} MB"/>
+		
+		<!-- ghostscript -->
+		<length property="component.bytesize.ghostscript" mode="all"><fileset file="${basedir}/components/ghostscript.comp"/></length>
+		<math result="component.megabytesize.ghostscript" operand1="${component.bytesize.ghostscript}" operation="/" operand2="1048576" datatype="int"/>
+		<property name="component.size.ghostscript" value="${component.megabytesize.ghostscript} MB"/>
+		
 		<!-- put the concrete values of things in the config -->
 		<rsr file="${basedir}/installer/antinstall-config.xml">
@@ -48,4 +42,6 @@
 			<job pattern="@component.size.linux-java@" replacement="${component.size.linux-java}"/>
 			<job pattern="@component.size.windows-java@" replacement="${component.size.windows-java}"/>
+			<job pattern="@component.size.imagemagick@" replacement="${component.size.imagemagick}"/>
+			<job pattern="@component.size.ghostscript@" replacement="${component.size.ghostscript}"/>
 		</rsr>
 
@@ -53,4 +49,6 @@
 			<job pattern="@version@" replacement="${version}"/>
 			<job pattern="@java.min.version@" replacement="${java.min.version}"/>
+			<job pattern="@windows-java.extracted@" replacement="${windows-java.extracted}"/>
+			<job pattern="@linux-java.extracted@" replacement="${linux-java.extracted}"/>
 		</rsr>
 
@@ -60,27 +58,19 @@
 			<job pattern="@version@" replacement="${version}"/>
 			<job pattern="@java.min.version@" replacement="${java.min.version}"/>
+			<job pattern="@bundled.version.windows-java@" replacement="${bundled.version.windows-java}"/>
+			<job pattern="@bundled.version.linux-java@" replacement="${bundled.version.linux-java}"/>
+			<job pattern="@bundled.version.ghostscript@" replacement="${bundled.version.ghostscript}"/>
+			<job pattern="@bundled.version.imagemagick@" replacement="${bundled.version.imagemagick}"/>
 		</rsr>
+
 		<!-- chinese -->
 		<rsr file="${basedir}/installer/classes/resources/LanguagePack_zh_CN.properties">
 			<job pattern="@version@" replacement="${version}"/>
 			<job pattern="@java.min.version@" replacement="${java.min.version}"/>
+			<job pattern="@bundled.version.windows-java@" replacement="${bundled.version.windows-java}"/>
+			<job pattern="@bundled.version.linux-java@" replacement="${bundled.version.linux-java}"/>
+			<job pattern="@bundled.version.ghostscript@" replacement="${bundled.version.ghostscript}"/>
+			<job pattern="@bundled.version.imagemagick@" replacement="${bundled.version.imagemagick}"/>
 		</rsr>
-
-		<!-- os specific replacements -->
-		<if>
-			<bool><equals arg1="windows" arg2="${rk.os}"/></bool>
-			<rsr file="${basedir}/installer/classes/resources/LanguagePack.properties" pattern="@bundled.version.java@" replacement="${bundled.version.windows-java}"/>
-			<rsr file="${basedir}/installer/classes/resources/LanguagePack_zh_CN.properties" pattern="@bundled.version.java@" replacement="${bundled.version.windows-java}"/>
-			<rsr file="${basedir}/installer/build.xml" pattern="@java.extracted@" replacement="${windows-java.extracted}"/>
-
-		<else><if>
-			<bool><equals arg1="linux" arg2="${rk.os}"/></bool>
-			<rsr file="${basedir}/installer/classes/resources/LanguagePack.properties" pattern="@bundled.version.java@" replacement="${bundled.version.linux-java}"/>
-			<rsr file="${basedir}/installer/classes/resources/LanguagePack_zh_CN.properties" pattern="@bundled.version.java@" replacement="${bundled.version.linux-java}"/>
-			<rsr file="${basedir}/installer/build.xml" pattern="@java.extracted@" replacement="${linux-java.extracted}"/>
-
-			</if></else>
-
-		</if>
 
 	</target>
