Index: /greenstone3/trunk/build.xml
===================================================================
--- /greenstone3/trunk/build.xml	(revision 19877)
+++ /greenstone3/trunk/build.xml	(revision 19878)
@@ -61,8 +61,6 @@
   <property name="gs2build.home" value="${basedir}/gs2build"/>
   <property name="src.packages.home" value="${basedir}/src/packages"/>
-  <!-- get rid of one of these -->
- <!-- <property name="gdbm.home" value="${gs2build.home}/common-src/packages/gdbm"/>
-  <property name="gdbm.installed.path" value="${gs2build.home}/common-src/packages/gdbm"/>  -->
   <property name="flax.svn.root" value="http://svn.greenstone.org/flax"/>
+
   <property file="build.properties"/>
   <if><bool><available file="${user.home}/build.properties"/></bool>
@@ -78,5 +76,4 @@
   <property name="axis.zip.version" value="axis-bin-1_2_1.zip"/>
   <property name="axis.dir.version" value="axis-1_2_1"/>
-<!--  <property name="gdbm.version" value="gdbm-1.8.3"/>-->
   <property name="sqlite.targz.version" value="sqlite-amalgamation-3.5.9.tar.gz"/>
 
@@ -98,4 +95,6 @@
   <!-- jni libraries and java wrappers go here -->
   <property name="lib.jni" value="${basedir}/lib/jni"/>
+
+  <!-- other jar files needed for installation (but not runtime) go here -->
   <property name="lib.java" value="${basedir}/lib/java"/>
   
@@ -115,6 +114,5 @@
   <property name="svn.root" value="http://svn.greenstone.org"/>
 
-  <!--  <property name="cvs.root" value=":pserver:cvs_anon@cvs.scms.waikato.ac.nz:2402/usr/local/global-cvs/gsdl-src"/> -->
-  <!-- catalina home is set to tomcat basedir is already installed, otherwise
+  <!-- catalina home is set to tomcat basedir if already installed, otherwise
   use greenstone's tomcat -->
   <condition property="catalina.home" value="${tomcat.installed.path}"> 
@@ -126,4 +124,5 @@
     </and>
   </condition>
+  
   <property name="catalina.home" value="${packages.home}/tomcat"/>
 
@@ -143,8 +142,9 @@
       <os family="unix"/>
       <not>
-  <os family="mac"/>
+	<os family="mac"/>
       </not>
     </and>
   </condition>
+  
   <condition property="current.os.ismac">
     <os family="mac"/>
@@ -153,4 +153,8 @@
   <condition property="current.os.iswindows">
     <os family="windows"/>
+  </condition>
+
+  <condition property="collection.building.disabled">
+    <isset property="disable.collection.building"/>
   </condition>
 
@@ -160,8 +164,5 @@
     </not>
   </condition>
-  <condition property="collection.building.disabled">
-    <isset property="disable.collection.building"/>
-  </condition>
-
+  
   <condition property="collection.building.enabled.windows">
     <and>
@@ -178,8 +179,4 @@
   </condition>
   
-<!--  <condition property="independent-indexers">
-    <isset property="disable.collection.building"/>
-  </condition>-->
-
   <!-- where is search4j tool -->
   <condition property="search4j.exec" value="bin/search4j.exe"> 
@@ -190,5 +187,4 @@
   
   <!-- ============= Base dirs for each package and component ============ -->
-<!--  <property name="src.applet.home" value="${src.home}/org/greenstone/applet"/>-->
   <property name="src.gsdl3.home" value="${src.home}/org/greenstone/gsdl3"/>
   <property name="anttasks.home" value="${src.home}/org/greenstone/anttasks"/>
@@ -196,14 +192,4 @@
   <property name="javagdbm.home" value="${src.packages.home}/javagdbm"/>
   
-<!--  <condition property="indexers.home" value="${basedir}/src/packages/indexers">
-    <isset property="disable.collection.building"/>
-  </condition>-->
-  
-<!--  <condition property="indexers.home" value="${gs2build.home}/common-src/indexers">
-    <not>
-      <isset property="disable.collection.building"/>
-    </not>
-  </condition>-->
-
   <condition property="common.src.home" value="${gs2build.home}/common-src">
     <not>
