Index: /trunk/gsdl3/build.xml
===================================================================
--- /trunk/gsdl3/build.xml	(revision 12206)
+++ /trunk/gsdl3/build.xml	(revision 12207)
@@ -121,9 +121,6 @@
   <property name="mgpp.home" value="${src.packages.home}/mgpp"/>
   <property name="javagdbm.home" value="${src.packages.home}/javagdbm"/>
-  <property name="mysql.home" value="${packages.home}/mysql"/>
   <property name="gsdl-as.home" value="${extensions.home}/gsdl-as"/>
 
-  <!-- can be set in build.properties if need be -->
-  <property name="mysql.datadir" value="./data"/>
 <!--  ==================== Compilation Control Options ==================== -->
 
@@ -223,8 +220,8 @@
   <!-- 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-extensions,prepare-gs2building,prepare-tomcat,prepare-axis,prepare-mysql,prepare-web,prepare-collections"
+  <target name="prepare" depends="accept-properties,init,prepare-core,prepare-packages,prepare-extensions,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."/>
 
-  <target name="install" depends="init,configure-mysql,configure,configure-c++,compile,deploy-localsite" 
+  <target name="install" depends="init,configure,configure-c++,compile,deploy-localsite" 
     description="Install Greenstone 3. Use this when you first checkout the code: 'ant prepare install'."/>
   
@@ -252,11 +249,11 @@
     description="Update (thru CVS) all the source (including core, packages and gs2building), then clean, configure and recompile."/>
 
-  <target name="start" depends="init,start-mysql,start-tomcat"
-    description="Startup the (local) Greenstone servers (tomcat,mysql...)" />
-
-  <target name="stop" depends="init,stop-tomcat,stop-mysql" 
-    description="Shutdown the (local) Greenstone servers."/>
-  
-  <target name="restart" description="Shutdown and restart the (local) Greenstone servers" depends="init,stop,start"/>
+  <target name="start" depends="init,start-tomcat"
+    description="Startup the Tomcat server." />
+
+  <target name="stop" depends="init,stop-tomcat" 
+    description="Shutdown the Tomcat server."/>
+  
+  <target name="restart" description="Shutdown and restart Tomcat"  depends="init,stop,start"/>
 
 
@@ -291,6 +288,4 @@
 proxy.host=${proxy.host}
 proxy.port=${proxy.port}
-mysql.installed.path=${mysql.installed.path} (this is the location of mysql if it is already installed)
-mysql.port=${mysql.port}
 If these are not acceptable, please change them and rerun this target. Continue [y/n]? />
     </input>
@@ -326,5 +321,4 @@
     
     <available file="${src.packages.home}/mgpp/text" property="mgpp.present"/>
-    <available file="${packages.home}/mysql/bin" property="mysql.present"/>
     <available file="${basedir}/gli" property="gli.present"/>
     <available file="${basedir}/gs2build" property="gs2build.present"/>
@@ -335,12 +329,4 @@
 	</not>
 	<equals arg1="" arg2="${gsdl2.installed.path}"/>
-      </or>
-    </condition>
-    <condition property="mysql.islocal">
-      <or>
-	<not>
-	  <isset property="mysql.installed.path"/>
-	</not>
-	<equals arg1="" arg2="${mysql.installed.path}"/>
       </or>
     </condition>
@@ -400,14 +386,4 @@
   <target name="prepare-collections" depends="init">
     <property name="collect.dir" value="${web.home}/sites/localsite/collect"/>
-    <!-- gs3mgdemo -->
-    <unzip src="${collect.dir}/gs3mgdemo/import.zip" 
-      dest="${collect.dir}/gs3mgdemo"/>
-    <unzip src="${collect.dir}/gs3mgdemo/archives.zip" 
-      dest="${collect.dir}/gs3mgdemo"/>
-    <unzip src="${collect.dir}/gs3mgdemo/index/index.zip" 
-      dest="${collect.dir}/gs3mgdemo/index"/>
-    <delete file="${collect.dir}/gs3mgdemo/import.zip"/>
-    <delete file="${collect.dir}/gs3mgdemo/archives.zip"/>
-    <delete file="${collect.dir}/gs3mgdemo/index/index.zip"/>
     <!-- gs2mgdemo -->
     <unzip src="${collect.dir}/gs2mgdemo/import.zip" 
