Index: /greenstone3/trunk/build.xml
===================================================================
--- /greenstone3/trunk/build.xml	(revision 15189)
+++ /greenstone3/trunk/build.xml	(revision 15190)
@@ -501,7 +501,116 @@
   </target>
 
+<target name="prepare-collections" depends="init">
+    <property name="collect.dir" value="${web.home}/sites/localsite/collect"/>
+<echo message="installing collections..."/>
+<antcall target="gs2mgdemo-install"/>
+<antcall target="gs2mgppdemo-install"/>
+<antcall target="gberg-install"/>
+
+</target>
+
+<target name="gs2mgdemo-prepare" if="collect.dir">
+ <property name="gs2mgdemo.dir" value="${collect.dir}/gs2mgdemo"/>
+ <property name="gs2mgdemo.import.zip" value="${gs2mgdemo.dir}/import.zip"/>
+  <property name="gs2mgdemo.metadata.zip" value="${gs2mgdemo.dir}/metadata.zip"/>
+  <property name="gs2mgdemo.index.zip" value="${gs2mgdemo.dir}/index.zip"/>
+
+<fileset id="gs2mgdemofiles" dir="${gs2mgdemo.dir}">
+	<include name="${gs2mgdemo.import.zip}"/>
+	<include name="${gs2mgdemo.metadata.zip}"/>
+	<include name="${gs2mgdemo.index.zip}"/>
+</fileset>
+
+<condition property="gs2mgdemo.present">
+    <and>
+	<available file="${gs2mgdemo.import.zip}"/>
+	<available file="${gs2mgdemo.metadata.zip}"/>
+        <available file="${gs2mgdemo.index.zip}"/>
+    </and>
+  </condition>
+</target>
+
+<target name="gs2mgdemo-install" if="gs2mgdemo.present"  depends="gs2mgdemo-prepare">
+<echo> installing gs2mgdemo</echo>
+<unzip dest="${gs2mgdemo.dir}">
+	<fileset refid="gs2mgdemofiles"/>
+</unzip>
+<delete>
+	<fileset refid="gs2mgdemofiles"/>
+</delete>
+<echo>collection gs2mgdemo installed</echo>
+</target>
+
+<target name="gs2mgppdemo-prepare" if="collect.dir">
+ <property name="gs2mgppdemo.dir" value="${collect.dir}/gs2mgppdemo"/>
+ <property name="gs2mgppdemo.import.zip" value="${gs2mgppdemo.dir}/import.zip"/>
+  <property name="gs2mgppdemo.metadata.zip" value="${gs2mgppdemo.dir}/metadata.zip"/>
+  <property name="gs2mgppdemo.index.zip" value="${gs2mgppdemo.dir}/index.zip"/>
+
+<fileset id="gs2mgppdemofiles" dir="${gs2mgppdemo.dir}">
+        <include name="${gs2mgppdemo.import.zip}"/>
+        <include name="${gs2mgppdemo.metadata.zip}"/>
+        <include name="${gs2mgppdemo.index.zip}"/>
+</fileset>
+
+<condition property="gs2mgppdemo.present">
+    <and>
+        <available file="${gs2mgppdemo.import.zip}"/>
+        <available file="${gs2mgppdemo.metadata.zip}"/>
+        <available file="${gs2mgppdemo.index.zip}"/>
+    </and>
+  </condition>
+</target>
+
+<target name="gs2mgppdemo-install" if="gs2mgppdemo.present" depends="gs2mgppdemo-prepare">
+<unzip dest="${gs2mgppdemo.dir}">
+        <fileset refid="gs2mgppdemofiles"/>
+</unzip>
+<delete>
+        <fileset refid="gs2mgppdemofiles"/>
+</delete>
+<echo>collection gs2mgppdemo installed</echo>
+</target>    
+
+<target name="gberg-prepare" if="collect.dir">
+ <property name="gberg.dir" value="${collect.dir}/gberg"/>
+ <property name="gberg.index.zip" value="${gberg.dir}/index.zip"/>
+
+<fileset id="gbergfiles" dir="${gberg.dir}">
+        <include name="${gberg.index.zip}"/>
+</fileset>
+<available file="${gberg.index.zip}" property="gberg.present"/>
+</target>
+
+<target name="gberg-install" if="gberg.present" depends="gberg-prepare">
+<unzip dest="${gberg.dir}">
+        <fileset refid="gbergfiles"/>
+</unzip>
+<delete>
+        <fileset refid="gbergfiles"/>
+</delete>
+<echo>collection gberg installed</echo>
+</target>
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+<!--
   <target name="prepare-collections" depends="init">
     <property name="collect.dir" value="${web.home}/sites/localsite/collect"/>
-    <!-- gs2mgdemo -->
+   
     <unzip src="${collect.dir}/gs2mgdemo/import.zip" 
       dest="${collect.dir}/gs2mgdemo"/>
@@ -513,5 +622,5 @@
     <delete file="${collect.dir}/gs2mgdemo/metadata.zip"/>
     <delete file="${collect.dir}/gs2mgdemo/index/index.zip"/>
-    <!-- gs2mgppdemo -->
+   
     <unzip src="${collect.dir}/gs2mgppdemo/import.zip" 
       dest="${collect.dir}/gs2mgppdemo"/>
@@ -523,10 +632,10 @@
     <delete file="${collect.dir}/gs2mgppdemo/metadata.zip"/>
     <delete file="${collect.dir}/gs2mgppdemo/index/index.zip"/>
-    <!-- gberg -->
+  
     <unzip src="${collect.dir}/gberg/index/index.zip" 
       dest="${collect.dir}/gberg/index"/>
     <delete file="${collect.dir}/gberg/index/index.zip"/>
   </target>
-
+-->
   
   <target name="configure-web" depends="init"