@@ -267,8 +253,4 @@
       <include name="*.jar"/>
     </fileset>
-    <!-- Include the axis jar files -->
-    <!--<fileset dir="${basedir}/comms/soap/axis/lib">
-      <include name="*.jar"/>
-    </fileset>-->
     
     <!-- include the jar files from the source packages -->
@@ -317,7 +299,7 @@
     <echo>os.unix: ${os.unix}</echo>
   </target>
+
+
   <!-- ==================== Primary and Global Targets ============================= -->
-
-  <!-- add comments about using xxx-core, xxx-packages if only want certain parts?? -->
 
   <target name="prepare" depends="accept-properties,init,prepare-core,prepare-packages,prepare-common-src,prepare-collection-building,prepare-tomcat,prepare-axis,prepare-web,prepare-collections, prepare-flax"
@@ -332,36 +314,30 @@
 
   <!-- install-common-src and install-collection-building are mutually exclusive and either one or the other will be done depending on whether collection building is enabled or not -->
-  <target name="new-install" depends="init,install-common-src,install-collection-building,install-runtime"
+  <target name="install" depends="init,install-common-src,install-collection-building,install-runtime"
     description="Install Greenstone 3. Use this when you first checkout the code: 'ant prepare new-install'."/>
 
-  <target name="install-common-src" depends="init,configure-common-src,compile-common-src,install-auxiliary-jar-files,install-jni-files"/>
-  <target name="install-collection-building" depends="init,configure-collection-building,compile-collection-building,install-auxiliary-jar-files,install-jni-files"/>
-  <target name="install-runtime" depends="init,configure,configure-packages,configure-core,compile-web,compile-packages,compile-core"/>
-  
-   
-<!--  <target name="install" depends="init,install-indexer-files,configure,configure-c++,compile" -->
-  <target name="install" depends="init,configure,configure-c++,compile" 
-    description="Install Greenstone 3. Use this when you first checkout the code: 'ant prepare install'."/>
-  
-  <target name="svnupdate" depends="init,svnupdate-packages,svnupdate-core,svnupdate-collection-building,svnupdate-web"
+  <target name="install-common-src" depends="init,configure-common-src,compile-common-src,install-auxiliary-jar-files,install-jni-files"
+    description="Install (configure, compile, install) only the common-src package (shared code from Greenstone 2. This is only needed when not installing the collection building package." />
+
+  <target name="install-collection-building" depends="init,configure-collection-building,compile-collection-building,install-auxiliary-jar-files,install-jni-files"
+    description="Install (configure, compile, install) the Greenstone 2 collection building package." />
+
+  <target name="install-runtime" depends="init,configure,configure-packages,configure-core,compile-web,compile-packages,compile-core"
+    description="Install (configure, compile, install) the runtime system. Needs either common-src or collection-building to have been installed first." />
+    
+  <target name="svnupdate" depends="init,svnupdate-packages,svnupdate-core,svnupdate-common-src,svnupdate-collection-building,svnupdate-web"
     description="Do a `svn update` for all sources. Doesn't recompile the code. You need to be online to run this."/>
-
-  <target name="configure-c++" depends="init,configure-packages,configure-core,configure-collection-building"
-    description="Configure any C/C+/+ package code and collection-building code if necessary"/>
   
   <target name="configure" depends="init,configure-tomcat,configure-web"
