Changeset 12207


Ignore:
Timestamp:
2006-07-13T13:27:46+12:00 (18 years ago)
Author:
kjdon
Message:

removed mysql and gs3mgdemo collection stuff

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/gsdl3/build.xml

    r11290 r12207  
    121121  <property name="mgpp.home" value="${src.packages.home}/mgpp"/>
    122122  <property name="javagdbm.home" value="${src.packages.home}/javagdbm"/>
    123   <property name="mysql.home" value="${packages.home}/mysql"/>
    124123  <property name="gsdl-as.home" value="${extensions.home}/gsdl-as"/>
    125124
    126   <!-- can be set in build.properties if need be -->
    127   <property name="mysql.datadir" value="./data"/>
    128125<!--  ==================== Compilation Control Options ==================== -->
    129126
     
    223220  <!-- add comments about using xxx-core, xxx-packages if only want certain parts?? -->
    224221
    225   <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"
     222  <target name="prepare" depends="accept-properties,init,prepare-core,prepare-packages,prepare-extensions,prepare-gs2building,prepare-tomcat,prepare-axis,prepare-web,prepare-collections"
    226223    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."/>
    227224
    228   <target name="install" depends="init,configure-mysql,configure,configure-c++,compile,deploy-localsite"
     225  <target name="install" depends="init,configure,configure-c++,compile,deploy-localsite"
    229226    description="Install Greenstone 3. Use this when you first checkout the code: 'ant prepare install'."/>
    230227 
     
    252249    description="Update (thru CVS) all the source (including core, packages and gs2building), then clean, configure and recompile."/>
    253250
    254   <target name="start" depends="init,start-mysql,start-tomcat"
    255     description="Startup the (local) Greenstone servers (tomcat,mysql...)" />
    256 
    257   <target name="stop" depends="init,stop-tomcat,stop-mysql"
    258     description="Shutdown the (local) Greenstone servers."/>
    259  
    260   <target name="restart" description="Shutdown and restart the (local) Greenstone servers" depends="init,stop,start"/>
     251  <target name="start" depends="init,start-tomcat"
     252    description="Startup the Tomcat server." />
     253
     254  <target name="stop" depends="init,stop-tomcat"
     255    description="Shutdown the Tomcat server."/>
     256 
     257  <target name="restart" description="Shutdown and restart Tomcat" depends="init,stop,start"/>
    261258
    262259
     
    291288proxy.host=${proxy.host}
    292289proxy.port=${proxy.port}
    293 mysql.installed.path=${mysql.installed.path} (this is the location of mysql if it is already installed)
    294 mysql.port=${mysql.port}
    295290If these are not acceptable, please change them and rerun this target. Continue [y/n]? />
    296291    </input>
     
    326321   
    327322    <available file="${src.packages.home}/mgpp/text" property="mgpp.present"/>
    328     <available file="${packages.home}/mysql/bin" property="mysql.present"/>
    329323    <available file="${basedir}/gli" property="gli.present"/>
    330324    <available file="${basedir}/gs2build" property="gs2build.present"/>
     
    335329    </not>
    336330    <equals arg1="" arg2="${gsdl2.installed.path}"/>
    337       </or>
    338     </condition>
    339     <condition property="mysql.islocal">
    340       <or>
    341     <not>
    342       <isset property="mysql.installed.path"/>
    343     </not>
    344     <equals arg1="" arg2="${mysql.installed.path}"/>
    345331      </or>
    346332    </condition>
     
    400386  <target name="prepare-collections" depends="init">
    401387    <property name="collect.dir" value="${web.home}/sites/localsite/collect"/>
    402     <!-- gs3mgdemo -->
    403     <unzip src="${collect.dir}/gs3mgdemo/import.zip"
    404       dest="${collect.dir}/gs3mgdemo"/>
    405     <unzip src="${collect.dir}/gs3mgdemo/archives.zip"
    406       dest="${collect.dir}/gs3mgdemo"/>
    407     <unzip src="${collect.dir}/gs3mgdemo/index/index.zip"
    408       dest="${collect.dir}/gs3mgdemo/index"/>
    409     <delete file="${collect.dir}/gs3mgdemo/import.zip"/>
    410     <delete file="${collect.dir}/gs3mgdemo/archives.zip"/>
    411     <delete file="${collect.dir}/gs3mgdemo/index/index.zip"/>
    412388    <!-- gs2mgdemo -->
    413389    <unzip src="${collect.dir}/gs2mgdemo/import.zip"
     
    437413
    438414 
    439   <target name="configure-web" depends="init,get-mysql-reader-password,get-mysql-admin-password"
     415  <target name="configure-web" depends="init"
    440416    description="Configure only the web app config files">
    441417    <!-- we want a unix path in the global.properties file -->
     
    443419      <path path="${web.home}"/>
    444420    </pathconvert>
    445     <!-- just in case these haven't been defined, we need something to write to
    446     the file -->
    447     <property name="mysql.admin.password" value=" "/>
    448     <property name="mysql.reader.password" value=" "/>
    449421    <filter token="gsdl3home" value="${gsdl3.home.unix}"/>
    450     <filter token="mysql.port" value="${mysql.port}"/>
    451     <filter token="mysql.server" value="${mysql.server}"/>
    452     <filter token="mysql.admin.pword" value="${mysql.admin.password}"/>
    453     <filter token="mysql.reader.pword" value="${mysql.reader.password}"/>
    454422    <filter token="tomcat.server" value="${tomcat.server}"/>
    455423    <filter token="tomcat.port" value="${tomcat.port}"/>
     
    482450  <!-- this target sets up tomcat for the first time, or resets it any subsequent times -->
    483451  <target name="prepare-tomcat" depends="init,setup-proxy" if="tomcat.islocal">
     452    <!-- check that packages dir is there -->
     453    <mkdir dir="${packages.home}"/>
    484454    <get src="http://www.greenstone.org/gs3files/apache-tomcat-5.5.12.zip"
    485455      dest="${packages.home}/apache-tomcat-5.5.12.zip"
     
    611581
    612582
    613 <!-- ======================= Mysql Targets =========================== -->
    614 
    615   <!-- this is one target that we only want to run once. -->
    616   <target name="prepare-mysql" depends="init,init-mysql-vars,install-mysql,start-mysql,setup-mysql,stop-mysql-no-password-force"/>
    617 
    618   <target name="init-mysql-vars">
    619     <condition property="mysql.islocal.linux">
    620       <and>
    621     <isset property="mysql.islocal"/>
    622     <isset property="current.os.isunixnotmac"/>
    623       </and>
    624     </condition>
    625     <condition property="mysql.islocal.mac">
    626       <and>
    627     <isset property="mysql.islocal"/>
    628     <isset property="current.os.ismac"/>
    629       </and>
    630     </condition>       
    631     <condition property="mysql.islocal.windows">
    632       <and>
    633     <isset property="mysql.islocal"/>
    634     <isset property="current.os.iswindows"/>
    635       </and>
    636     </condition>
    637     <condition property="mysql.islocal.usepassword">
    638       <and>
    639     <isset property="mysql.islocal"/>
    640     <isset property="mysql.use.passwords"/>
    641     <equals arg1="yes" arg2="${mysql.use.passwords}"/>
    642       </and>
    643     </condition>
    644     <condition property="mysql.islocal.usepassword.windows">
    645       <and>
    646     <isset property="mysql.islocal.usepassword"/>
    647     <isset property="current.os.iswindows"/>
    648       </and>
    649     </condition>
    650      <condition property="mysql.islocal.usepassword.unix">
    651       <and>
    652     <isset property="mysql.islocal.usepassword"/>
    653     <isset property="current.os.isunix"/>
    654       </and>
    655     </condition>
    656    <condition property="mysql.islocal.nopassword">
    657       <and>
    658     <isset property="mysql.islocal"/>
    659     <or>
    660       <not>
    661         <isset property="mysql.use.passwords"/>
    662       </not>
    663       <equals arg1="no" arg2="${mysql.use.passwords}"/>
    664     </or>
    665       </and>
    666     </condition>
    667    </target>
    668  
    669   <target name="configure-mysql" depends="init,init-mysql-vars,start-mysql,set-mysql-account-passwords,stop-mysql" description="sets up the mysql account passwords"/>
    670  
    671   <target name="get-mysql-root-password" depends="init,init-mysql-vars" if="mysql.islocal.usepassword" unless="mysql.root.password">
    672     <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>
    673     <getuserandpassword message="Please specify a password for the root mysql user: this is to secure your database."  username="root" pwordproperty="mysql.root.password"/>
    674   </target>
    675  
    676   <target name="get-mysql-root-password-windows" depends="init,init-mysql-vars" if="mysql.islocal.usepassword.windows" unless="mysql.root.password">
    677     <echo>(Enter password in the Java popup)</echo>
    678     <getuserandpassword message="Please enter the mysql root password"  username="root" pwordproperty="mysql.root.password"/>
    679   </target>
    680  
    681   <target name="get-mysql-reader-password" depends="init,init-mysql-vars" if="mysql.islocal.usepassword" unless="mysql.reader.password" >
    682     <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>
    683     <getuserandpassword message="Please specify the password for the gsdl3reader mysql user: this is used by greenstone" username="gsdl3reader" pwordproperty="mysql.reader.password"/>
    684   </target>
    685  
    686   <target name="get-mysql-admin-password" depends="init,init-mysql-vars" if="mysql.islocal.usepassword" unless="mysql.admin.password" >
    687     <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>
    688     <getuserandpassword message="Please specify the password for the gsdl3admin mysql user: this is used by greenstone" username="gsdl3admin" pwordproperty="mysql.admin.password"/>
    689   </target>
    690 
    691  <target name="install-mysql" depends="init,init-mysql-vars,install-mysql-linux,install-mysql-windows,install-mysql-mac"/>
    692  
    693   <!-- install the database : linux-->
    694   <target name="install-mysql-linux" depends="init,init-mysql-vars" if="mysql.islocal.linux" unless="mysql.present">
    695     <get src="http://www.greenstone.org/gs3files/mysql-standard-4.1.15-pc-linux-gnu-i686.tar.gz"
    696       dest="${packages.home}/mysql-standard-4.1.15-pc-linux-gnu-i686.tar.gz"
    697       usetimestamp="true"/>
    698     <untar src="${packages.home}/mysql-standard-4.1.15-pc-linux-gnu-i686.tar.gz"
    699       dest="${packages.home}"
    700       compression="gzip"/>
    701     <move todir="${packages.home}/mysql">
    702       <fileset dir="${packages.home}/mysql-standard-4.1.15-pc-linux-gnu-i686"/>
    703     </move>
    704     <!-- file permissions are screwed up, so make executables executable -->
    705     <chmod file="${mysql.home}/scripts/mysql_install_db" perm="a+x"/>
    706     <chmod perm="a+x">
    707       <fileset dir="${mysql.home}/bin" />
    708     </chmod>
    709     <mkdir dir="${mysql.home}/var/log/"/>
    710     <chmod file="${mysql.home}/var/" perm="777" type="dir"/>
    711     <chmod file="${mysql.home}/var/log/" perm="777" type="dir"/>
    712    
    713     <exec executable="${mysql.home}/scripts/mysql_install_db" dir="${mysql.home}">
    714       <arg value="--datadir=${mysql.datadir}"/>
    715       <arg value="--basedir=."/>
    716       <arg value="--user=root"/>
    717       <arg value="--force"/>
    718     </exec>
    719   </target>
    720 
    721   <!-- install the database : mac-->
    722   <target name="install-mysql-mac" depends="init,init-mysql-vars" if="mysql.islocal.mac" unless="mysql.present">
    723     <get src="http://www.greenstone.org/gs3files/mysql-standard-4.1.15-apple-darwin7.9.0-powerpc.tar.gz"
    724       dest="${packages.home}/mysql-standard-4.1.15-apple-darwin7.9.0-powerpc.tar.gz"
    725       usetimestamp="true"/>
    726     <untar src="${packages.home}/mysql-standard-4.1.15-apple-darwin7.9.0-powerpc.tar.gz"
    727       dest="${packages.home}"
    728       compression="gzip"/>
    729     <move todir="${packages.home}/mysql">
    730       <fileset dir="${packages.home}/mysql-standard-4.1.15-apple-darwin7.9.0-powerpc"/>
    731     </move>   
    732     <!-- file permissions are screwed up, so make executables executable -->
    733     <chmod file="${mysql.home}/scripts/mysql_install_db" perm="a+x"/>
    734     <chmod perm="a+x">
    735       <fileset dir="${mysql.home}/bin" />
    736     </chmod>
    737     <mkdir dir="${mysql.home}/var/log/"/>
    738     <chmod file="${mysql.home}/var/" perm="777" type="dir"/>
    739     <chmod file="${mysql.home}/var/log/" perm="777" type="dir"/>
    740     <exec executable="${mysql.home}/scripts/mysql_install_db" dir="${mysql.home}">
    741       <arg value="--datadir=${mysql.datadir}"/>
    742       <arg value="--basedir=."/>
    743       <!--<arg value="- -user=root"/>
    744       <arg value="- -force"/>-->
    745     </exec>
    746   </target>
    747 
    748   <!-- install the database : windows -->
    749   <target name="install-mysql-windows" depends="init,init-mysql-vars" if="mysql.islocal.windows" unless="mysql.present">
    750     <get src="http://www.greenstone.org/gs3files/mysql-noinstall-4.1.15-win32.zip"
    751       dest="${packages.home}/mysql-noinstall-4.1.15-win32.zip"
    752       usetimestamp="true"/>
    753     <!-- can we run the installer?? -->
    754     <unzip src="${packages.home}/mysql-noinstall-4.1.15-win32.zip"
    755       dest="${packages.home}"/>
    756     <move todir="${packages.home}/mysql">
    757       <fileset dir="${packages.home}/mysql-4.1.15-win32"/>
    758     </move>
    759   </target>
    760 
    761   <target name="setup-mysql" depends="init" if="mysql.islocal">
    762     <!-- setup the gsdl3 accounts -->
    763     <exec executable="${mysql.home}/bin/mysql" dir="${mysql.home}">
    764       <arg value="--user=root"/>
    765       <arg value="--execute=GRANT SELECT,INSERT,DELETE,UPDATE,DROP,CREATE ON *.* TO gsdl3admin@localhost"/>
    766     </exec>
    767     <exec executable="${mysql.home}/bin/mysql" dir="${mysql.home}">
    768       <arg value="--user=root"/>
    769       <arg value="--execute=GRANT SELECT ON *.* TO gsdl3reader@localhost"/>
    770     </exec>
    771     <!--<exec executable="${mysql.home}/bin/mysql" dir="${mysql.home}">
    772       <arg value="- -user=root"/>
    773       <arg value="- -execute=GRANT SELECT,INSERT,DELETE,UPDATE,DROP,CREATE ON *.* TO gsdl3admin@'%';"/>
    774     </exec>-->
    775 
    776     <!-- remove the anonymous user -->
    777     <exec executable="${mysql.home}/bin/mysql" dir="${mysql.home}">
    778       <arg value="--user=root"/>
    779       <arg value="--execute=delete from mysql.user where Host='localhost' and User='';"/>
    780     </exec>
    781     <!-- load in the demo collection database -->
    782     <exec executable="${mysql.home}/bin/mysql" dir="${mysql.home}">
    783       <arg value="--user=root"/>
    784       <arg value="--execute=create database localsite_gs3mgdemo;"/>
    785     </exec>
    786     <exec executable="${mysql.home}/bin/mysql" dir="${mysql.home}"
    787       input="${web.home}/sites/localsite/collect/gs3mgdemo/mysqldatadump.sql">
    788       <arg value="--user=root"/>
    789       <arg value="localsite_gs3mgdemo"/>
    790     </exec>
    791   </target>
    792 
    793   <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">
    794     <exec executable="${mysql.home}/bin/mysql" dir="${mysql.home}">
    795       <arg value="--user=root"/>
    796       <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;"/>
    797     </exec>   
    798   </target>
    799 
    800   <target name="start-mysql" depends="init,init-mysql-vars" if="mysql.islocal"
    801     description="Startup only mysql">
    802     <echo>Starting up the mysql server</echo>
    803     <exec executable="${mysql.home}/bin/mysqld_safe" dir="${mysql.home}"
    804       spawn="true" os="${os.linux},${os.mac}">
    805       <arg value="--datadir=${mysql.datadir}"/>
    806       <arg value="--basedir=."/>
    807       <arg value="--pid_file=gsdl3.pid"/>
    808       <arg value="--socket=/tmp/mysql.sock"/>
    809       <arg value="--port=${mysql.port}"/>
    810       <arg value="--err-log=./var/log/mysql.log"/>
    811     </exec>
    812    <exec executable="${mysql.home}/bin/mysqld" dir="${mysql.home}" spawn="true" os="${os.windows}">
    813       <arg value="--port=${mysql.port}"/>   
    814     </exec>
    815     <sleep seconds="2"/>
    816   </target>
    817 
    818   <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"
    819     description="Shutdown only mysql">
    820     <echo>MYSQL database server shutdown successfully</echo>
    821   </target>
    822  
    823   <target name="stop-mysql-no-password" depends="init" if="mysql.islocal.nopassword">
    824     <exec executable="${mysql.home}/bin/mysqladmin" dir="${mysql.home}"
    825       failonerror="true" os="${os.linux},${os.mac}">
    826       <arg value="--user=root"/>
    827       <arg value="--socket=/tmp/mysql.sock"/>
    828       <arg value="shutdown"/>
    829     </exec>
    830     <exec executable="${mysql.home}/bin/mysqladmin" dir="${mysql.home}"
    831       failonerror="true" os="${os.windows}">
    832       <arg value="--user=root"/>
    833       <arg value="shutdown"/>
    834     </exec>
    835   </target>
    836  
    837   <target name="stop-mysql-no-password-force" depends="init" if="mysql.islocal">
    838     <exec executable="${mysql.home}/bin/mysqladmin" dir="${mysql.home}"
    839       failonerror="true" os="${os.linux},${os.mac}">
    840       <arg value="--user=root"/>
    841       <arg value="--socket=/tmp/mysql.sock"/>
    842       <arg value="shutdown"/>
    843     </exec>
    844     <exec executable="${mysql.home}/bin/mysqladmin" dir="${mysql.home}"
    845       failonerror="true" os="${os.windows}">
    846       <arg value="--user=root"/>
    847       <arg value="shutdown"/>
    848     </exec>
    849   </target>
    850  
    851   <target name="stop-mysql-use-password-unix" depends="init" if="mysql.islocal.usepassword.unix">
    852     <echo>At the password prompt, enter the mysql root password.</echo>
    853     <exec executable="${mysql.home}/bin/mysqladmin" dir="${mysql.home}"
    854       failonerror="true" os="${os.linux},${os.mac}">
    855       <arg value="--user=root"/>
    856       <arg value="-p"/>
    857       <arg value="--socket=/tmp/mysql.sock"/>
    858       <arg value="shutdown"/>
    859     </exec>
    860   </target>
    861  
    862   <target name="stop-mysql-use-password-windows" depends="init,get-mysql-root-password-windows" if="mysql.islocal.usepassword.windows">
    863     <!-- on windows it doesn't work unless the password is specified here -->
    864     <exec executable="${mysql.home}/bin/mysqladmin" dir="${mysql.home}"
    865       failonerror="true" os="${os.windows}">
    866       <arg value="--user=root"/>
    867       <arg value="-p${mysql.root.password}"/>
    868       <arg value="shutdown"/>
    869     </exec>
    870   </target>
    871 
    872   <target name="restart-mysql" description="Shutdown and restart only mysql" depends="init,stop-mysql,start-mysql"/>
    873583
    874584
     
    15891299  </target>
    15901300 
    1591   <target name="prepare-for-dist-2" depends="init">
    1592     <antcall target="prepare-mysql"/>
    1593     <delete file="${packages.home}/mysql-standard-4.1.15-pc-linux-gnu-i686.tar.gz"/>
    1594     <delete file="${packages.home}/mysql-standard-4.1.15-apple-darwin7.9.0-powerpc.tar.gz"/>
    1595     <delete file="${packages.home}/mysql-noinstall-4.1.15-win32.zip"/>
    1596     <delete dir="${packages.home}/mysql/sql-bench"/>
    1597     <delete dir="${packages.home}/mysql/tests"/>
    1598     <delete dir="${packages.home}/mysql/mysql-test"/>
    1599     <delete file="${packages.home}/mysql/var/log/mysql.log"/>
    1600   </target>
    16011301 
    16021302  <target name="prepare-for-dist-3" depends="init">
     
    16321332  </target>
    16331333
    1634   <target name="install-for-dist" depends="accept-properties,init,configure-mysql,configure,configure-tomcat">
     1334  <target name="install-for-dist" depends="accept-properties,init,configure,configure-tomcat">
    16351335    <condition property="need.xml.jars">
    16361336      <equals arg1="1.5" arg2="${ant.java.version}"/>
     
    16661366  </target>
    16671367
    1668   <target name="prepare-for-source" depends="init,unzip-windows-packages,rename-gs2build-files-windows,prepare-tomcat,prepare-mysql,prepare-web"/>
     1368  <target name="prepare-for-source" depends="init,unzip-windows-packages,rename-gs2build-files-windows,prepare-tomcat,prepare-web"/>
    16691369</project>
    16701370
Note: See TracChangeset for help on using the changeset viewer.