Changeset 9499


Ignore:
Timestamp:
2005-03-30T12:07:41+12:00 (19 years ago)
Author:
kjdon
Message:

work on the build script for the ant install branch

File:
1 edited

Legend:

Unmodified
Added
Removed
  • branches/ant-install-branch/gsdl3/build.xml

    r8424 r9499  
    11<?xml version="1.0"?>
     2
    23<!-- ======================================================================
    3      Oct 11, 2004 1:54:59 AM                                                       
    4 
    5      GSDL3 build script for rebuilding gsdl3.jar
     4     March 2005                                                   
     5
     6     GSDL3 build and install script
    67                   
    7      schweer                                                               
     8     kjdon                                                               
    89     ====================================================================== -->
    9 <project name="gsdl3" default="build">
    10 
    11     <property name="src" value="src/java"/>
    12     <property name="build" value="classes"/>
    13     <property name="lib" value="lib/java"/>
    14     <property name="weblib" value="web/lib"/>
    15     <property name="javadocs" value="docs/javadoc"/>
    16 
    17     <description>
    18         GSDL3 build script for rebuilding gsdl3.jar
    19     </description>
    20 
    21     <target name="init">
    22         <tstamp/>
    23         <mkdir dir="${build}"/>
    24     </target>
    25 
    26     <target name="build" depends="init" description="build the java code">
    27         <javac debug="true" destdir="${build}" extdirs="${lib}:comms/jakarta/tomcat/common/lib/servlet.jar" optimize="false" srcdir="${src}" excludes="org/greenstone/testing/** org/greenstone/applet/** "/>
    28     </target>
    29 
    30     <target name="jar" depends="build" description="re-create gsdl3.jar">
    31         <jar destfile="${lib}/gsdl3.jar">
    32             <fileset dir="${build}" excludes="org/greenstone/testing/**" />
    33             <manifest>
    34                 <attribute name="Built-By" value="${user.name}" />
    35             </manifest>
    36         </jar>
    37     </target>
    38 
    39     <target name="install" depends="jar" description="copy gsdl3.jar to where it's supposed to be">
    40         <copy file="${lib}/gsdl3.jar" todir="${weblib}"/>
    41     </target>
    42 
    43 
    44     <target name="javadocs" depends="init" description="create javadocs">
    45         <javadoc author="true" destdir="${javadocs}" extdirs="${lib}" failonerror="true" private="true" source="1.4" sourcepath="${src}" version="true">
    46             <packageset dir="${src}" excludes="org/greenstone/testing/** org/greenstone/applet/** org/greenstone/gdbm/**"/>
    47         </javadoc>
    48     </target>
    49 
     10<project name="gsdl3" default="compile" basedir=".">
     11
     12 <!-- ============ self defined tasks =================== -->
     13
     14  <taskdef name="mysetproxy" classname="org.greenstone.anttasks.MySetProxy" classpath="${basedir}/lib/java/anttasks.jar"/>
     15  <taskdef name="getuserandpassword" classname="org.greenstone.anttasks.MyGetUserAndPassword" classpath="${basedir}/lib/java/anttasks.jar"/>
     16
     17<!-- Configure the custom Ant tasks for the Tomcat Manager application -->
     18  <taskdef name="deploy"    classname="org.apache.catalina.ant.DeployTask"
     19    classpath="${basedir}/lib/java/catalina-ant.jar"/>
     20  <taskdef name="list"      classname="org.apache.catalina.ant.ListTask"
     21    classpath="${basedir}/lib/java/catalina-ant.jar"/>
     22  <taskdef name="reload"    classname="org.apache.catalina.ant.ReloadTask"
     23    classpath="${basedir}/lib/java/catalina-ant.jar"/>
     24  <taskdef name="resources" classname="org.apache.catalina.ant.ResourcesTask"
     25    classpath="${basedir}/lib/java/catalina-ant.jar"/>
     26  <taskdef name="roles"     classname="org.apache.catalina.ant.RolesTask"
     27    classpath="${basedir}/lib/java/catalina-ant.jar"/>
     28  <taskdef name="start"     classname="org.apache.catalina.ant.StartTask"
     29    classpath="${basedir}/lib/java/catalina-ant.jar"/>
     30  <taskdef name="stop"      classname="org.apache.catalina.ant.StopTask"
     31    classpath="${basedir}/lib/java/catalina-ant.jar"/>
     32  <taskdef name="undeploy"  classname="org.apache.catalina.ant.UndeployTask"
     33    classpath="${basedir}/lib/java/catalina-ant.jar"/>
     34
     35
     36<!-- ===================== Property Definitions =========================== -->
     37
     38<!--
     39
     40  Each of the following properties are used in the build script.
     41  Values for these properties are set by the first place they are
     42  defined, from the following list:
     43
     44  * Definitions on the "ant" command line (ant -Dfoo=bar compile).
     45
     46  * Definitions from a "build.properties" file in the top level
     47    source directory of this application.
     48
     49  * Definitions from a "build.properties" file in the developer's
     50    home directory.
     51
     52  * Default definitions in this build.xml file.
     53
     54  You will note below that property values can be composed based on the
     55  contents of previously defined properties.  This is a powerful technique
     56  that helps you minimize the number of changes required when your development
     57  environment is modified.  Note that property composition is allowed within
     58  "build.properties" files as well as in the "build.xml" script.
     59
     60-->
     61
     62  <property file="build.properties"/>
     63  <property file="${user.home}/build.properties"/>
     64
     65  <property name="src.home" value="${basedir}/src/java"/>
     66  <property name="packages.home" value="${basedir}/packages"/>
     67  <property name="javalib" value="lib/java"/>
     68  <property name="web.home" value="${basedir}/web"/>
     69  <property name="web.lib" value="${web.home}/lib"/>
     70  <property name="web.classes" value="${web.home}/WEB-INF/classes"/>
     71 
     72  <property name="javadocs" value="docs/javadoc"/>
     73
     74  <property name="app.name"      value="gsdl3"/>
     75  <property name="app.path"      value="/${app.name}"/>
     76  <property name="app.version"   value="3.00alpha"/>
     77 
     78  <property name="os.linux" value="Linux"/> <!-- mac??-->
     79  <property name="os.windows" value="Windows 95,Windows 98,Windows 2000,Windows XP, Windows NT,Windows ME"/> <!-- check this!!!-->
     80
     81  <!-- =================== Base dirs for each package ================ -->
     82  <property name="gdbm.home" value="${src.home}/org/greenstone/gdbm"/>
     83  <property name="applet.home" value="${src.home}/org/greenstone/applet"/>
     84  <property name="gsdl3.home" value="${src.home}/org/greenstone/gsdl3"/>
     85  <property name="gs2extra.home" value="${basedir}/gs2extra"/>
     86  <property name="vishnu.home" value="${packages.home}/vishnu"/>
     87  <property name="mg.home" value="${packages.home}/mg"/>
     88  <property name="mgpp.home" value="${packages.home}/mgpp"/>
     89 
     90  <property name="catalina.home" value="${basedir}/comms/jakarta/tomcat"/>
     91
     92<!--  ==================== Compilation Control Options ==================== -->
     93
     94<!--
     95
     96  These properties control option settings on the Javac compiler when it
     97  is invoked using the <javac> task.
     98
     99  compile.debug        Should compilation include the debug option?
     100
     101  compile.deprecation  Should compilation include the deprecation option?
     102
     103  compile.optimize     Should compilation include the optimize option?
     104
     105-->
     106
     107  <property name="compile.debug"       value="true"/>
     108  <property name="compile.deprecation" value="false"/>
     109  <property name="compile.optimize"    value="true"/>
     110
     111<!--
     112
     113  Rather than relying on the CLASSPATH environment variable, Ant includes
     114  features that makes it easy to dynamically construct the classpath you
     115  need for each compilation.  The example below constructs the compile
     116  classpath to include the servlet.jar file, as well as the other components
     117  that Tomcat makes available to web applications automatically, plus anything
     118  that you explicitly added.
     119
     120-->
     121
     122  <path id="compile.classpath">
     123    <!-- Include all jar files in our lib directory -->
     124    <fileset dir="${javalib}">
     125      <include name="*.jar"/>
     126    </fileset>
     127   
     128    <!-- Include all elements that Tomcat exposes to applications -->
     129    <pathelement location="${catalina.home}/common/classes"/>
     130    <fileset dir="${catalina.home}/common/endorsed">
     131      <include name="*.jar"/>
     132    </fileset>
     133    <fileset dir="${catalina.home}/common/lib">
     134      <include name="*.jar"/>
     135    </fileset>
     136    <pathelement location="${catalina.home}/shared/classes"/>
     137    <fileset dir="${catalina.home}/shared/lib">
     138      <include name="*.jar"/>
     139    </fileset>
     140
     141    <!-- Include the axis jar files -->
     142    <fileset dir="${basedir}/comms/axis/lib">
     143      <include name="*.jar"/>
     144    </fileset>
     145  </path>
     146
     147<!-- ==================== All Target ====================================== -->
     148
     149<!--
     150
     151  The "all" target is a shortcut for running the "clean" target followed
     152  by the "compile" target, to force a complete recompile.
     153
     154-->
     155
     156  <target name="all" depends="clean, compile, install"
     157   description="Clean build directory, then compile, then install"/>
     158
     159<!-- ==================== Clean Target ==================================== -->
     160
     161<!--
     162
     163  The "clean" target deletes any previous "build" and "dist" directory,
     164  so that you can be ensured the application can be built from scratch.
     165
     166-->
     167
     168  <target name="clean" depends="clean-packages, clean-gsdl3"
     169    description="Remove all old compiled code - all java classes dirs, and packages object files"/>
     170 
     171  <target name="clean-packages"
     172    description="Remove all old compiled code in the packages dir">
     173    <!-- mg -->
     174    <exec executable="make" os="Linux"
     175      dir="${mg.home}">
     176      <arg value="clean"/>
     177    </exec>
     178    <delete dir="${mg.home}/java/classes"/>
     179    <delete file="${mg.home}/java/mg.jar"/>
     180    <delete file="${mg.home}/jni/org_greenstone_mg_MGWrapper.h"/>
     181    <delete file="${mg.home}/jni/org_greenstone_mg_MGPassesWrapper.h"/>
     182    <!-- mgpp -->
     183    <exec executable="make" os="Linux"
     184      dir="${mg.home}">
     185      <arg value="clean"/>
     186    </exec>
     187    <delete dir="${mgpp.home}/java/classes"/>
     188    <delete file="${mgpp.home}/java/mgpp.jar"/>
     189    <delete file="${mgpp.home}/jni/org_greenstone_mgpp_MGPPWrapper.h"/>
     190    <delete file="${mgpp.home}/jni/org_greenstone_mgpp_MGPPPassesWrapper.h"/>
     191    <!-- vishnu -->
     192    <delete dir="${vishnu.home}/src/classes"/>
     193    <delete file="${vishnu.home}/src/vishnu.jar"/>
     194  </target>
     195 
     196  <target name="clean-gsdl3"
     197    description=" remove compiled code in gsdl3 source">
     198    <delete dir="${applet.home}/phind/classes"/>
     199    <delete file="${applet.home}/phind/phind.jar"/>
     200    <delete dir="${gdbm.home}/classes"/>
     201    <delete file="${gdbm.home}/gdbm.jar"/>
     202    <delete dir="${gsdl3.home}/classes"/>
     203    <delete file="${gsdl3.home}/gsdl3.jar"/>
     204  </target>
     205
     206<!-- ==================== Compile Target ================================== -->
     207
     208<!--
     209
     210  compile up all the source code - includes several targets
     211
     212-->
     213
     214  <target name="compile" depends="compile-packages, compile-gsdl3"
     215    description="Recompile all the source code"/>
     216
     217  <target name="compile-gsdl3"
     218    description="Only compile the greenstone java source">
     219    <!-- org.greenstone.applet -->
     220    <!-- phind applet -->
     221    <echo>Compiling Phind</echo>
     222    <mkdir dir="${applet.home}/phind/classes"/>
     223    <javac srcdir="${src.home}"
     224      destdir="${applet.home}/phind/classes"
     225      debug="${compile.debug}"
     226      deprecation="${compile.deprecation}"
     227      optimize="${compile.optimize}">
     228      <include name="org/greenstone/applet/phind/*.java"/>
     229      <classpath refid="compile.classpath"/>
     230    </javac>
     231    <jar destfile="${applet.home}/phind/phind.jar">
     232      <fileset dir="${applet.home}/phind/classes"/>
     233      <manifest>
     234    <attribute name="Built-By" value="${user.name}" />
     235      </manifest>
     236    </jar>
     237    <!-- org.greenstone.gdbm -->
     238    <echo>Compiling GDBM Wrapper</echo>
     239    <mkdir dir="${gdbm.home}/classes"/>
     240    <javac srcdir="${src.home}"
     241      destdir="${gdbm.home}/classes"
     242      debug="${compile.debug}"
     243      deprecation="${compile.deprecation}"
     244      optimize="${compile.optimize}">
     245      <include name="org/greenstone/gdbm/*.java"/>
     246      <classpath refid="compile.classpath"/>
     247    </javac>
     248    <jar destfile="${gdbm.home}/gdbm.jar">
     249      <fileset dir="${gdbm.home}/classes"/>
     250      <manifest>
     251    <attribute name="Built-By" value="${user.name}" />
     252      </manifest>
     253    </jar>
     254    <!-- org.greenstone.gsdl3 -->
     255    <echo>Compiling gsdl3 source</echo>
     256    <mkdir dir="${gsdl3.home}/classes"/>
     257    <javac srcdir="${src.home}"
     258      destdir="${gsdl3.home}/classes"
     259      debug="${compile.debug}"
     260      deprecation="${compile.deprecation}"
     261      optimize="${compile.optimize}">
     262      <include name="org/greenstone/gsdl3/**"/>
     263      <classpath>
     264    <path refid="compile.classpath"/>
     265    <!-- need to add in gdbm and packages to classpath -->
     266    <pathelement location="${gdbm.home}/gdbm.jar"/>
     267    <pathelement location="${mg.home}/java/mg.jar"/>
     268    <pathelement location="${mgpp.home}/java/mgpp.jar"/>
     269    <pathelement location="${vishnu.home}/vishnu.jar"/>
     270   
     271      </classpath>
     272    </javac>
     273    <jar destfile="${gsdl3.home}/gsdl3.jar">
     274      <fileset dir="${gsdl3.home}/classes"/>
     275      <manifest>
     276    <attribute name="Built-By" value="${user.name}" />
     277      </manifest>
     278    </jar>
     279  </target>
     280
     281  <target name="compile-packages"
     282    description="compile only the packages">
     283    <!-- mg -->
     284    <echo>Compiling MG</echo>
     285    <!-- c code -->
     286    <!-- javacode -->
     287    <mkdir dir="${mg.home}/java/classes"/>
     288    <javac srcdir="${mg.home}/java"
     289      destdir="${mg.home}/java/classes"
     290      debug="${compile.debug}"
     291      deprecation="${compile.deprecation}"
     292      optimize="${compile.optimize}">
     293    </javac>
     294    <javah classpath="${mg.home}/java/classes"
     295      destdir="${mg.home}/jni">
     296      <class name="org.greenstone.mg.MGWrapper"/>
     297      <class name="org.greenstone.mg.MGPassesWrapper"/>
     298    </javah>
     299    <jar destfile="${mg.home}/java/mg.jar">
     300      <fileset dir="${mg.home}/java/classes"/>
     301      <manifest>
     302    <attribute name="Built-By" value="${user.name}" />
     303      </manifest>
     304    </jar>     
     305    <!-- make the c code -->
     306    <exec executable="make" os="Linux"
     307       dir="${mg.home}">
     308    </exec>
     309    <!-- mgpp -->
     310    <echo>Compiling MGPP</echo>
     311    <!-- javacode -->
     312    <mkdir dir="${mgpp.home}/java/classes"/>
     313    <javac srcdir="${mgpp.home}/java"
     314      destdir="${mgpp.home}/java/classes"
     315      debug="${compile.debug}"
     316      deprecation="${compile.deprecation}"
     317      optimize="${compile.optimize}">
     318    </javac>
     319    <javah classpath="${mgpp.home}/java/classes"
     320      destdir="${mgpp.home}/jni">
     321      <class name="org.greenstone.mgpp.MGPPWrapper"/>
     322      <class name="org.greenstone.mgpp.MGPPPassesWrapper"/>
     323    </javah>
     324    <jar destfile="${mgpp.home}/java/mgpp.jar">
     325      <fileset dir="${mgpp.home}/java/classes"/>
     326      <manifest>
     327    <attribute name="Built-By" value="${user.name}" />
     328      </manifest>
     329    </jar>     
     330    <!-- c++ code -->
     331    <exec executable="make" os="Linux"
     332       dir="${mgpp.home}">
     333    </exec>
     334   
     335    <!-- vishnu -->
     336    <echo>Compiling Vishnu</echo>
     337    <mkdir dir="${vishnu.home}/classes"/>
     338    <javac srcdir="${vishnu.home}/src"
     339      destdir="${vishnu.home}/classes"
     340      debug="${compile.debug}"
     341      deprecation="${compile.deprecation}"
     342      optimize="${compile.optimize}">
     343      <classpath>
     344    <path refid="compile.classpath"/>
     345    <pathelement location="${mg.home}/java/mg.jar"/>
     346      </classpath>
     347    </javac>
     348    <jar destfile="${vishnu.home}/vishnu.jar">
     349      <fileset dir="${vishnu.home}/classes"/>
     350      <manifest>
     351    <attribute name="Built-By" value="${user.name}" />
     352      </manifest>
     353    </jar>     
     354  </target>
     355
     356 
     357<!-- ==================== Install Target ================================== -->
     358   
     359  <target name="install" depends="install-packages, install-gsdl3"
     360    description="install all binaries"/>
     361  <target name="install-packages" depends="compile-packages"
     362    description="">
     363    <!-- mg -->
     364    <copy file="${mg.home}/java/mg.jar" todir="${javalib}"/>
     365    <exec executable="make" os="Linux"
     366      dir="${mg.home}">
     367      <arg value="install"/>
     368    </exec>
     369
     370    <!-- mgpp -->
     371    <copy file="${mgpp.home}/java/mgpp.jar" todir="${javalib}"/>
     372    <exec executable="make" os="Linux"
     373      dir="${mg.home}">
     374      <arg value="install"/>
     375    </exec>
     376    <!-- vishnu -->
     377    <copy file="${vishnu.home}/vishnu.jar" todir="${javalib}"/>
     378    <copy file="${vishnu.home}/vishnu.jar" todir="${web.lib}"/>
     379    <mkdir dir="${web.classes}/vishnu/server"/>
     380    <copy file="${vishnu.home}/classes/vishnu/server/VisServlet.class"
     381      todir="${web.classes}/vishnu/server"/>
     382   
     383  </target>
     384
     385  <target name="install-gsdl3" depends="compile-gsdl3" description="install all teh compiled code - jar files and library files">
     386    <!-- org.greenstone.gdbm -->
     387    <copy file="${gdbm.home}/gdbm.jar" todir="${javalib}"/>
     388    <!-- org.greenstone.applet -->
     389    <copy file="${applet.home}/phind/phind.jar" todir="${javalib}"/>
     390    <copy file="${applet.home}/phind/phind.jar" todir="${web.lib}"/>
     391
     392    <!-- org.greenstone.gsdl3 -->
     393    <copy file="${gsdl3.home}/gsdl3.jar" todir="${javalib}"/>
     394    <copy file="${gsdl3.home}/gsdl3.jar" todir="${web.lib}"/>
     395    <mkdir dir="${web.classes}/org/greenstone/gsdl3"/>
     396    <copy file="${gsdl3.home}/classes/org/greenstone/gsdl3/LibraryServlet.class"
     397      todir="${web.classes}/org/greenstone/gsdl3"/>
     398  </target>
     399
     400<!-- ===================== setup target ===================== -->
     401  <target name="accept-properties">
     402    <input addproperty="properties.ok" validargs="y,n">The following properties are being used from a build.properties file found in this directory:
     403tomcat.servername=${tomcat.servername}, tomcat.port=${tomcat.port}, gsdl.path=${gsdl.path} (this is the location of Greenstone 2 if you have it).
     404If these are not acceptable, please change them and rerun this target. Continue [y/n]?" />
     405    </input>
     406    <condition property="do.abort">
     407      <equals arg1="n" arg2="${properties.ok}"/>
     408    </condition>
     409    <fail if="do.abort">Build aborted by user. Please change your properties settings and re-run the target</fail>
     410  </target>
     411
     412  <!-- this sets up some initial properties -->
     413  <target name="init">
     414
     415    <condition property="java.too.old">
     416      <or>
     417    <equals arg1="1.1" arg2="${ant.java.version}"/>
     418    <equals arg1="1.2" arg2="${ant.java.version}"/>
     419    <equals arg1="1.3" arg2="${ant.java.version}"/>
     420      </or>
     421    </condition>
     422    <fail if="java.too.old" message="You need Java 1.4 or greater to run Greenstone 3"/>
     423   
     424    <available file="${basedir}/packages/mgpp" property="mgpp.present"/>
     425    <available file="${basedir}/comms/jakarta/tomcat" property="tomcat.present"/>
     426    <available file="${basedir}/gli" property="gli.present"/>
     427    <available file="${basedir}/gs2build" property="gs2build.present"/>
     428    <available file="${basedir}/comms/axis" property="axis.present"/>
     429    <condition property="gsdl2.islocal">
     430      <or>
     431    <not>
     432      <isset property="gsdl.path"/>
     433    </not>
     434    <equals arg1="" arg2="${gsdl.path}"/>
     435      </or>
     436    </condition>
     437   
     438    <echo>tomcat.port:${tomcat.port}, gli.present:${gli.present} gsdlislocal=${gsdl2.islocal} gs2build.present=${gs2build.present} gsdl.path = ${gsdl.path}</echo>
     439    <condition property="proxy.present">
     440      <not>
     441    <equals arg1="" arg2="${proxy.host}"/>
     442      </not>
     443    </condition>
     444  </target>
     445
     446  <target name="setup-proxy" depends="init" if="proxy.present">
     447    <condition property="ask.user">
     448      <or>
     449    <equals arg1="" arg2="${proxy.user}"/>
     450    <equals arg1="" arg2="${proxy.password}"/>
     451      </or>
     452    </condition>
     453    <getuserandpassword message="Using proxy: ${proxy.host}:${proxy.port}" if="ask.user" username="${proxy.user}"/>
     454    <mysetproxy proxyhost="${proxy.host}" proxyport="${proxy.port}" proxyuser="${proxy.user}" proxypassword="${proxy.password}"/>
     455  </target>
     456
     457  <target name="test-classpath">
     458    <echo>${java.class.path}</echo>
     459  </target>
     460 
     461  <!-- this is all the do-once things -->
     462  <target name="preparation" depends="init,prepare-mgpp,prepare-gs2building,prepare-tomcat,prepare-axis,unpack-collections">
     463  </target>
     464 
     465  <!-- this is config stuff, that can be done more than once - should be rerun is the build.properties file changes -->
     466  <target name="configuration" depends="init,configure-tomcat,configure-files"/>
     467 
     468  <target name="configure-files" depends="init">
     469    <filter token="port" value="${tomcat.port}"/>
     470    <filter token="hostname" value="${tomcat.server}"/>
     471    <filter token="gsdl3home" value="${basedir}"/>
     472    <copy file="${basedir}/web/WEB-INF/web.xml.in" tofile="${basedir}/web/WEB-INF/web.xml" filtering="true"/>
     473    <copy file="${basedir}/web/sites/localsite/siteConfig.xml.in" tofile="${basedir}/web/sites/localsite/siteConfig.xml" filtering="true"/>
     474    <copy file="${basedir}/web/sites/gateway/siteConfig.xml.in" tofile="${basedir}/web/sites/gateway/siteConfig.xml" filtering="true"/>
     475    <!--<copy file="${basedir}/resources/java/SOAPServer.cfg.in" tofile="${basedir}/resources/java/SOAPServer.cfg" filtering="true"/>-->
     476
     477  </target>
     478
     479  <target name="gsdl3-install" depends="accept-properties,init,preparation,configuration,all" description="setup the gsdl3 stuff to start with">
     480  </target>
     481
     482  <target name="configure-packages" description="configure any C/C++ packages. this is used on initial set up, but not again. You can force this by calling this target">
     483    <echo>
     484      Configuring MG
     485    </echo>
     486    <exec executable="configure" os="Linux"
     487      dir="${mg.home}">
     488      <arg value="--prefix=${basedir}"/>
     489    </exec>   
     490    <echo>
     491      Configuring MGPP
     492    </echo>
     493    <exec executable="configure" os="Linux"
     494      dir="${mgpp.home}">
     495      <arg value="--prefix=${basedir}"/>
     496    </exec>
     497  </target>
     498
     499  <target name="update-cvs" description="update all the sources">
     500    <cvs command="update -dP"/>
     501    <cvs command="update -dP" dest="${basedir}/gli"/>
     502   
     503    </target>
     504
     505
     506  <!-- ================== targets to handle gs2 building stuff ===============-->
     507
     508  <!-- used on install -->
     509  <target name="get-gs2build" if="getgsdl2" >
     510    <echo>getting gs2 stuff</echo>
     511    <!---->
     512    <antcall target="compile-gs2build"/>
     513    </target>
     514
     515
     516  <target name="update-gs2build" description="Use this to update your Greenstone 2 building stuff - only use if you specified that you didn't have greenstone 2 installed. Will do a cvs update on the gli and gs2build subdirectories, and thenmake clean and make.">
     517    <!-- gli -->
     518    <cvs command="update -dP" dest="${basedir}/gli"/>
     519    <!-- gs2build -->
     520    <!-- Note: can't do a -d update here cos it will get all of gsdl-->
     521    <cvs command="update -P" dest="${basedir}/gs2build"/>
     522    <antcall target="compile-gs2build"/>
     523  </target>
     524 
     525  <target name="compile-gs2build" >
     526    <!-- gli -->
     527    <property name="gli.home" value="${basedir}/gli"/>
     528    <!-- linux -->
     529    <exec executable="clean.sh" os="${os.linux}" dir="${gli.home}"
     530      resolveExecutable="true"/>
     531    <exec executable="makegli.sh" os="${os.linux}" dir="${gli.home}"
     532      resolveExecutable="true"/>
     533    <!-- windows -->
     534    <exec executable="clean.bat" os="${os.windows}" dir="${gli.home}"
     535      resolveExecutable="true"/>
     536    <exec executable="makegli.bat" os="${os.windows}" dir="${gli.home}"
     537      resolveExecutable="true"/>
     538    <!-- gs2build -->
     539    <!--linux: configure, make clean, make, make install-->
     540    <property name="gs2build.home" value="${basedir}/gs2build"/>
     541    <exec executable="${gs2build.home}/configure" os="${os.linux}"
     542      dir="${gs2build.home}">
     543      <arg value="--prefix=${gs2build.home}"/>
     544    </exec>
     545    <exec executable="make" os="${os.linux}" dir="${gs2build.home}">
     546      <arg value="clean"/>
     547    </exec>
     548    <exec executable="make" os="${os.linux}" dir="${gs2build.home}">
     549    </exec>
     550    <exec executable="make" os="${os.linux}" dir="${gs2build.home}">
     551      <arg value="install"/>
     552    </exec>
     553
     554    <!-- windows: -->
     555  </target>
     556
     557<!-- ============ targets that should only be called once =========== -->
     558
     559  <target name="prepare-mgpp" depends="init" unless="mgpp.present">
     560    <cvs command="checkout -P" package="mgpp" dest="${basedir}/packages/"/>
     561  </target>
     562
     563  <target name="prepare-tomcat" depends="init,setup-proxy" unless="tomcat.present">
     564    <get src="http://www.greenstone.org/gs3files/jakarta-tomcat-5.5.7.zip"
     565      dest="${basedir}/comms/jakarta/jakarta-tomcat-5.5.7.zip"/>
     566    <unzip src="${basedir}/comms/jakarta/jakarta-tomcat-5.5.7.zip"
     567      dest="${basedir}/comms/jakarta"/>
     568    <condition property="need.tomcat.compat">
     569      <equals arg1="1.4" arg2="${ant.java.version}"/>
     570    </condition>
     571    <antcall target="install-tomcat-compat"/>
     572    <move todir="${basedir}/comms/jakarta/tomcat">
     573      <fileset dir="${basedir}/comms/jakarta/jakarta-tomcat-5.5.7"/>
     574    </move>
     575    <!-- make sure we have execute permission for the .sh files -->
     576    <chmod dir="${basedir}/comms/jakarta/tomcat/bin" perm="ugo+rx"
     577      includes="*.sh"/>
     578  </target>
     579
     580 
     581  <target name="prepare-tomcat-compat" if="need.tomcat.compat">
     582    <get src="http://www.greenstone.org/gs3files/jakarta-tomcat-5.5.7-compat.zip"
     583      dest="${basedir}/comms/jakarta/jakarta-tomcat-5.5.7-compat.zip"/>
     584    <unzip src="${basedir}/comms/jakarta/jakarta-tomcat-5.5.7-compat.zip"
     585      dest="${basedir}/comms/jakarta"/>
     586  </target>
     587 
     588  <target name="configure-tomcat" depends="init" if="tomcat.present">
     589    <!-- re-setup the server.xml file -->
     590    <copy file="${basedir}/comms/jakarta/server.xml.in" tofile="${basedir}/comms/jakarta/tomcat/conf/server.xml" overwrite="true">
     591      <filterset>
     592    <filter token="port" value="${tomcat.port}"/>
     593    <filter token="gsdl3home" value="${basedir}"/>
     594      </filterset>
     595    </copy>
     596  </target>
     597 
     598  <target name="prepare-axis" depends="init" unless="axis.present">
     599    <get src="http://www.greenstone.org/gs3files/axis-1_1.zip"
     600      dest="${basedir}/comms/axis-1_1.zip"/>
     601    <unzip src="${basedir}/comms/axis-1_1.zip"
     602      dest="${basedir}/comms/"/>
     603    <move todir="${basedir}/comms/axis">
     604      <fileset dir="${basedir}/comms/axis-1_1"/>
     605    </move>
     606
     607  </target>
     608 
     609  <target name="prepare-gs2building" depends="init, prepare-gs2build,prepare-gli" if="gsdl2.islocal">
     610    <echo>checking out gs2 building stuff</echo>
     611  </target>
     612
     613  <target name="prepare-gs2build" depends="init" if="gsdl2.islocal" unless="gs2build.present">
     614    <echo>checking out gs2build</echo>
     615    <cvs command="co -P" package="gs2build"/>
     616    <property name="gs2build.home" value="${basedir}/gs2build"/>
     617
     618    <!-- rename the .gs2build files -->
     619    <move file="${gs2build.home}/configure.gs2build" tofile="${gs2build.home}/configure"/>   
     620    <move file="${gs2build.home}/configure.in.gs2build" tofile="${gs2build.home}/configure.in"/>
     621    <move file="${gs2build.home}/Makefile.in.gs2build" tofile="${gs2build.home}/Makefile.in"/> 
     622    <move file="${gs2build.home}/packages/configure.gs2build" tofile="${gs2build.home}/packages/configure"/>
     623    <move file="${gs2build.home}/packages/Makefile.gs2build" tofile="${gs2build.home}/packages/Makefile"/>
     624    <move file="${gs2build.home}/lib/Makefile.in.gs2build" tofile="${gs2build.home}/lib/Makefile.in"/> 
     625  </target>
     626
     627  <target name="prepare-gli" depends="init" if="gsdl2.islocal" unless="gli.present">
     628    <echo>checking out gli</echo>
     629    <cvs command="co -P" package="gli"/>
     630  </target>
     631
     632  <target name="unpack-collections">
     633    <property name="collect.dir" value="${basedir}/web/sites/localsite/collect"/>
     634    <!-- gs3mgdemo -->
     635    <unzip src="${collect.dir}/gs3mgdemo/import.zip"
     636      dest="${collect.dir}/gs3mgdemo"/>
     637    <unzip src="${collect.dir}/gs3mgdemo/archives.zip"
     638      dest="${collect.dir}/gs3mgdemo"/>
     639    <unzip src="${collect.dir}/gs3mgdemo/index/index.zip"
     640      dest="${collect.dir}/gs3mgdemo/index"/>
     641    <!-- gs2mgdemo -->
     642    <unzip src="${collect.dir}/gs2mgdemo/import.zip"
     643      dest="${collect.dir}/gs2mgdemo"/>
     644    <unzip src="${collect.dir}/gs2mgdemo/metadata.zip"
     645      dest="${collect.dir}/gs2mgdemo"/>
     646    <unzip src="${collect.dir}/gs2mgdemo/index/index.zip"
     647      dest="${collect.dir}/gs2mgdemo/index"/>
     648    <!-- gs2mgppdemo -->
     649    <unzip src="${collect.dir}/gs2mgppdemo/import.zip"
     650      dest="${collect.dir}/gs2mgppdemo"/>
     651    <unzip src="${collect.dir}/gs2mgppdemo/metadata.zip"
     652      dest="${collect.dir}/gs2mgppdemo"/>
     653    <unzip src="${collect.dir}/gs2mgppdemo/index/index.zip"
     654      dest="${collect.dir}/gs2mgppdemo/index"/>
     655    <!-- gberg -->
     656    <unzip src="${collect.dir}/gberg/index/index.zip"
     657      dest="${collect.dir}/gberg/index"/>
     658  </target>
     659 
     660  <target name="reload" description="Reload web application"
     661          depends="">
     662    <reload  url="http://kanuka:7070/manager" username="admin" password="admin"
     663            path="/gsdl3"/>
     664  </target>
    50665</project>
    51666
     667
Note: See TracChangeset for help on using the changeset viewer.