-    description="Configure the installation. Includes setting up config files. Should be re-run if you change the build.properties file."/>
-
-  <target name="clean" depends="init,clean-packages,clean-core,clean-collection-building"
-    description="Remove all old compiled code. Includes core, packages and collection-building if necessary"/>
-  
-  <target name="distclean" depends="init,distclean-packages,clean-core,distclean-collection-building"
-    description="Remove all compiled code and also any Makefiles etc generated during configure-c++. Includes core, packages, collection-building as necessary"/>
-  
-  <target name="compile" depends="init,compile-web,compile-packages,compile-core,compile-collection-building"
-    description="Compile all the source code, includes core, packages and collection-building if necessary. Copy jar files and executables to their correct places."/>
-  
-  <target name="update" depends="init,svnupdate,clean,configure,configure-c++,compile" 
-    description="Update (thru Subversion) all the source (including core, packages and collection-building), then clean, configure and recompile. To do this without any SVN updates, run it like 'ant -Dnosvn.mode=yes update'"/>
+    description="Configure the installation (not the C++ code). Includes setting up config files. Should be re-run if you change the build.properties file."/>
+
+  <target name="clean" depends="init,clean-packages,clean-core,clean-common-src,clean-collection-building"
+    description="Remove all old compiled code. Includes runtime and collection-building if necessary"/>
+  
+  <target name="distclean" depends="init,distclean-packages,clean-core,distclean-common-src,distclean-collection-building"
+    description="Remove all compiled code and also any Makefiles etc generated during configure-c++. Includes runtime and collection-building as necessary"/>
+  
+  <target name="update" depends="init,svnupdate,clean,install"
+    description="Update (thru Subversion) all the source (including common-src or collection-building, and runtime), then clean, and re-install. To do this without any SVN updates, run it like 'ant -Dnosvn.mode=yes update'"/>
 
   <target name="start" depends="init,start-tomcat"
@@ -409,4 +385,5 @@
       proxy.host=${proxy.host}
       proxy.port=${proxy.port}
+      disable.collection.building=${disable.collection.building}
       If these are not acceptable, please change them and rerun this target. Continue [y/n]? />
     </input>
@@ -430,6 +407,6 @@
     <fail if="java.too.old" message="You need Java 1.4 or greater to run Greenstone 3"/>
     
-    <available file="${indexers.home}" property="indexers.present"/>
     <available file="${basedir}/gli" property="gli.present"/>
+    <available file="${basedir}/common-src" property="common.src.present"/>
     <available file="${basedir}/gs2build" property="gs2build.present"/>
 
@@ -442,11 +419,4 @@
     
     <echo>tomcat.port = ${tomcat.port}</echo>
-    <echo>gli.present = ${gli.present}</echo> 
-    <echo>gs2build.present = ${gs2build.present}</echo>
-    <!-- gsdl2.installed.path appears not to be set, so wrap in if block -->
-    <if>
-        <bool><isset property="gsdl2.installed.path"/></bool>
-        <echo>gsdl2.installed.path = ${gsdl2.installed.path}</echo>
-    </if>
 
     <condition property="proxy.present">
@@ -457,10 +427,4 @@
     </condition>
 
-    <condition property="need.macos.extra">
-      <and>
-        <isset property="current.os.ismac"/>
-        <not><isset property="disable.collection.building"/></not>
-      </and>
-    </condition>
   </target>
 
@@ -472,4 +436,5 @@
       </or>
     </condition>
+    
     <getuserandpassword message="Using proxy: ${proxy.host}:${proxy.port}" if="ask.user" username="${proxy.user}" userproperty="proxy.username" pwordproperty="proxy.password"/>
     <mysetproxy proxyhost="${proxy.host}" proxyport="${proxy.port}" proxyuser="${proxy.username}" proxypassword="${proxy.password}"/>
@@ -550,9 +515,4 @@
   <target name="gs2mgdemo-prepare" if="collect.dir">
     <property name="gs2mgdemo.dir" value="${collect.dir}/gs2mgdemo"/>
-    <fileset id="gs2mgdemofiles" dir="${gs2mgdemo.dir}">
-      <include name="${import.zip}"/>
-      <include name="${metadata.zip}"/>
-      <include name="${index.zip}"/>
-    </fileset>
 
     <condition property="gs2mgdemo.present">
@@ -570,6 +530,4 @@
     <unzip dest="${gs2mgdemo.dir}" src="${gs2mgdemo.dir}/${metadata.zip}" />
     <unzip dest="${gs2mgdemo.dir}" src="${gs2mgdemo.dir}/${index.zip}" />
-    <!--Don't delete the zips, else doing an svn update will get them all over again.-->
-    <!--<delete><fileset refid="gs2mgdemofiles"/></delete>-->
     <echo>collection gs2mgdemo installed</echo>
   </target>