@@ -437,5 +413,5 @@
 
   
-  <target name="configure-web" depends="init,get-mysql-reader-password,get-mysql-admin-password"
+  <target name="configure-web" depends="init"
     description="Configure only the web app config files">
     <!-- we want a unix path in the global.properties file -->
@@ -443,13 +419,5 @@
       <path path="${web.home}"/>
     </pathconvert>
-    <!-- just in case these haven't been defined, we need something to write to
-    the file -->
-    <property name="mysql.admin.password" value=" "/>
-    <property name="mysql.reader.password" value=" "/>
     <filter token="gsdl3home" value="${gsdl3.home.unix}"/>
-    <filter token="mysql.port" value="${mysql.port}"/>
-    <filter token="mysql.server" value="${mysql.server}"/>
-    <filter token="mysql.admin.pword" value="${mysql.admin.password}"/>
-    <filter token="mysql.reader.pword" value="${mysql.reader.password}"/>
     <filter token="tomcat.server" value="${tomcat.server}"/>
     <filter token="tomcat.port" value="${tomcat.port}"/>
@@ -482,4 +450,6 @@
   <!-- this target sets up tomcat for the first time, or resets it any subsequent times -->
   <target name="prepare-tomcat" depends="init,setup-proxy" if="tomcat.islocal">
+    <!-- check that packages dir is there -->
+    <mkdir dir="${packages.home}"/>
     <get src="http://www.greenstone.org/gs3files/apache-tomcat-5.5.12.zip"
       dest="${packages.home}/apache-tomcat-5.5.12.zip"
