Index: /greenstone3/trunk/build.xml
===================================================================
--- /greenstone3/trunk/build.xml	(revision 14164)
+++ /greenstone3/trunk/build.xml	(revision 14165)
@@ -10,9 +10,16 @@
 <project name="greenstone3" default="usage" basedir=".">
 
- <!-- ============ self defined tasks =================== -->
-
-  <taskdef name="mysetproxy" classname="org.greenstone.anttasks.MySetProxy" classpath="${basedir}/lib/java/anttasks.jar"/>
-  <taskdef name="getuserandpassword" classname="org.greenstone.anttasks.MyGetUserAndPassword" classpath="${basedir}/lib/java/anttasks.jar"/>
-
+	<!-- ============ classpath =================== -->
+	<path id="project.classpath">
+	   <fileset dir="svnant/lib">
+	      <include name="**/*.jar"/>
+	   </fileset>
+	</path>
+
+	<!-- ============ self defined tasks =================== -->
+
+	<taskdef name="mysetproxy" classname="org.greenstone.anttasks.MySetProxy" classpath="${basedir}/lib/java/anttasks.jar"/>
+	<taskdef name="getuserandpassword" classname="org.greenstone.anttasks.MyGetUserAndPassword" classpath="${basedir}/lib/java/anttasks.jar"/>
+	<taskdef name="svn" classname="org.tigris.subversion.svnant.SvnTask" classpathref="project.classpath"/>
 
 
@@ -70,5 +77,6 @@
   <property name="app.version"   value="3.02"/>
 
-  <property name="cvs.root" value=":pserver:cvs_anon@cvs.scms.waikato.ac.nz:2402/usr/local/global-cvs/gsdl-src"/>
+  <property name="svn.root" value="http://puka.cs.waikato.ac.nz/svn/greenstone"/>
+<!--  <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
   use greenstone's tomcat -->
@@ -253,5 +261,8 @@
 
   <target name="prepare" depends="accept-properties,init,prepare-core,prepare-packages,prepare-gs2building,prepare-tomcat,prepare-axis,prepare-web,prepare-collections"
-    description="Use this when you first checkout the code: 'ant prepare install'. This will do some additional cvs checkouts and downloads, so you need to be online to run this.">
+    description="Use this when you first checkout the code: 'ant prepare install'. This will do some additional subversion checkouts and downloads, so you need to be online to run this.">
+<!--  <target name="prepare" depends="accept-properties,init,prepare-core,prepare-packages,prepare-gs2building,prepare-tomcat,prepare-axis,prepare-web,prepare-collections"
+    description="Use this when you first checkout the code: 'ant prepare install'. This will do some additional cvs checkouts and downloads, so you need to be online to run this.">-->
+
     <!-- make sure .sh files are executable -->
     <chmod dir="${basedir}" perm="ugo+rx" 
@@ -263,6 +274,9 @@
     description="Install Greenstone 3. Use this when you first checkout the code: 'ant prepare install'."/>
   
-  <target name="cvsupdate" depends="init,cvsupdate-packages,cvsupdate-core,cvsupdate-gs2building,cvsupdate-web"
-    description="Do a cvs update for all sources. Doesn't recompile the code. You need to be online to run this."/>
+<!--  <target name="cvsupdate" depends="init,cvsupdate-packages,cvsupdate-core,cvsupdate-gs2building,cvsupdate-web"
+    description="Do a cvs update for all sources. Doesn't recompile the code. You need to be online to run this."/>-->
+  <target name="svnupdate" depends="init,svnupdate-packages,svnupdate-core,svnupdate-gs2building,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-gs2building"
@@ -278,6 +292,6 @@
     description="Compile all the source code, includes core, packages and gs2building if necessary. Copy jar files and executables to their correct places."/>
     
-  <target name="update" depends="init,cvsupdate,clean,configure,configure-c++,compile" 
-    description="Update (thru CVS) all the source (including core, packages and gs2building), then clean, configure and recompile."/>
+  <target name="update" depends="init,svnupdate,clean,configure,configure-c++,compile" 
+    description="Update (thru Subversion) all the source (including core, packages and gs2building), then clean, configure and recompile."/>
 
   <target name="start" depends="init,start-tomcat"