@@ -578,10 +536,4 @@
     <property name="gs2mgppdemo.dir" value="${collect.dir}/gs2mgppdemo"/>
  
-    <fileset id="gs2mgppdemofiles" dir="${gs2mgppdemo.dir}">
-      <include name="${import.zip}"/>
-      <include name="${metadata.zip}"/>
-      <include name="${index.zip}"/>
-    </fileset>
-
     <condition property="gs2mgppdemo.present">
       <and>
@@ -597,5 +549,4 @@
     <unzip dest="${gs2mgppdemo.dir}" src="${gs2mgppdemo.dir}/${metadata.zip}" />
     <unzip dest="${gs2mgppdemo.dir}" src="${gs2mgppdemo.dir}/${index.zip}" />
-    <!--<delete><fileset refid="gs2mgppdemofiles"/></delete>-->
     <echo>collection gs2mgppdemo installed</echo>
   </target>    
@@ -603,46 +554,11 @@
   <target name="gberg-prepare" if="collect.dir">
     <property name="gberg.dir" value="${collect.dir}/gberg"/>
-    <fileset id="gbergfiles" dir="${gberg.dir}">
-      <include name="index/${index.zip}"/>
-    </fileset>
     <available file="${gberg.dir}/index/${index.zip}" property="gberg.present"/>
   </target>
 
   <target name="gberg-install" if="gberg.present" depends="gberg-prepare">
-    <unzip dest="${gberg.dir}/index">
-      <fileset refid="gbergfiles"/>
-    </unzip>
-    <!--<delete><fileset refid="gbergfiles"/></delete>-->
+    <unzip dest="${gberg.dir}/index" src="${gberg.dir}/index/${index.zip}"/>
     <echo>collection gberg installed</echo>
   </target>
-
-  <!--
-  <target name="prepare-collections" depends="init">
-    <property name="collect.dir" value="${web.home}/sites/localsite/collect"/>
-    <unzip src="${collect.dir}/gs2mgdemo/import.zip" 
-      dest="${collect.dir}/gs2mgdemo"/>
-    <unzip src="${collect.dir}/gs2mgdemo/metadata.zip" 
-      dest="${collect.dir}/gs2mgdemo"/>
-    <unzip src="${collect.dir}/gs2mgdemo/index/index.zip" 
-      dest="${collect.dir}/gs2mgdemo/index"/>
-    <delete file="${collect.dir}/gs2mgdemo/import.zip"/>
-    <delete file="${collect.dir}/gs2mgdemo/metadata.zip"/>
-    <delete file="${collect.dir}/gs2mgdemo/index/index.zip"/>
-   
-    <unzip src="${collect.dir}/gs2mgppdemo/import.zip" 
-      dest="${collect.dir}/gs2mgppdemo"/>
-    <unzip src="${collect.dir}/gs2mgppdemo/metadata.zip" 
-      dest="${collect.dir}/gs2mgppdemo"/>
-    <unzip src="${collect.dir}/gs2mgppdemo/index/index.zip" 
-      dest="${collect.dir}/gs2mgppdemo/index"/>
-    <delete file="${collect.dir}/gs2mgppdemo/import.zip"/>
-    <delete file="${collect.dir}/gs2mgppdemo/metadata.zip"/>
-    <delete file="${collect.dir}/gs2mgppdemo/index/index.zip"/>
-  
-    <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"
@@ -1017,10 +933,5 @@
   <!-- core targets refer to the core gsdl3 java src -->
   
-  <target name="prepare-core" unless="nosvn.mode">
-    <!-- just get rid of empty directories-->
-    <svn>
-      <update dir="."  revision="${branch.revision}"/>
-    </svn>
-  </target>
+  <target name="prepare-core"/>
   
   <target name="configure-core"/>
@@ -1030,24 +941,12 @@
   
   <target name="svnupdate-core" unless="nosvn.mode">
-
     <svn>
-      <update dir="." recurse="false" revision="${branch.revision}"/>
+      <update dir="." revision="${branch.revision}"/>
     </svn>
