Changeset 13664


Ignore:
Timestamp:
Aug 24, 2005, 4:28:49 AM (14 years ago)
Author:
jberry
Message:

Revisions to tomcat5 to make it possible to run it under JDK 5.0

Location:
trunk/dports/java/tomcat5
Files:
1 added
4 edited

Legend:

Unmodified
Added
Removed
  • trunk/dports/java/tomcat5/Portfile

    r11924 r13664  
    1 # $Id: Portfile,v 1.17 2005/04/20 21:49:18 jberry Exp $
     1# $Id: Portfile,v 1.18 2005/08/24 04:28:49 jberry Exp $
    22
    33PortSystem 1.0
     
    55name                            tomcat5
    66version                         5.5.9
     7revision                        1
    78
    89categories                      java www
     
    7172
    7273build.cmd                       ant
    73 build.target            download dist
     74build.target            download dist compat
    7475build.args                      [join "
    7576                                        -Dbase.path=${worksrcpath}/Repository
     
    99100                                        "]
    100101
    101 default_variants        +compat
    102 
    103 # This variant provides compatibility with pre-JRE 1.5 systems
    104 variant compat {
    105         build.target-append compat
     102# Remove compatibility for pre-JRE 1.5 systems
     103variant nocompat {
     104        build.target-delete compat
    106105}
    107106
     
    129128       
    130129        # Add compat files as needed
    131         if { [variant_isset compat] } {
     130        if { ! [variant_isset nocompat] } {
    132131                system "tar -cf - -C ${worksrcpath}/compat . | tar xpf - -C ${target}"
    133132        }
     
    156155                ${filespath}/setenv.sh \
    157156                ${target}/bin
     157        xinstall -m 755 \
     158                ${filespath}/setenv.local
     159                ${target}/conf
    158160       
    159161        # Don't install startup script, as we're now generating a startupitem
     
    178180                                tomcat-users.xml
    179181                                web.xml
     182                                setenv.local
    180183                                " {
    181184                file rename ${target}/conf/${f} ${target}/conf/${f}.sample
     
    212215        ui_msg "# jsvc will drop its root privileges and run as user ${tomcatuser}."
    213216        ui_msg "#"
     217        ui_msg "# Under Apple Java, control over the Java version used to launch ${name} is"
     218        ui_msg "# through the shell variable JAVA_JVM_VERSION. This variable should be set"
     219        ui_msg "# to a java version such as 1.4, 1.5, or CurrentJDK (for the default version)."
     220        ui_msg "# You may set JAVA_JVM_VERSION in ${prefix}/${home}/bin/setenv.sh."
     221        ui_msg "#"
    214222}
    215223
  • trunk/dports/java/tomcat5/files/conf_setup.sh

    r9016 r13664  
    2525fi
    2626
     27CONF_FILES=" \
     28        conf/catalina.policy \
     29        conf/catalina.properties \
     30        conf/server.xml \
     31        conf/tomcat-users.xml \
     32        conf/web.xml \
     33        conf/setenv.local \
     34        "
     35
    2736# Try to repair any needed files in conf
    28 for FILE in conf/catalina.policy conf/catalina.properties conf/server.xml conf/tomcat-users.xml conf/web.xml; do
     37for FILE in $CONF_FILES; do
    2938        SAMPLE="${FILE}.sample"
    3039        if [ ! -f "${CATALINA_BASE}/${FILE}" ]; then
  • trunk/dports/java/tomcat5/files/setenv.sh

    r8863 r13664  
    11#!/bin/sh
     2#
     3# setenv.sh
     4#
     5# You may edit this script to set defaults for such variables as JAVA_HOME.
     6#
     7# For Apple Java, the $JAVA_HOME is not well respected by the JNI launching code
     8# in jsvc. On Apple Java systems, you are better off setting JAVA_JVM_VERSION
     9# to the proper java name, such as 1.4, 1.5, or CurrentJDK, and let JAVA_HOME
     10# be calculated from that.
     11#
     12
     13# First source the conf/setenv.local file to allow user to configure environment
     14# in an even more minimal fashion.
     15if [ -r "$CATALINA_HOME/conf/setenv.local" ]; then
     16    . "$CATALINA_HOME/conf/setenv.local"
     17fi
    218
    319# Attempt to set JAVA_HOME if it's not already set
    420if [ -z "$JAVA_HOME" ]; then
    521       
    6         # Set JAVA_HOME for Darwin
     22        # Set JAVA_JVM_VERSION and JAVA_HOME for Darwin
    723        if [ `uname -s` = "Darwin" ]; then
    8                
    9                 [ -z "$JAVA_HOME" -a -d "/Library/Java/Home" ] &&
    10                         export JAVA_HOME="/Library/Java/Home"
    11                        
    12                 [ -z "$JAVA_HOME" -a -d "/System/Library/Frameworks/JavaVM.framework/Home" ] &&
    13                         export JAVA_HOME="/System/Library/Frameworks/JavaVM.framework/Home"
     24       
     25                # To specify that a particular Java version be run, set it here
     26                #export JAVA_JVM_VERSION=1.5
     27       
     28                # Look for a java version specified by JAVA_JVM_VERSION, falling back to current version
     29                # Set JAVA_HOME to reflect the version
     30                for jversion in $JAVA_JVM_VERSION CurrentJDK ; do
     31                        jhome="/System/Library/Frameworks/JavaVM.framework/Versions/${jversion}/Home"
     32                        if [ -z "$JAVA_HOME" -a -d "${jhome}" ]; then
     33                                export JAVA_JVM_VERSION=${jversion}
     34                                export JAVA_HOME=${jhome}
     35                        fi
     36                done
    1437               
    1538        fi
  • trunk/dports/java/tomcat5/files/tomcatctl

    r9016 r13664  
    1616#JSVC_ENV=
    1717#JSVC_DEBUG="-debug -verbose"
     18
    1819
    1920# Calculate CATALINA_HOME based on our location
     
    4243fi
    4344
    44 # Source the setclasspath.sh file to allow setup the CLASSPATH variable
     45# Source the setclasspath.sh file to allow setup of the CLASSPATH variable
    4546BASEDIR="$CATALINA_HOME"
    4647. "$CATALINA_HOME/bin/setclasspath.sh"
     
    6061
    6162CLASSPATH="$CLASSPATH":"$CATALINA_HOME"/bin/bootstrap.jar:"$CATALINA_HOME"/bin/commons-logging-api.jar
     63
     64if [ -r "${CATALINA_HOME}/bin/tomcat-juli.jar" ]; then
     65  JAVA_OPTS="$JAVA_OPTS -Djava.util.logging.manager=org.apache.juli.ClassLoaderLogManager"
     66fi
    6267
    6368usage()
     
    108113       
    109114        # Start Tomcat using jsvc
    110         $JSVC_ENV $JSVC $JSVC_DEBUG $JPDA_OPTS \
     115        $JSVC_ENV $JSVC $JSVC_DEBUG $JAVA_OPTS $JPDA_OPTS \
    111116            -home "$JAVA_HOME" \
    112117            -user "$TOMCAT_USER" \
     
    213218CLASSPATH           $CLASSPATH
    214219TOMCAT_PIDFILE      $TOMCAT_PIDFILE
     220JAVA_OPTS           $JAVA_OPTS
    215221JPDA_OPTS           $JPDA_OPTS
    216222EOT
Note: See TracChangeset for help on using the changeset viewer.