Show
Ignore:
Timestamp:
24.07.2009 16:10:19 (10 years ago)
Author:
ak19
Message:

Changes made to work on Vista which requires Tomcat 6 for Remote Greenstone3 to work and which, in turn, requires Java 5.

Files:
1 modified

Legend:

Unmodified
Added
Removed
  • greenstone3/trunk/build.xml

    r20051 r20079  
    7676     
    7777  <!-- version properties for external packages --> 
    78   <property name="tomcat.version" value="apache-tomcat-5.5.25"/> 
     78  <!-- for Java versions < 1.4, we print out the message that Java is too old. 
     79    For Java 1.4, we use Tomcat 5.5, for Java5 and higher, we use Tomcat 6.0--> 
     80  <condition property="tomcat.version" value="apache-tomcat-5.5.25" else="apache-tomcat-6.0.20">  
     81    <equals arg1="1.4" arg2="${ant.java.version}"/> 
     82  </condition> 
     83  <condition property="tomcat.version.major" value="5" else="6">  
     84    <equals arg1="1.4" arg2="${ant.java.version}"/> 
     85  </condition> 
    7986  <property name="axis.zip.version" value="axis-bin-1_2_1.zip"/> 
    8087  <property name="axis.dir.version" value="axis-1_2_1"/> 
     
    266273 
    267274  --> 
    268  
     275   
     276  <!-- All elements that Tomcat 5 exposes to applications --> 
     277  <path id="tomcat5"> 
     278    <pathelement location="${catalina.home}/common/classes"/> 
     279    <fileset dir="${catalina.home}/common/endorsed"> 
     280      <include name="*.jar"/> 
     281    </fileset> 
     282    <fileset dir="${catalina.home}/common/lib"> 
     283      <include name="*.jar"/> 
     284    </fileset> 
     285    <!-- seems to be empty, but will leave in just in case some people make use of this to customise their install: --> 
     286    <pathelement location="${catalina.home}/shared/classes"/> 
     287    <fileset dir="${catalina.home}/shared/lib"> 
     288      <include name="*.jar"/> 
     289    </fileset> 
     290  </path> 
     291   
     292  <!-- All elements that Tomcat 6 exposes to applications --> 
     293  <path id="tomcat6"> 
     294    <fileset dir="${catalina.home}/lib"> 
     295      <include name="*.jar"/> 
     296    </fileset> 
     297  </path> 
     298   
    269299  <path id="compile.classpath"> 
    270300    <!-- Include all jar files and libraries in our jni lib directory --> 
     
    290320    <pathelement location="${lib.jni}/mgpp.jar"/> 
    291321     
    292     <!-- Include all elements that Tomcat exposes to applications --> 
    293     <pathelement location="${catalina.home}/common/classes"/> 
    294     <fileset dir="${catalina.home}/common/endorsed"> 
    295       <include name="*.jar"/> 
    296     </fileset> 
    297     <fileset dir="${catalina.home}/common/lib"> 
    298       <include name="*.jar"/> 
    299     </fileset> 
    300     <pathelement location="${catalina.home}/shared/classes"/> 
    301     <fileset dir="${catalina.home}/shared/lib"> 
    302       <include name="*.jar"/> 
    303     </fileset> 
     322    <!-- Include all elements that Tomcat exposes to applications --> 
     323    <path refid="tomcat${tomcat.version.major}"/> 
     324 
    304325  </path> 
    305326 
     
    527548    <echo>activating xalan.jar</echo> 
    528549    <copy file="${web.lib}/xalan.jar.tmp" tofile="${web.lib}/xalan.jar"/> 
    529     <if><bool><isset property="current.os.ismac"/></bool> 
    530       <copy file="${web.lib}/xalan.jar.tmp" tofile="${catalina.home}/common/endorsed/xalan.jar"/>  
     550    <if> 
     551      <bool> 
     552        <and> 
     553          <isset property="current.os.ismac"/> 
     554          <available file="${catalina.home}/common/endorsed" type="dir"/> 
     555        </and> 
     556      </bool> 
     557      <copy file="${web.lib}/xalan.jar.tmp" tofile="${catalina.home}/common/endorsed/xalan.jar"/>  
    531558    </if> 
    532559  </target> 
     
    632659  <!-- we download tomcat and the compat module - its needed for 1.4, and doesn't seem to harm 1.5 --> 
    633660  <target name="prepare-tomcat" depends="init,setup-proxy" if="tomcat.islocal"> 
    634  
    635661    <if> 
    636662      <bool> 
     
    645671      <unzip src="${packages.home}/${tomcat.version}.zip"  
    646672        dest="${packages.home}"/> 
    647       <get src="http://www.greenstone.org/gs3files/${tomcat.version}-compat.zip" 
    648         dest="${packages.home}/${tomcat.version}-compat.zip" 
    649         usetimestamp="true"/> 
    650       <unzip src="${packages.home}/${tomcat.version}-compat.zip"  
    651         dest="${packages.home}"/> 
     673     
     674        <!-- If we are using Java 1.4, we'd be using tomcat 5.5 in which case  
     675        we would need to have the tomcat compat package to work with Java 1.4--> 
     676      <if> 
     677        <bool><equals arg1="1.4" arg2="${ant.java.version}"/></bool> 
     678          <get src="http://www.greenstone.org/gs3files/${tomcat.version}-compat.zip" 
     679            dest="${packages.home}/${tomcat.version}-compat.zip" 
     680            usetimestamp="true"/> 
     681        <unzip src="${packages.home}/${tomcat.version}-compat.zip"  
     682            dest="${packages.home}"/> 
     683      </if> 
     684     
    652685      <!-- delete any existing tomcat --> 
    653686      <delete dir="${packages.home}/tomcat"/> 
     
    683716  <target name="configure-tomcat-local" depends="init" if="tomcat.islocal"> 
    684717    <!-- re-setup the server.xml file --> 
    685     <copy file="${basedir}/resources/tomcat/server.xml" tofile="${packages.home}/tomcat/conf/server.xml" overwrite="true"> 
     718    <copy file="${basedir}/resources/tomcat/server_tomcat${tomcat.version.major}.xml" 
     719        tofile="${packages.home}/tomcat/conf/server.xml" overwrite="true"> 
    686720      <filterset> 
    687721        <filter token="port" value="${tomcat.port}"/> 
     
    797831  </target> 
    798832 
    799   <!-- ======================= Axis Targets ============================ -->  
    800  
     833  <!-- ======================= Axis Targets ============================ -->   
     834   
    801835  <target name="prepare-axis" depends="init"> 
    802836 
     
    9841018  <target name="compile-core" depends="init"  
    9851019    description="Compile only the Greenstone core"> 
     1020    <if> 
     1021      <!-- Rather than test for tomcat 6, testing here for NOT tomcat 5  
     1022        (so that it may hopefully still serve when it becomes tomcat 7) --> 
     1023      <bool><not><equals arg1="5" arg2="${tomcat.version.major}"/></not></bool> 
     1024        <copy file="${web.lib}/xercesImpl.jar" todir="${catalina.home}/lib"/> 
     1025        <copy file="${web.lib}/xml-apis.jar" todir="${catalina.home}/lib"/> 
     1026    </if> 
    9861027    <mkdir dir="${build.home}"/> 
    9871028    <javac srcdir="${src.home}" 
     
    10321073    <if> 
    10331074      <bool><istrue value="${tomcat.islocal}"/></bool> 
    1034       <copy file="${packages.home}/tomcat/common/endorsed/xercesImpl.jar" todir="${web.applet}"/> 
    1035       <copy file="${packages.home}/tomcat/common/endorsed/xml-apis.jar" todir="${web.applet}"/> 
     1075        <copy file="${web.lib}/xercesImpl.jar" todir="${web.applet}"/> 
     1076        <copy file="${web.lib}/xml-apis.jar" todir="${web.applet}"/> 
    10361077    </if> 
    10371078