-
-    <svn>
-      <update dir="bin" revision="${branch.revision}"/>
-      <update dir="comms" revision="${branch.revision}"/>
-      <update dir="dist-resources" revision="${branch.revision}"/>
-      <update dir="docs" revision="${branch.revision}"/>
-      <update dir="lib" revision="${branch.revision}"/>
-      <update dir="resources" revision="${branch.revision}"/>
-      <update dir="src" revision="${branch.revision}"/>
-      <update dir="winutil" revision="${branch.revision}"/>
-    </svn>
-
   </target>
 
   <target name="clean-core"
     description="Clean only the Greenstone core">
+    <!-- should this delete the gsdl3.jar from web/WEB-INF?? -->
     <delete dir="${build.home}"/>
   </target>
@@ -1144,14 +1043,4 @@
   <target name="prepare-packages" depends="init"/>
   
-<!--  <target name="checkout-indexers" depends="init" if="independent-indexers" unless="nosvn.mode">
-    <svn>
-      <checkout url="${svn.root}/indexers/${branch.path}" destPath="${src.packages.home}/indexers" revision="${branch.revision}"/>
-    </svn>
-  </target>
-  
-  <target name="prepare-indexers" depends="init" if="independent-indexers" unless="indexers.present">
-    <antcall target="checkout-indexers"/>
-  </target> -->
-
   <target name="update-packages" depends="init,svnupdate-packages,configure-packages,clean-packages,compile-packages"
     description="Update only the source packages"/>
@@ -1163,9 +1052,7 @@
   </target>
   
-<!--  <target name="configure-packages" depends="init,configure-javagdbm,configure-indexers" add common-src here instead.-->
   <target name="configure-packages" depends="init,configure-javagdbm" 
     description="Configure only the packages."/>
   
- <!-- <target name="configure-javagdbm" depends="configure-gdbm,compile-gdbm">-->
   <target name="configure-javagdbm">
     <echo>
@@ -1180,17 +1067,4 @@
   </target>
 
-  <!-- Message from oran. I removed the condition from this line becuase it meant
-  the indexers would only be configured if collection building was DISabled.
-  Shouldn't they be configured when collection building is ENabled? -->
-
-<!--  <target name="configure-indexers" depends="init" if="independent-indexers">
-  <target name="configure-indexers" depends="init">
-    <echo>Configuring Indexers</echo>
-    <exec executable="${indexers.home}/configure" os="${os.unix}" dir="${indexers.home}">
-      <arg value="- -prefix=${basedir}"/>
-      <arg value="- -libdir=${lib.jni}"/>
-    </exec>          
-  </target> -->
-
   <target name="clean-packages" depends="init,clean-javagdbm" description="Clean only the packages"/>
 
@@ -1202,15 +1076,4 @@
   </target>
   
-<!--  <target name="clean-indexers" depends="init" if="independent-indexers">
-    <exec executable="make" os="${os.unix}"
-      dir="${indexers.home}">
-      <arg value="clean"/>
-    </exec>
-    <exec executable="${indexers.home}/winMake.bat" os="${os.windows}"
-      dir="${indexers.home}">
-      <arg value="clean"/>
-    </exec>
-  </target> -->
-
   <target name="distclean-packages" depends="init,distclean-javagdbm" description="Distclean only the packages"/>
 
@@ -1222,18 +1085,7 @@
   </target>
   
-<!--  <target name="distclean-indexers" depends="init" if="independent-indexers">
-    <exec executable="make" os="${os.unix}"
-      dir="${indexers.home}">
-      <arg value="distclean"/>
-    </exec>
-    <exec executable="${indexers.home}/winMake.bat" os="${os.windows}"
-      dir="${indexers.home}">
-      <arg value="clean"/>
-    </exec>
-  </target>-->
-  
   <target name="compile-packages" description="Compile only the source packages">
     
-    <!-- javagdbm -->
+    <!-- unix: -->
     <echo>compile javagdbm</echo>
     <exec executable="make" os="${os.unix}" dir="${javagdbm.home}"/>
@@ -1256,30 +1108,4 @@
     <!-- Search4j -->
     <antcall target="compile-search4j"/>