@@ -611,264 +581,4 @@
 
 
-<!-- ======================= Mysql Targets =========================== -->
-
-  <!-- this is one target that we only want to run once. -->
-  <target name="prepare-mysql" depends="init,init-mysql-vars,install-mysql,start-mysql,setup-mysql,stop-mysql-no-password-force"/>
-
-  <target name="init-mysql-vars">
-    <condition property="mysql.islocal.linux">
-      <and>
-	<isset property="mysql.islocal"/>
-	<isset property="current.os.isunixnotmac"/>
-      </and>
-    </condition>
-    <condition property="mysql.islocal.mac">
-      <and>
-	<isset property="mysql.islocal"/>
-	<isset property="current.os.ismac"/>
-      </and>
-    </condition>	   
-    <condition property="mysql.islocal.windows">
-      <and>
-	<isset property="mysql.islocal"/>
-	<isset property="current.os.iswindows"/>
-      </and>
-    </condition>
-    <condition property="mysql.islocal.usepassword">
-      <and>
-	<isset property="mysql.islocal"/>
-	<isset property="mysql.use.passwords"/>
-	<equals arg1="yes" arg2="${mysql.use.passwords}"/>
-      </and>
-    </condition>
-    <condition property="mysql.islocal.usepassword.windows">
-      <and>
-	<isset property="mysql.islocal.usepassword"/>
-	<isset property="current.os.iswindows"/>
-      </and>
-    </condition>
-     <condition property="mysql.islocal.usepassword.unix">
-      <and>
-	<isset property="mysql.islocal.usepassword"/>
-	<isset property="current.os.isunix"/>
-      </and>
-    </condition>
-   <condition property="mysql.islocal.nopassword">
-      <and>
-	<isset property="mysql.islocal"/>
-	<or>
-	  <not>
-	    <isset property="mysql.use.passwords"/>
-	  </not>
-	  <equals arg1="no" arg2="${mysql.use.passwords}"/>
-	</or>
-      </and>
-    </condition>
-   </target>
- 
-  <target name="configure-mysql" depends="init,init-mysql-vars,start-mysql,set-mysql-account-passwords,stop-mysql" description="sets up the mysql account passwords"/>
-  
-  <target name="get-mysql-root-password" depends="init,init-mysql-vars" if="mysql.islocal.usepassword" unless="mysql.root.password">
-    <echo>Enter password in the Java popup. (If you do not have a window server running, please set the mysql.root.password in the build.properties file.)</echo>
-    <getuserandpassword message="Please specify a password for the root mysql user: this is to secure your database."  username="root" pwordproperty="mysql.root.password"/>
-  </target>
-  
-  <target name="get-mysql-root-password-windows" depends="init,init-mysql-vars" if="mysql.islocal.usepassword.windows" unless="mysql.root.password">
-    <echo>(Enter password in the Java popup)</echo>
-    <getuserandpassword message="Please enter the mysql root password"  username="root" pwordproperty="mysql.root.password"/>
-  </target>
-  
-  <target name="get-mysql-reader-password" depends="init,init-mysql-vars" if="mysql.islocal.usepassword" unless="mysql.reader.password" >
-    <echo>Enter password in the Java popup. (If you do not have a window server running, please set the mysql.reader.password in the build.properties file.)</echo>
-    <getuserandpassword message="Please specify the password for the gsdl3reader mysql user: this is used by greenstone" username="gsdl3reader" pwordproperty="mysql.reader.password"/>
-  </target>
-  
-  <target name="get-mysql-admin-password" depends="init,init-mysql-vars" if="mysql.islocal.usepassword" unless="mysql.admin.password" >
-    <echo>Enter password in the Java popup. (If you do not have a window server running, please set the mysql.admin.password in the build.properties file.)</echo>
-    <getuserandpassword message="Please specify the password for the gsdl3admin mysql user: this is used by greenstone" username="gsdl3admin" pwordproperty="mysql.admin.password"/>
-  </target>
-
- <target name="install-mysql" depends="init,init-mysql-vars,install-mysql-linux,install-mysql-windows,install-mysql-mac"/>
-  
-  <!-- install the database : linux-->
-  <target name="install-mysql-linux" depends="init,init-mysql-vars" if="mysql.islocal.linux" unless="mysql.present">
-    <get src="http://www.greenstone.org/gs3files/mysql-standard-4.1.15-pc-linux-gnu-i686.tar.gz"
-      dest="${packages.home}/mysql-standard-4.1.15-pc-linux-gnu-i686.tar.gz"
-      usetimestamp="true"/>
-    <untar src="${packages.home}/mysql-standard-4.1.15-pc-linux-gnu-i686.tar.gz"
-      dest="${packages.home}"
-      compression="gzip"/>
-    <move todir="${packages.home}/mysql">
-      <fileset dir="${packages.home}/mysql-standard-4.1.15-pc-linux-gnu-i686"/>
-    </move>
-    <!-- file permissions are screwed up, so make executables executable -->
-    <chmod file="${mysql.home}/scripts/mysql_install_db" perm="a+x"/>
-    <chmod perm="a+x">
-      <fileset dir="${mysql.home}/bin" />
-    </chmod>
-    <mkdir dir="${mysql.home}/var/log/"/>
-    <chmod file="${mysql.home}/var/" perm="777" type="dir"/>
-    <chmod file="${mysql.home}/var/log/" perm="777" type="dir"/>
-    
-    <exec executable="${mysql.home}/scripts/mysql_install_db" dir="${mysql.home}">
-      <arg value="--datadir=${mysql.datadir}"/>
-      <arg value="--basedir=."/>
-      <arg value="--user=root"/>
-      <arg value="--force"/>
-    </exec>
-  </target>
-
-  <!-- install the database : mac-->
-  <target name="install-mysql-mac" depends="init,init-mysql-vars" if="mysql.islocal.mac" unless="mysql.present">
-    <get src="http://www.greenstone.org/gs3files/mysql-standard-4.1.15-apple-darwin7.9.0-powerpc.tar.gz"
-      dest="${packages.home}/mysql-standard-4.1.15-apple-darwin7.9.0-powerpc.tar.gz"
-      usetimestamp="true"/>
-    <untar src="${packages.home}/mysql-standard-4.1.15-apple-darwin7.9.0-powerpc.tar.gz"
-      dest="${packages.home}"
-      compression="gzip"/>
-    <move todir="${packages.home}/mysql">
-      <fileset dir="${packages.home}/mysql-standard-4.1.15-apple-darwin7.9.0-powerpc"/>
-    </move>    
-    <!-- file permissions are screwed up, so make executables executable -->
-    <chmod file="${mysql.home}/scripts/mysql_install_db" perm="a+x"/>
-    <chmod perm="a+x">
-      <fileset dir="${mysql.home}/bin" />
-    </chmod>
-    <mkdir dir="${mysql.home}/var/log/"/>
-    <chmod file="${mysql.home}/var/" perm="777" type="dir"/>
-    <chmod file="${mysql.home}/var/log/" perm="777" type="dir"/>
-    <exec executable="${mysql.home}/scripts/mysql_install_db" dir="${mysql.home}">
-      <arg value="--datadir=${mysql.datadir}"/>
-      <arg value="--basedir=."/>
-      <!--<arg value="- -user=root"/>
-      <arg value="- -force"/>-->
-    </exec>
-  </target>
-
-  <!-- install the database : windows -->
-  <target name="install-mysql-windows" depends="init,init-mysql-vars" if="mysql.islocal.windows" unless="mysql.present">
-    <get src="http://www.greenstone.org/gs3files/mysql-noinstall-4.1.15-win32.zip"
-      dest="${packages.home}/mysql-noinstall-4.1.15-win32.zip"
-      usetimestamp="true"/>
-    <!-- can we run the installer?? -->
-    <unzip src="${packages.home}/mysql-noinstall-4.1.15-win32.zip"
-      dest="${packages.home}"/>
-    <move todir="${packages.home}/mysql">
-      <fileset dir="${packages.home}/mysql-4.1.15-win32"/>
-    </move>
-  </target>
-
-  <target name="setup-mysql" depends="init" if="mysql.islocal">
-    <!-- setup the gsdl3 accounts -->
-    <exec executable="${mysql.home}/bin/mysql" dir="${mysql.home}">
-      <arg value="--user=root"/>
-      <arg value="--execute=GRANT SELECT,INSERT,DELETE,UPDATE,DROP,CREATE ON *.* TO gsdl3admin@localhost"/>
-    </exec>
-    <exec executable="${mysql.home}/bin/mysql" dir="${mysql.home}">
-      <arg value="--user=root"/>
-      <arg value="--execute=GRANT SELECT ON *.* TO gsdl3reader@localhost"/>
-    </exec>
-    <!--<exec executable="${mysql.home}/bin/mysql" dir="${mysql.home}">
-      <arg value="- -user=root"/>
-      <arg value="- -execute=GRANT SELECT,INSERT,DELETE,UPDATE,DROP,CREATE ON *.* TO gsdl3admin@'%';"/>
-    </exec>-->
-
-    <!-- remove the anonymous user -->
-    <exec executable="${mysql.home}/bin/mysql" dir="${mysql.home}">
-      <arg value="--user=root"/>
-      <arg value="--execute=delete from mysql.user where Host='localhost' and User='';"/>
-    </exec>
-    <!-- load in the demo collection database -->
-    <exec executable="${mysql.home}/bin/mysql" dir="${mysql.home}">
-      <arg value="--user=root"/>
-      <arg value="--execute=create database localsite_gs3mgdemo;"/>
-    </exec>
-    <exec executable="${mysql.home}/bin/mysql" dir="${mysql.home}"
-      input="${web.home}/sites/localsite/collect/gs3mgdemo/mysqldatadump.sql">
-      <arg value="--user=root"/>
-      <arg value="localsite_gs3mgdemo"/>
-    </exec>
-  </target>
-
-  <target name="set-mysql-account-passwords" depends="init,init-mysql-vars,get-mysql-root-password,get-mysql-reader-password,get-mysql-admin-password" if="mysql.islocal.usepassword">
-    <exec executable="${mysql.home}/bin/mysql" dir="${mysql.home}">
-      <arg value="--user=root"/>
-      <arg value="--execute=set password for 'root'@'localhost' = PASSWORD('${mysql.root.password}'); set password for 'gsdl3reader'@'localhost' = PASSWORD('${mysql.reader.password}'); set password for 'gsdl3admin'@'localhost' = PASSWORD('${mysql.admin.password}');  flush privileges;"/>
-    </exec>    
-  </target>
-
-  <target name="start-mysql" depends="init,init-mysql-vars" if="mysql.islocal"
-    description="Startup only mysql">
-    <echo>Starting up the mysql server</echo>
-    <exec executable="${mysql.home}/bin/mysqld_safe" dir="${mysql.home}"
-      spawn="true" os="${os.linux},${os.mac}">
-      <arg value="--datadir=${mysql.datadir}"/>
-      <arg value="--basedir=."/>
-      <arg value="--pid_file=gsdl3.pid"/>
-      <arg value="--socket=/tmp/mysql.sock"/>
-      <arg value="--port=${mysql.port}"/>
-      <arg value="--err-log=./var/log/mysql.log"/>
-    </exec>
-   <exec executable="${mysql.home}/bin/mysqld" dir="${mysql.home}" spawn="true" os="${os.windows}">
-      <arg value="--port=${mysql.port}"/>   
-    </exec>
-    <sleep seconds="2"/>
-  </target>
-
-  <target name="stop-mysql" depends="init,init-mysql-vars,stop-mysql-use-password-unix,stop-mysql-use-password-windows,stop-mysql-no-password" if="mysql.islocal"
-    description="Shutdown only mysql">
-    <echo>MYSQL database server shutdown successfully</echo>
-  </target>
-  
-  <target name="stop-mysql-no-password" depends="init" if="mysql.islocal.nopassword">
-    <exec executable="${mysql.home}/bin/mysqladmin" dir="${mysql.home}"
-      failonerror="true" os="${os.linux},${os.mac}">
-      <arg value="--user=root"/>
-      <arg value="--socket=/tmp/mysql.sock"/>
-      <arg value="shutdown"/>
-    </exec>
-    <exec executable="${mysql.home}/bin/mysqladmin" dir="${mysql.home}"
-      failonerror="true" os="${os.windows}">
-      <arg value="--user=root"/>
-      <arg value="shutdown"/>
-    </exec>
-  </target>
-  
-  <target name="stop-mysql-no-password-force" depends="init" if="mysql.islocal">
-    <exec executable="${mysql.home}/bin/mysqladmin" dir="${mysql.home}"
-      failonerror="true" os="${os.linux},${os.mac}">
-      <arg value="--user=root"/>
-      <arg value="--socket=/tmp/mysql.sock"/>
-      <arg value="shutdown"/>
-    </exec>
-    <exec executable="${mysql.home}/bin/mysqladmin" dir="${mysql.home}"
-      failonerror="true" os="${os.windows}">
-      <arg value="--user=root"/>
-      <arg value="shutdown"/>
-    </exec>
-  </target>
-  
-  <target name="stop-mysql-use-password-unix" depends="init" if="mysql.islocal.usepassword.unix">
-    <echo>At the password prompt, enter the mysql root password.</echo>
-    <exec executable="${mysql.home}/bin/mysqladmin" dir="${mysql.home}"
-      failonerror="true" os="${os.linux},${os.mac}">
-      <arg value="--user=root"/>
-      <arg value="-p"/>
-      <arg value="--socket=/tmp/mysql.sock"/>
-      <arg value="shutdown"/>
-    </exec>
-  </target>
-  
-  <target name="stop-mysql-use-password-windows" depends="init,get-mysql-root-password-windows" if="mysql.islocal.usepassword.windows">
-    <!-- on windows it doesn't work unless the password is specified here -->
-    <exec executable="${mysql.home}/bin/mysqladmin" dir="${mysql.home}"
-      failonerror="true" os="${os.windows}">
-      <arg value="--user=root"/>
-      <arg value="-p${mysql.root.password}"/>
-      <arg value="shutdown"/>
-    </exec>
-  </target>
-
-  <target name="restart-mysql" description="Shutdown and restart only mysql" depends="init,stop-mysql,start-mysql"/>
 
 
@@ -1589,14 +1299,4 @@
   </target>
   