@@ -327,15 +341,15 @@
   </target>
 
-  <target name="check-cvsroot">
-    <condition property="cvsroot.notset">
+<!--  <target name="check-cvsroot">
+    <condition property="svnroot.notset">
       <or>
-	<not>
-	  <isset property="env.CVSROOT"/>
-	</not>
-	<equals arg1="" arg2="${env.CVSROOT}"/>
+			<not>
+			  <isset property="env.CVSROOT"/>
+			</not>
+			<equals arg1="" arg2="${env.CVSROOT}"/>
       </or>
     </condition>
     <fail if="cvsroot.notset" message="You need to set the CVSROOT variable"/>
-  </target>
+  </target> -->
 
   <!-- this sets up some initial properties -->
@@ -477,9 +491,11 @@
   </target>
 
-  <target name="cvsupdate-web" unless="nocvs.mode">
-    <cvs command="update -dP" dest="${web.home}"/>
-  </target>
-
-  <target name="update-web" depends="init,cvsupdate-web,configure-web"
+	<target name="svnupdate-web" unless="nosvn.mode">
+		<svn>
+			<update dir="${web.home}"/>
+		</svn>
+	</target>
+
+  <target name="update-web" depends="init,svnupdate-web,configure-web"
     description="update only the web stuff (config files)"/>
 
@@ -734,15 +750,31 @@
   <target name="prepare-core" unless="nocvs.mode">
     <!-- just get rid of empty directories-->
-    <cvs command="update -P"/>
+    <svn>
+		<update dir="."/>
+	</svn>
   </target>
   
   <target name="configure-core"/>
 
-  <target name="update-core" depends="init,cvsupdate-core,clean-core,compile-core"
+  <target name="update-core" depends="init,svnupdate-core,clean-core,compile-core"
     description="Update only the Greenstone core" />
   
-  <target name="cvsupdate-core" unless="nocvs.mode">
-    <cvs command="update -l"/>
-    <cvs command="update -dP bin comms dist-resources docs lib resources src winutil"/>
+  <target name="svnupdate-core" unless="nocvs.mode">
+
+	<svn>
+		<update dir="." recurse="false"/>
+	</svn>
+
+   <svn>
+		<update dir="bin"/>
+		<update dir="comms"/>
+		<update dir="dist-resources"/>
+		<update dir="docs"/>
+		<update dir="lib"/>
+		<update dir="resources"/>
+		<update dir="src"/>
+		<update dir="winutil"/>
+	</svn>
+
   </target>
 
@@ -834,6 +866,9 @@
   <target name="prepare-packages" depends="init,prepare-indexers"/>
   
-  <target name="checkout-indexers" depends="check-cvsroot,init" if="independent-indexers" unless="nocvs.mode">
-    <cvs command="checkout -P" package="indexers" dest="${src.packages.home}"/>
+  <target name="checkout-indexers" depends="init" if="independent-indexers" unless="nocvs.mode">
+<!--  <target name="checkout-indexers" depends="check-svnroot,init" if="independent-indexers" unless="nocvs.mode"> -->
+    <svn>
+		<checkout url="${svn.root}/indexers/trunk" dest="${src.packages.home}/indexers"/>
+	</svn>
   </target>
   
@@ -842,9 +877,11 @@
   </target>
 
-  <target name="update-packages" depends="init,cvsupdate-packages,configure-packages,clean-packages,compile-packages"
+  <target name="update-packages" depends="init,svnupdate-packages,configure-packages,clean-packages,compile-packages"
     description="Update only the source packages"/>
 
-  <target name="cvsupdate-packages" unless="nocvs.mode"> 
-    <cvs command="update -dP" dest="${src.packages.home}"/>
+  <target name="svnupdate-packages" unless="nocvs.mode"> 
+   <svn>
+		<update dir="${src.packages.home}"/>
+	</svn>
   </target>
   