-
-    <!-- Indexers -->
-
-    <!-- this may be in gs2build - we will be recompiling, but never mind -->
-<!--    <echo>Indexers: make (from ${indexers.home})</echo>
-    <exec executable="make" os="${os.unix}" dir="${indexers.home}"/>
-    <echo>Indexers: make install</echo>
-    <exec executable="make" os="${os.unix}" dir="${indexers.home}">
-      <arg value="install"/>
-    </exec>
-
-    <echo>Indexers: make</echo>
-    <exec executable="${indexers.home}/winMake.bat" os="${os.windows}" dir="${indexers.home}">
-      <arg value="all"/>
-    </exec>
-    <echo>Indexers: make install</echo>
-    <exec executable="${indexers.home}/winMake.bat" os="${os.windows}" dir="${indexers.home}">
-      <arg value="install"/>
-    </exec>
--->
-    <!-- install the jar and jni files -->
-  <!--  <echo>Install the indexers' jar and jni files</echo>
-    <copy file="${mg.home}/mg.jar" todir="${lib.jni}"/>
-    <copy file="${mgpp.home}/mgpp.jar" todir="${lib.jni}"/>
-    <copy file="${lucene.home}/LuceneWrapper.jar" todir="${web.lib}"/>
-    <antcall target="install-jni-files"/>-->
   </target>
 
@@ -1342,9 +1168,9 @@
   <target name="svnupdate-common-src" depends="init" if="collection.building.disabled" unless="nosvn.mode">
     <svn>
-      <update dir="{common.src.home}" revision="${branch.revision}"/>
+      <update dir="${common.src.home}" revision="${branch.revision}"/>
     </svn>    
   </target>
 
-  <target name="prepare-common-src" depends="init" if="collection.building.disabled">
+  <target name="prepare-common-src" depends="init" if="collection.building.disabled" unless="common.src.present">
     <antcall target="checkout-common-src"/>
     <antcall target="unzip-windows-packages"/>
@@ -1361,5 +1187,5 @@
     <exec executable="${common.src.home}/configure" os="${os.unix}"
       dir="${common.src.home}">
-      <arg value="--prefix=${common.src.home}"/> <!-- ??? -->
+      <arg value="--prefix=${common.src.home}"/> <!-- what value to use?? -->
     </exec>
   </target>
@@ -1386,16 +1212,8 @@
     <exec executable="make" os="${os.unix}" dir="${common.src.home}">
     </exec>
-    <exec executable="make" os="${os.unix}" dir="${common.src.home}">
-      <arg value="install"/>
-    </exec>
     <!-- windows: -->
     <exec executable="nmake" dir="${common.src.home}" os="${os.windows}">
       <arg value="/f"/>
       <arg value="win32.mak"/>
-    </exec>
-    <exec executable="nmake" dir="${common.src.home}" os="${os.windows}">
-      <arg value="/f"/>
-      <arg value="win32.mak"/>
-      <arg value="install"/>
     </exec>
   </target>
@@ -1515,5 +1333,4 @@
     <antcall target="get-windows-binaries"/>
     <antcall target="delete-winbin"/>
-    <!--<antcall target="get-macos-extra"/>-->
   </target>
 
@@ -1559,15 +1376,5 @@
       dest="${common.src.home}/indexers/packages/windows/iconv"/>
   </target>
-  
-
-<!--  <target name="install-indexer-files" depends="init" unless="indexers.present">
-    <copy todir="${indexers.home}">
-      <fileset dir="${gs2build.home}/common-src/indexers" />
-    </copy>
-    <chmod file="${indexers.home}/configure" perm="a+x"/>
-  </target> -->
-
-<!--  <target name="rename-gs2build-files" depends="gs2build-edit-setup-bat" if="collection.building.enabled"/>-->
-  
+    
   <target name="gs2build-edit-setup-bat" if="collection.building.enabled.windows">
     <!-- we want a windows path in the setup.bat file -->
@@ -1628,5 +1435,4 @@
     <copy file="${lucene.home}/LuceneWrapper.jar" todir="${gs2build.home}/bin/java"/>
     <antcall target="install-gs2build-indexers-windows"/>
-    <!--<antcall target="install-macos-extra"/>-->
   </target>
   