-  <target name="prepare-for-dist-2" depends="init">
-    <antcall target="prepare-mysql"/>
-    <delete file="${packages.home}/mysql-standard-4.1.15-pc-linux-gnu-i686.tar.gz"/>
-    <delete file="${packages.home}/mysql-standard-4.1.15-apple-darwin7.9.0-powerpc.tar.gz"/>
-    <delete file="${packages.home}/mysql-noinstall-4.1.15-win32.zip"/>
-    <delete dir="${packages.home}/mysql/sql-bench"/>
-    <delete dir="${packages.home}/mysql/tests"/>
-    <delete dir="${packages.home}/mysql/mysql-test"/>
-    <delete file="${packages.home}/mysql/var/log/mysql.log"/>
-  </target>
   
   <target name="prepare-for-dist-3" depends="init">
@@ -1632,5 +1332,5 @@
   </target>
 
-  <target name="install-for-dist" depends="accept-properties,init,configure-mysql,configure,configure-tomcat">
+  <target name="install-for-dist" depends="accept-properties,init,configure,configure-tomcat">
     <condition property="need.xml.jars">
       <equals arg1="1.5" arg2="${ant.java.version}"/>
@@ -1666,5 +1366,5 @@
   </target>
 
-  <target name="prepare-for-source" depends="init,unzip-windows-packages,rename-gs2build-files-windows,prepare-tomcat,prepare-mysql,prepare-web"/>
+  <target name="prepare-for-source" depends="init,unzip-windows-packages,rename-gs2build-files-windows,prepare-tomcat,prepare-web"/>
 </project>
 