@@ -867,16 +904,18 @@
      <arg value="--with-gdbm=${gdbm.installed.path}"/>
     </exec>    
-    
-  </target>
-  <target name="configure-indexers" depends="init" if="independent-indexers">
-    <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>
+
+<!-- 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,clean-indexers" description="Clean only the packages"/>
@@ -901,46 +940,50 @@
   </target>
    
-  <target name="compile-packages"
-    description="Compile only the source packages">    
-    <!-- javagdbm -->
-    <exec executable="make" os="${os.unix}"
-      dir="${javagdbm.home}">
-    </exec>
-    <exec executable="make" os="${os.unix}"
-      dir="${javagdbm.home}">
-      <arg value="install"/>
-    </exec>
-    <!-- windows: just the java stuff. -->
-    <exec executable="${javagdbm.home}/winMake.bat" os="${os.windows}"
-      dir="${javagdbm.home}">
-      <arg value="compile"/>
-      <arg value="javaonly"/>
-    </exec>
-    <!-- install the jar file -->
-    <copy file="${javagdbm.home}/javagdbm.jar" todir="${lib.jni}"/>
-    
-    <!-- Indexers -->
-    <!-- this may be in gs2build - we will be recompiling, but never mind -->
-    <exec executable="make" os="${os.unix}"
-      dir="${indexers.home}">
-    </exec>
-    <exec executable="make" os="${os.unix}"
-      dir="${indexers.home}">
-      <arg value="install"/>
-    </exec>
-    <exec executable="${indexers.home}/winMake.bat" os="${os.windows}"
-       dir="${indexers.home}">
-       <arg value="all"/>
-    </exec>
-    <exec executable="${indexers.home}/winMake.bat" os="${os.windows}"
-       dir="${indexers.home}">
-       <arg value="install"/>
-    </exec>
-    <!-- install the jar and jni files -->
-    <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>
+	<target name="compile-packages" description="Compile only the source packages">
+
+		<!-- javagdbm -->
+		<echo>compile javagdbm</echo>
+		<exec executable="make" os="${os.unix}" dir="${javagdbm.home}"/>
+		<exec executable="make" os="${os.unix}" dir="${javagdbm.home}">
+			<arg value="install"/>
+		</exec>
+
+		<!-- windows: just the java stuff. -->
+		<echo>Windows: compile javagdbm (java only)</echo>
+		<exec executable="${javagdbm.home}/winMake.bat" os="${os.windows}" dir="${javagdbm.home}">
+			<arg value="compile"/>
+			<arg value="javaonly"/>
+		</exec>
+
+		<!-- install the jar file -->
+		<echo>Install the javagdbm jar file</echo>
+		<copy file="${javagdbm.home}/javagdbm.jar" todir="${lib.jni}"/>
+
+		<!-- 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>
 
   <target name="install-jni-files" depends="init,install-jni-files-linux,install-jni-files-windows,install-jni-files-macos"/>
@@ -969,17 +1012,19 @@
 
   <target name="update-gs2building" if="collection.building.enabled" 
-    depends="init,cvsupdate-gs2building,rename-gs2build-files,configure-gs2building,clean-gs2building,compile-gs2building"
+    depends="init,svnupdate-gs2building,rename-gs2build-files,configure-gs2building,clean-gs2building,compile-gs2building"
     description="Update only the Greenstone 2 building components"/>
 
-  <target name="cvsupdate-gs2building" if="collection.building.enabled" depends="init,cvsupdate-gs2build,cvsupdate-gli" unless="nocvs.mode">
-  </target>
-  <target name="cvsupdate-gs2build" if="collection.building.enabled" depends="init" unless="nocvs.mode">
+  <target name="svnupdate-gs2building" if="collection.building.enabled" depends="init,svnupdate-gs2build,svnupdate-gli" unless="nocvs.mode">
+  </target>
+  <target name="svnupdate-gs2build" if="collection.building.enabled" depends="init" unless="nocvs.mode">
     <!-- Note: can't do a -d update here cos it will get all of gsdl 
      also, an update doesn't get new files, so we do a checkout instead. -->
-    <cvs command="checkout -P" package="gs2build" dest="${basedir}"/>
-  </target>
-  
-  <target name="cvsupdate-gli" if="collection.building.enabled" depends="init" unless="nocvs.mode">
-    <cvs command="update -dP" dest="${gli.home}"/>
+		<antcall target="checkout-gs2build"/>
+  </target>
+  
+  <target name="svnupdate-gli" if="collection.building.enabled" depends="init" unless="nocvs.mode">
+    <svn>
+		<update dir="${gli.home}"/>
+	</svn>
   </target>
 
@@ -987,8 +1032,79 @@
   </target>
 
-  <target name="checkout-gs2build" depends="check-cvsroot,init" if="collection.building.enabled" unless="nocvs.mode">
+  <target name="checkout-gs2build" depends="init" if="collection.building.enabled" unless="nocvs.mode">
+<!--  <target name="checkout-gs2build" depends="check-cvsroot,init" if="collection.building.enabled" unless="nocvs.mode"> -->
     <echo>checking out gs2build</echo>
-    <cvs command="checkout -P" package="gs2build"/>
-  </target>
+		<!-- svn checkouts -->
+		<svn>
+			<!-- perllib -->
+			<checkout url="${svn.root}/gsdl/trunk/perllib" destPath="gs2build/perllib"/>
+
+			<!-- selected packages -->
+			<checkout url="${svn.root}/gsdl/trunk/packages/cpan" destPath="gs2build/packages/cpan"/>
+			<checkout url="${svn.root}/gsdl/trunk/packages/expat" destPath="gs2build/packages/expat"/>
+			<checkout url="${svn.root}/gsdl/trunk/packages/html-tidy" destPath="gs2build/packages/html-tidy"/>
+			<checkout url="${svn.root}/gsdl/trunk/packages/isis-gdl" destPath="gs2build/packages/isis-gdl"/>
+			<checkout url="${svn.root}/gsdl/trunk/packages/kea" destPath="gs2build/packages/kea"/>
+			<checkout url="${svn.root}/gsdl/trunk/packages/pdftohtml" destPath="gs2build/packages/pdftohtml"/>
+			<checkout url="${svn.root}/gsdl/trunk/packages/rtftohtml" destPath="gs2build/packages/rtftohtml"/>
+			<checkout url="${svn.root}/gsdl/trunk/packages/w3mir" destPath="gs2build/packages/w3mir"/>
+			<checkout url="${svn.root}/gsdl/trunk/packages/wget" destPath="gs2build/packages/wget"/>
+			<checkout url="${svn.root}/gsdl/trunk/packages/windows" destPath="gs2build/packages/windows"/>
+			<checkout url="${svn.root}/gsdl/trunk/packages/wv" destPath="gs2build/packages/wv"/>
+			<checkout url="${svn.root}/gsdl/trunk/packages/xlhtml" destPath="gs2build/packages/xlhtml"/>
+			<checkout url="${svn.root}/gsdl/trunk/packages/yaz" destPath="gs2build/packages/yaz"/>
+			
+			<!-- some of src (db2txt hashfile phind txt2db) -->
+			<checkout url="${svn.root}/gsdl/trunk/src/db2txt" destPath="gs2build/src/db2txt"/>
+			<checkout url="${svn.root}/gsdl/trunk/src/hashfile" destPath="gs2build/src/hashfile"/>
+			<checkout url="${svn.root}/gsdl/trunk/src/phind" destPath="gs2build/src/phind"/>
+			<checkout url="${svn.root}/gsdl/trunk/src/txt2db" destPath="gs2build/src/txt2db"/>
+
+			<!-- bin -->
+			<checkout url="${svn.root}/gsdl/trunk/bin/script" destPath="gs2build/bin/script"/>
+
+			<!-- mappings -->
+			<checkout url="${svn.root}/gsdl/trunk/mappings" destPath="gs2build/mappings"/>
+
+			<!-- etc/packages -->
+			<checkout url="${svn.root}/gsdl/trunk/etc/packages" destPath="gs2build/etc/packages"/>
+	
+			<!-- collect -->
+			<checkout url="${svn.root}/gsdl/trunk/collect/modelcol" destPath="gs2build/collect/modelcol"/>
+
+			<!-- gs2build-extra -->
+			<checkout url="${svn.root}/other-projects/trunk/gs2build-extra" destPath="gs2build/gs2build-extra"/>
+
+			<!-- indexers -->
+			<checkout url="${svn.root}/indexers/trunk" destPath="gs2build/indexers"/>
+
+
+		</svn>
+		<!-- regular downloads -->
+
+		<!-- some files from lib -->
+		<mkdir dir="gs2build/lib"/>
+		<get src="${svn.root}/gsdl/trunk/lib/text_t.h" dest="gs2build/lib/text_t.h"/>
+		<get src="${svn.root}/gsdl/trunk/lib/text_t.cpp" dest="gs2build/lib/text_t.cpp"/>
+		<get src="${svn.root}/gsdl/trunk/lib/gsdlconf.h" dest="gs2build/lib/gsdlconf.h"/>
+
+		<!-- some files from etc -->
+		<get src="${svn.root}/gsdl/trunk/etc/marctodc.txt" dest="gs2build/etc/marctodc.txt"/>
+		<get src="${svn.root}/gsdl/trunk/etc/dc2marc-mapping.xml" dest="gs2build/etc/dc2marc-mapping.xml"/>
+		<get src="${svn.root}/gsdl/trunk/etc/dc2marc.xsl" dest="gs2build/etc/dc2marc.xsl"/>
+		<get src="${svn.root}/gsdl/trunk/etc/qdc2marc-mapping.xml" dest="gs2build/etc/qdc2marc-mapping.xml"/>
+
+		<!-- some files from the gsdl root directory -->
+		<get src="${svn.root}/gsdl/trunk/setup.bash" dest="gs2build/setup.bash"/>
+		<get src="${svn.root}/gsdl/trunk/config.sub" dest="gs2build/config.sub"/>
+		<get src="${svn.root}/gsdl/trunk/config.guess" dest="gs2build/config.guess"/>
+		<get src="${svn.root}/gsdl/trunk/config.h.in" dest="gs2build/config.h.in"/>
+		<get src="${svn.root}/gsdl/trunk/configtest.pl" dest="gs2build/configtest.pl"/>
+		<get src="${svn.root}/gsdl/trunk/install-sh" dest="gs2build/install-sh"/>
+		<get src="${svn.root}/gsdl/trunk/acconfig.h" dest="gs2build/acconfig.h"/>
+		<get src="${svn.root}/gsdl/trunk/aclocal.m4" dest="gs2build/aclocal.m4"/>
+		<get src="${svn.root}/gsdl/trunk/WIN32cfg.h" dest="gs2build/WIN32cfg.h"/>
+
+	</target>
 
   <target name="prepare-gs2build" depends="init" if="collection.building.enabled" unless="gs2build.present">
@@ -1004,5 +1120,7 @@
   <target name="checkout-winbin" depends="init" if="current.os.iswindows" 
     unless="nocvs.mode">
-    <cvs command="checkout -P" package="winbin"/>
+    <svn>
+		<checkout url="${svn.root}/other-projects/trunk/winbin" destPath="${basedir}/winbin"/>
+	</svn>	
   </target>
   
@@ -1090,7 +1208,10 @@
   </target>
   
-  <target name="checkout-gli" depends="check-cvsroot,init" if="collection.building.enabled" unless="nocvs.mode">
+<!--  <target name="checkout-gli" depends="check-cvsroot,init" if="collection.building.enabled" unless="nocvs.mode"> -->
+  <target name="checkout-gli" depends="init" if="collection.building.enabled" unless="nocvs.mode">
     <echo>checking out gli</echo>
-    <cvs command="checkout -P" package="gli"/>
+    <svn>
+		<checkout url="${svn.root}/gli/trunk" destPath="gli"/>
+	</svn>
   </target>
     
