require apache-commons-daemon and apache-commons-daemon-jsvc [release 7.0.103-2mamba;Thu May 21 2020]

This commit is contained in:
Silvan Calarco 2024-01-05 20:29:31 +01:00
parent 33bb120149
commit 6d207572f0
26 changed files with 133 additions and 2551 deletions

View File

@ -1,182 +0,0 @@
# -----------------------------------------------------------------------------
# Licensed to the Apache Software Foundation (ASF) under one or more
# contributor license agreements. See the NOTICE file distributed with
# this work for additional information regarding copyright ownership.
# The ASF licenses this file to You under the Apache License, Version 2.0
# (the "License"); you may not use this file except in compliance with
# the License. You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
# -----------------------------------------------------------------------------
# build.properties.sample
#
# This is an example "build.properties" file, used to customize building
# Tomcat for your local environment. It defines the location of all external
# modules that Tomcat depends on. Copy this file to "build.properties"
# in the top-level source directory, and customize it as needed.
#
# $Id: build.properties.default 1075337 2011-02-28 14:13:37Z markt $
# -----------------------------------------------------------------------------
# ----- Version Control Flags -----
version.major=7
version.minor=0
version.build=9
version.patch=0
version.suffix=
# ----- Build control flags -----
# Note enabling validation uses Checkstyle which is LGPL licensed
execute.validate=false
execute.test.bio=true
execute.test.nio=true
# Still requires APR/native library to be present
execute.test.apr=true
test.haltonfailure=false
# ----- Default Base Path for Dependent Packages -----
# Please note this path must be absolute, not relative,
# as it is referenced with different working directory
# contexts by the various build scripts.
base.path=/usr/share/java
#base.path=C:/path/to/the/repository
#base.path=/usr/local
compile.source=1.6
compile.target=1.6
compile.debug=true
base-apache.loc.1=http://www.apache.org/dist
base-apache.loc.2=http://archive.apache.org/dist
base-commons.loc.1=${base-apache.loc.1}/commons
base-commons.loc.2=${base-apache.loc.2}/commons
base-tomcat.loc.1=${base-apache.loc.1}/tomcat
base-tomcat.loc.2=${base-apache.loc.2}/tomcat
base-sf.loc=http://downloads.sourceforge.net
base-maven.loc=http://repo2.maven.org/maven2
# Mirror, was used when there were problems with the main SF downloads site
# base-sf.loc=http://sunet.dl.sourceforge.net
# ----- Commons Logging, version 1.1 or later -----
# If this version is updated, check the versions required for the deps
# - avalon-framework
# - log4j
# - logkit
# - servletapi
#commons-logging.version=1.1.1
#commons-logging.home=${base.path}/commons-logging-${commons-logging.version}
#commons-logging-src.loc.1=${base-commons.loc.1}/logging/source/commons-logging-${commons-logging.version}-src.tar.gz
#commons-logging-src.loc.2=${base-commons.loc.2}/logging/source/commons-logging-${commons-logging.version}-src.tar.gz
#commons-logging-src.tar.gz=${commons-logging.home}/commons-logging-${commons-logging.version}-src.tar.gz
# ----- Avalon Framework (required by commons logging) -----
#avalon-framework.version=4.1.3
#avalon-framework.home=${base.path}/avalon-framework-${avalon-framework.version}
#avalon-framework.loc=${base-maven.loc}/avalon-framework/avalon-framework/${avalon-framework.version}/avalon-framework-${avalon-framework.version}.jar
avalon-framework.jar=${base.path}/excalibur/avalon-framework.jar
# ----- log4j (required by commons logging) -----
#log4j.version=1.2.12
#log4j.home=${base.path}/log4j-${log4j.version}
#log4j.loc=${base-maven.loc}/log4j/log4j/${log4j.version}/log4j-${log4j.version}.jar
log4j.jar=${base.path}/log4j.jar
# ----- logkit (required by commons logging) -----
#logkit.version=1.0.1
#logkit.home=${base.path}/logkit-${logkit.version}
#logkit.loc=${base-maven.loc}/logkit/logkit/${logkit.version}/logkit-${logkit.version}.jar
logkit.jar=${base.path}/excalibur/avalon-logkit.jar
# ----- servletapi (required by commons logging) -----
#servletapi.version=2.3
#servletapi.home=${base.path}/servletapi-${servletapi.version}
#servletapi.loc=${base-maven.loc}/servletapi/servletapi/${servletapi.version}/servletapi-${servletapi.version}.jar
servletapi.jar=${base.path}/servletapi4.jar
# ----- Webservices - JAX RPC -----
#jaxrpc-lib.version=1.1-rc4
#jaxrpc-lib.home=${base.path}/jaxrpc-${jaxrpc-lib.version}
#jaxrpc-lib.loc=${base-maven.loc}/geronimo-spec/geronimo-spec-jaxrpc/${jaxrpc-lib.version}/geronimo-spec-jaxrpc-${jaxrpc-lib.version}.jar
jaxrpc-lib.jar=${base.path}/geronimo/jaxrpc-1.1-api.jar
# ----- Webservices - WSDL4J -----
#wsdl4j-lib.version=1.6.1
#wsdl4j-lib.home=${base.path}/wsdl4j-${wsdl4j-lib.version}
#wsdl4j-lib.loc=${base-maven.loc}/wsdl4j/wsdl4j/${wsdl4j-lib.version}/wsdl4j-${wsdl4j-lib.version}.jar
#wsdl4j-lib.jar=${wsdl4j-lib.home}/wsdl4j-${wsdl4j-lib.version}.jar
wsdl4j-lib.jar=${base.path}/wsdl4j.jar
# ----- Eclipse JDT, version 3.2 or later -----
#jdt.version=3.6
#jdt.release=R-3.6-201006080911
#jdt.home=${base.path}/ecj-${jdt.version}
jdt.jar=${base.path}/eclipse-ecj.jar
# The download will be moved to the archive area eventually. We are taking care of that in advance.
#jdt.loc.1=http://archive.eclipse.org/eclipse/downloads/drops/${jdt.release}/ecj-${jdt.version}.jar
#jdt.loc.2=http://download.eclipse.org/eclipse/downloads/drops/${jdt.release}/ecj-${jdt.version}.jar
# ----- Tomcat native library -----
#tomcat-native.version=1.1.20
#tomcat-native.home=${base.path}/tomcat-native-${tomcat-native.version}
#tomcat-native.tar.gz=${tomcat-native.home}/tomcat-native.tar.gz
#tomcat-native.loc.1=${base-tomcat.loc.1}/tomcat-connectors/native/${tomcat-native.version}/source/tomcat-native-${tomcat-native.version}-src.tar.gz
#tomcat-native.loc.2=${base-tomcat.loc.2}/tomcat-connectors/native/${tomcat-native.version}/source/tomcat-native-${tomcat-native.version}-src.tar.gz
#tomcat-native.dll.1=${base-tomcat.loc.1}/tomcat-connectors/native/${tomcat-native.version}/binaries
#tomcat-native.dll.2=${base-tomcat.loc.2}/tomcat-connectors/native/${tomcat-native.version}/binaries
#tomcat-native.dll.win32=${tomcat-native.home}/tcnative-1.dll.x86
#tomcat-native.dll.x64=${tomcat-native.home}/tcnative-1.dll.x64
#tomcat-native.dll.i64=${tomcat-native.home}/tcnative-1.dll.i64
# ----- Commons DBCP, version 1.1 or later -----
#commons-dbcp.version=1.4
#commons-dbcp.home=${base.path}/commons-dbcp-1.4-src
#commons-dbcp-src.loc.1=${base-commons.loc.1}/dbcp/source/commons-dbcp-1.4-src.tar.gz
#commons-dbcp-src.loc.2=${base-commons.loc.2}/dbcp/source/commons-dbcp-1.4-src.tar.gz
# ----- Commons Pool, version 1.1 or later -----
#commons-pool.home=${base.path}/commons-pool-1.5.5-src
#commons-pool-src.loc.1=${base-commons.loc.1}/pool/source/commons-pool-1.5.5-src.tar.gz
#commons-pool-src.loc.2=${base-commons.loc.2}/pool/source/commons-pool-1.5.5-src.tar.gz
# ----- NSIS, version 2.0 or later -----
#nsis.home=${base.path}/nsis-2.46
#nsis.exe=${nsis.home}/makensis.exe
#nsis.installoptions.dll=${nsis.home}/Plugins/InstallOptions.dll
#nsis.nsexec.dll=${nsis.home}/Plugins/nsExec.dll
#nsis.nsisdl.dll=${nsis.home}/Plugins/NSISdl.dll
#nsis.loc=${base-sf.loc}/nsis/nsis-2.46.zip
# ----- Commons Daemon, version 1.0-Alpha or later -----
commons-daemon.version=1.0.5
commons-daemon.jar=${base.path}/apache-commons-daemon-${commons-daemon.version}.jar
# ----- JUnit Unit Test Suite, version 3.7 or later -----
#junit.home=${base.path}/junit3.8.2
#junit.lib=${junit.home}
junit.jar=${base.path}/junit.jar
#junit.loc=${base-sf.loc}/junit/junit3.8.2.zip
# ----- Checkstyle, version 5.1 or later -----
checkstyle.version=5.1
#checkstyle.home=${base.path}/checkstyle-${checkstyle.version}
#checkstyle.loc=${base-sf.loc}/checkstyle/checkstyle-${checkstyle.version}.zip
checkstyle.jar=${base.path}/checkstyle-all-${checkstyle.version}.jar
# ----- JSON Libraries (for bayeux module) -----
#json-lib.home=${base.path}/json-20080701
#json-lib.lib=http://repo1.maven.org/maven2/org/json/json/20080701/json-20080701.jar
json-lib.jar=${base.path}/json.jar
# ----- Dojo Toolkit (for bayeux module) -----
#dojo-js.home=${base.path}/dojo-release-1.1.1
#dojo-js.loc=http://download.dojotoolkit.org/release-1.1.1/dojo-release-1.1.1.tar.gz
#dojo-js.jar=${dojo-js.home}/dojo/dojo.js

View File

@ -1,6 +0,0 @@
<?xml version="1.0" encoding="UTF-8"?>
<!-- $Id: tomcat-context-ROOT.xml,v 1.3 2010/05/19 20:02:56 pawelz Exp $ -->
<Context path="/" docBase="/usr/share/tomcat7/webapps/ROOT"
privileged="true" allowLinking="true">
</Context>

View File

@ -1,6 +0,0 @@
<?xml version="1.0" encoding="UTF-8"?>
<!-- $Id: tomcat-context-docs.xml,v 1.3 2010/05/19 20:02:56 pawelz Exp $ -->
<Context path="/docs" docBase="/usr/share/tomcat7/webapps/docs"
privileged="false" allowLinking="true">
</Context>

View File

@ -1,6 +0,0 @@
<?xml version="1.0" encoding="UTF-8"?>
<!-- $Id: tomcat-context-examples.xml,v 1.3 2010/05/19 20:02:56 pawelz Exp $ -->
<Context path="/examples" docBase="/usr/share/tomcat7/webapps/examples"
privileged="false" allowLinking="true">
</Context>

View File

@ -1,6 +0,0 @@
<?xml version="1.0" encoding="UTF-8"?>
<!-- $Id: tomcat-context-host-manager.xml,v 1.3 2010/05/19 20:02:56 pawelz Exp $ -->
<Context path="/host-manager" docBase="/usr/share/tomcat7/webapps/host-manager"
privileged="true" allowLinking="true">
</Context>

View File

@ -1,6 +0,0 @@
<?xml version="1.0" encoding="UTF-8"?>
<!-- $Id: tomcat-context-manager.xml,v 1.3 2010/05/19 20:02:56 pawelz Exp $ -->
<Context path="/manager" docBase="/usr/share/tomcat7/webapps/manager"
privileged="true" allowLinking="true">
</Context>

View File

@ -1,48 +0,0 @@
#!/bin/sh
#
# tomcat6-digest script
# JPackage Project <http://www.jpackage.org/>
# Source functions library
if [ -f /usr/share/java-utils/java-functions ] ; then
. /usr/share/java-utils/java-functions
else
echo "Can't find functions library, aborting"
exit 1
fi
# Get the tomcat config (use this for environment specific settings)
if [ -z "${TOMCAT_CFG}" ]; then
TOMCAT_CFG="/etc/tomcat7/tomcat7.conf"
fi
if [ -r "$TOMCAT_CFG" ]; then
. $TOMCAT_CFG
fi
set_javacmd
#jsse.jar=$JAVA_HOME/jre/lib/jsse.jar
#jcert.jar=$JAVA_HOME/jre/lib/jce.jar
#jnet.jar=$JAVA_HOME/jre/lib/rt.jar
#jdbc20ext.jar=$JAVA_HOME/jre/lib/rt.jar
# CLASSPATH munging
if [ -n "$JSSE_HOME" ]; then
CLASSPATH="${CLASSPATH}:$(build-classpath jcert jnet jsse 2>/dev/null)"
fi
CLASSPATH="${CLASSPATH}:${CATALINA_HOME}/bin/bootstrap.jar"
CLASSPATH="${CLASSPATH}:${CATALINA_HOME}/bin/tomcat-juli.jar"
export CLASSPATH
# Configuration
MAIN_CLASS="org.apache.catalina.startup.Tool"
BASE_FLAGS="-Dcatalina.home=\"$CATALINA_HOME\""
BASE_OPTIONS=""
BASE_JARS="apache-commons-daemon tomcat7/catalina tomcat7-servlet-3.0-api tomcat7/tomcat-coyote"
# Set parameters
set_classpath $BASE_JARS
set_flags $BASE_FLAGS
set_options $BASE_OPTIONS
# Let's start
run -server org.apache.catalina.realm.RealmBase "$@"

View File

@ -1,11 +0,0 @@
log4j.rootLogger=debug, R
log4j.appender.R=org.apache.log4j.RollingFileAppender
log4j.appender.R.File=${catalina.home}/logs/tomcat.log
log4j.appender.R.MaxFileSize=10MB
log4j.appender.R.MaxBackupIndex=10
log4j.appender.R.layout=org.apache.log4j.PatternLayout
log4j.appender.R.layout.ConversionPattern=%p %t %c - %m%n
log4j.logger.org.apache.catalina=DEBUG, R
log4j.logger.org.apache.catalina.core.ContainerBase.[Catalina].[localhost]=DEBUG, R
log4j.logger.org.apache.catalina.core=DEBUG, R
log4j.logger.org.apache.catalina.session=DEBUG, R

View File

@ -1,48 +0,0 @@
#!/bin/sh
#
# tomcat6-digest script
# JPackage Project <http://www.jpackage.org/>
# Source functions library
if [ -f /usr/share/java-utils/java-functions ] ; then
. /usr/share/java-utils/java-functions
else
echo "Can't find functions library, aborting"
exit 1
fi
# Get the tomcat config (use this for environment specific settings)
if [ -z "${TOMCAT_CFG}" ]; then
TOMCAT_CFG="/etc/tomcat7/tomcat7.conf"
fi
if [ -r "$TOMCAT_CFG" ]; then
. $TOMCAT_CFG
fi
set_javacmd
#jsse.jar=$JAVA_HOME/jre/lib/jsse.jar
#jcert.jar=$JAVA_HOME/jre/lib/jce.jar
#jnet.jar=$JAVA_HOME/jre/lib/rt.jar
#jdbc20ext.jar=$JAVA_HOME/jre/lib/rt.jar
# CLASSPATH munging
if [ -n "$JSSE_HOME" ]; then
CLASSPATH="${CLASSPATH}:$(build-classpath jcert jnet jsse 2>/dev/null)"
fi
CLASSPATH="${CLASSPATH}:${CATALINA_HOME}/bin/bootstrap.jar"
CLASSPATH="${CLASSPATH}:${CATALINA_HOME}/bin/tomcat-juli.jar"
export CLASSPATH
# Configuration
MAIN_CLASS="org.apache.catalina.startup.Tool"
BASE_OPTIONS=""
BASE_FLAGS="-Dcatalina.home=\"$CATALINA_HOME\""
BASE_JARS="apache-commons-daemon tomcat7/catalina tomcat7-servlet-3.0-api tomcat7/tomcat-coyote"
# Set parameters
set_classpath $BASE_JARS
set_flags $BASE_FLAGS
set_options $BASE_OPTIONS
# Let's start
run "$@"

View File

@ -1,9 +0,0 @@
--- res/META-INF/bootstrap.jar.manifest 2011-02-04 13:52:34.000000000 +0100
+++ res/META-INF/bootstrap.jar.manifest-gil 2011-02-28 17:22:55.000000000 +0100
@@ -1,6 +1,5 @@
Manifest-Version: 1.0
Main-Class: org.apache.catalina.startup.Bootstrap
-Class-Path: commons-daemon.jar
Specification-Title: Apache Tomcat Bootstrap
Specification-Version: @VERSION_MAJOR_MINOR@
Specification-Vendor: Apache Software Foundation

View File

@ -1,461 +0,0 @@
--- build.xml 2011-02-18 22:44:13.000000000 +0100
+++ build.xml-gil 2011-03-01 15:13:36.000000000 +0100
@@ -420,51 +420,8 @@
</target>
- <target name="validate" depends="download-validate" if="${execute.validate}">
- <!-- Required so we can cache checkstyle results -->
- <mkdir dir="${tomcat.output}/res/checkstyle"/>
-
- <taskdef resource="checkstyletask.properties"
- classpath="${checkstyle.jar}" />
- <checkstyle config="res/checkstyle/checkstyle.xml">
- <fileset dir="." >
- <patternset refid="text.files" />
- <include name="**/*.bat"/>
- <include name="**/*.sh"/>
- <exclude name="bin/setenv.*"/>
- <exclude name=".*/**"/>
- <exclude name="output/**"/>
- <exclude name="modules/**"/>
- <exclude name="**/*.mdl"/>
- <exclude name="**/*_2.xml"/>
- <exclude name="res/checkstyle/header-al2.txt"/>
- <!-- Exclude auto-generated files -->
- <exclude name="java/org/apache/el/parser/ELParser*.java" />
- <exclude name="java/org/apache/el/parser/JJTELParserState.java" />
- <exclude name="java/org/apache/el/parser/Node.java" />
- <exclude name="java/org/apache/el/parser/ParseException.java" />
- <exclude name="java/org/apache/el/parser/SimpleCharStream.java" />
- <exclude name="java/org/apache/el/parser/Token*.java" />
- <!-- Exclude these else Gump runs validate on them -->
- <exclude name="**/org/apache/tomcat/dbcp/**"/>
- <exclude name="**/tomcat-deps/**"/>
- </fileset>
- </checkstyle>
- <!-- javax package checks -->
- <checkstyle config="res/checkstyle/javax-checkstyle.xml">
- <fileset dir="java/javax" >
- <include name="**/*.java"/>
- </fileset>
- </checkstyle>
- <!-- org package checks -->
- <checkstyle config="res/checkstyle/org-checkstyle.xml">
- <fileset dir="java/org" >
- <include name="**/*.java"/>
- </fileset>
- </checkstyle>
- </target>
- <target name="compile" depends="build-prepare,download-compile,validate">
+ <target name="compile" depends="build-prepare">
<!-- Compile internal server components -->
<javac srcdir="java" destdir="${tomcat.classes}"
@@ -746,13 +703,6 @@
<target name="deploy" depends="package,build-docs"
description="Default. Builds a working Tomcat instance">
- <copy tofile="${tomcat.build}/bin/tomcat-native.tar.gz"
- file="${tomcat-native.tar.gz}" />
- <copy tofile="${tomcat.build}/bin/commons-daemon-native.tar.gz"
- file="${commons-daemon.native.src.tgz}" />
-
- <copy tofile="${tomcat.build}/bin/commons-daemon.jar" file="${commons-daemon.jar}" />
-
<!-- Copy scripts -->
<copy todir="${tomcat.build}/bin">
<fileset dir="bin">
@@ -1008,7 +958,7 @@
</target>
- <target name="test-compile" depends="compile,download-test-compile" >
+ <target name="test-compile" depends="compile" >
<mkdir dir="${test.classes}"/>
<!-- Compile -->
<javac srcdir="test" destdir="${test.classes}"
@@ -1105,52 +1055,10 @@
<mkdir dir="${tomcat.extras}/webservices"/>
</target>
- <target name="extras-commons-logging-prepare"
- depends="extras-prepare"
- description="Prepare to build web services extras package">
-
- <antcall target="downloadfile-2">
- <param name="sourcefile.1" value="${commons-logging-src.loc.1}"/>
- <param name="sourcefile.2" value="${commons-logging-src.loc.2}"/>
- <param name="destfile" value="${commons-logging-src.tar.gz}"/>
- <param name="destdir" value="${commons-logging.home}"/>
- </antcall>
-
- <antcall target="downloadfile">
- <param name="sourcefile" value="${avalon-framework.loc}"/>
- <param name="destfile" value="${avalon-framework.jar}"/>
- <param name="destdir" value="${avalon-framework.home}"/>
- </antcall>
-
- <antcall target="downloadfile">
- <param name="sourcefile" value="${log4j.loc}"/>
- <param name="destfile" value="${log4j.jar}"/>
- <param name="destdir" value="${log4j.home}"/>
- </antcall>
-
- <antcall target="downloadfile">
- <param name="sourcefile" value="${logkit.loc}"/>
- <param name="destfile" value="${logkit.jar}"/>
- <param name="destdir" value="${logkit.home}"/>
- </antcall>
-
- <antcall target="downloadfile">
- <param name="sourcefile" value="${servletapi.loc}"/>
- <param name="destfile" value="${servletapi.jar}"/>
- <param name="destdir" value="${servletapi.home}"/>
- </antcall>
-
- </target>
-
<target name="extras-commons-logging"
- depends="extras-commons-logging-prepare,compile,build-manifests"
+ depends="compile,build-manifests"
description="Build JULI for log4j extras package">
- <gunzip src="${commons-logging-src.tar.gz}"
- dest="${tomcat.extras}/logging/commons-logging-src.tar"/>
- <untar src="${tomcat.extras}/logging/commons-logging-src.tar"
- dest="${tomcat.extras}/logging/"/>
-
<replace dir="${tomcat.extras}/logging/commons-logging-${commons-logging.version}-src/src/java/org/apache/commons"
encoding="ISO-8859-1">
<replacefilter token="org.apache.commons"
@@ -1252,18 +1160,6 @@
depends="extras-prepare"
description="Prepare to build web services extras package">
- <antcall target="downloadfile">
- <param name="sourcefile" value="${jaxrpc-lib.loc}"/>
- <param name="destfile" value="${jaxrpc-lib.jar}"/>
- <param name="destdir" value="${jaxrpc-lib.home}"/>
- </antcall>
-
- <antcall target="downloadfile">
- <param name="sourcefile" value="${wsdl4j-lib.loc}"/>
- <param name="destfile" value="${wsdl4j-lib.jar}"/>
- <param name="destdir" value="${wsdl4j-lib.home}"/>
- </antcall>
-
<copy file="${jaxrpc-lib.jar}"
tofile="${tomcat.extras}/webservices/jaxrpc.jar" />
<copy file="${wsdl4j-lib.jar}"
@@ -1370,7 +1266,7 @@
</target>
- <target name="dist-prepare" depends="download-dist">
+ <target name="dist-prepare">
<mkdir dir="${tomcat.dist}"/>
<mkdir dir="${tomcat.dist}/bin"/>
<mkdir dir="${tomcat.dist}/conf"/>
@@ -2095,300 +1991,6 @@
<delete dir="${tomcat.output}" />
</target>
-
- <!-- ================ Download and dependency building =================== -->
-
- <target name="download-validate"
- description="Download components necessary to validate source"
- if="${execute.validate}">
-
- <antcall target="downloadzip">
- <param name="sourcefile" value="${checkstyle.loc}"/>
- <param name="destfile" value="${checkstyle.jar}"/>
- <param name="destdir" value="${base.path}"/>
- </antcall>
-
- </target>
-
- <target name="download-compile"
- description="Download (and build) components necessary to compile" >
-
- <antcall target="downloadfile-2">
- <param name="sourcefile.1" value="${tomcat-native.loc.1}"/>
- <param name="sourcefile.2" value="${tomcat-native.loc.2}"/>
- <param name="destfile" value="${tomcat-native.tar.gz}"/>
- <param name="destdir" value="${tomcat-native.home}"/>
- </antcall>
-
- <!-- Download Commons Daemon -->
- <antcall target="downloadgz-2">
- <param name="sourcefile.1" value="${commons-daemon.bin.loc.1}"/>
- <param name="sourcefile.2" value="${commons-daemon.bin.loc.2}"/>
- <param name="destfile" value="${commons-daemon.jar}"/>
- </antcall>
-
- <antcall target="downloadfile-2">
- <param name="sourcefile.1" value="${commons-daemon.native.src.loc.1}"/>
- <param name="sourcefile.2" value="${commons-daemon.native.src.loc.2}"/>
- <param name="destfile" value="${commons-daemon.native.src.tgz}"/>
- <param name="destdir" value="${commons-daemon.home}"/>
- </antcall>
-
- <!-- Download src and build Tomcat DBCP bundle -->
- <antcall target="downloadgz-2">
- <param name="sourcefile.1" value="${commons-pool-src.loc.1}"/>
- <param name="sourcefile.2" value="${commons-pool-src.loc.2}"/>
- <param name="destfile" value="${commons-pool.home}/build.xml" />
- </antcall>
- <antcall target="downloadgz-2">
- <param name="sourcefile.1" value="${commons-dbcp-src.loc.1}"/>
- <param name="sourcefile.2" value="${commons-dbcp-src.loc.2}"/>
- <param name="destfile" value="${commons-dbcp.home}/build.xml" />
- </antcall>
- <mkdir dir="${tomcat-dbcp.home}"/>
- <condition property="no.build.dbcp">
- <and>
- <available file="${tomcat-dbcp.jar}"/>
- <available file="${tomcat-dbcp-src.jar}"/>
- </and>
- </condition>
- <antcall target="build-tomcat-dbcp" />
-
- <!-- Download JDT (Eclipse compiler) -->
- <antcall target="downloadfile-2">
- <param name="sourcefile.1" value="${jdt.loc.1}"/>
- <param name="sourcefile.2" value="${jdt.loc.2}"/>
- <param name="destfile" value="${jdt.jar}"/>
- <param name="destdir" value="${jdt.home}"/>
- </antcall>
- </target>
-
- <target name="download-test-compile"
- description="Download additional components for the tests" >
-
- <antcall target="downloadzip">
- <param name="sourcefile" value="${junit.loc}"/>
- <param name="destfile" value="${junit.jar}"/>
- <param name="destdir" value="${base.path}"/>
- </antcall>
-
- </target>
-
- <target name="download-dist"
- description="Download additional components for a distribution" >
-
- <antcall target="downloadfile-2">
- <param name="sourcefile.1" value="${tomcat-native.dll.1}/win32/tcnative-1.dll"/>
- <param name="sourcefile.2" value="${tomcat-native.dll.2}/win32/tcnative-1.dll"/>
- <param name="destfile" value="${tomcat-native.dll.win32}"/>
- <param name="destdir" value="${tomcat-native.home}"/>
- </antcall>
-
- <antcall target="downloadfile-2">
- <param name="sourcefile.1" value="${tomcat-native.dll.1}/win64/x64/tcnative-1.dll"/>
- <param name="sourcefile.2" value="${tomcat-native.dll.2}/win64/x64/tcnative-1.dll"/>
- <param name="destfile" value="${tomcat-native.dll.x64}"/>
- <param name="destdir" value="${tomcat-native.home}"/>
- </antcall>
-
- <antcall target="downloadfile-2">
- <param name="sourcefile.1" value="${tomcat-native.dll.1}/win64/ia64/tcnative-1.dll"/>
- <param name="sourcefile.2" value="${tomcat-native.dll.2}/win64/ia64/tcnative-1.dll"/>
- <param name="destfile" value="${tomcat-native.dll.i64}"/>
- <param name="destdir" value="${tomcat-native.home}"/>
- </antcall>
-
- <antcall target="downloadzip-2">
- <param name="sourcefile.1" value="${commons-daemon.native.win.loc.1}"/>
- <param name="sourcefile.2" value="${commons-daemon.native.win.loc.2}"/>
- <param name="destfile" value="${commons-daemon.native.win.mgr.exe}"/>
- <param name="destdir" value="${commons-daemon.native.win.home}"/>
- </antcall>
-
- <antcall target="downloadzip">
- <param name="sourcefile" value="${nsis.loc}"/>
- <param name="destfile" value="${nsis.exe}"/>
- <param name="destdir" value="${nsis.home}/.."/>
- </antcall>
-
- </target>
-
-
- <!-- =============== Targets for dependencies that need to =============== -->
- <!-- ================ be built rather than used directly ================ -->
-
- <target name="build-tomcat-dbcp" depends="build-manifests" unless="no.build.dbcp">
- <copy todir="${tomcat-dbcp.home}">
- <fileset dir="${commons-pool.home}">
- <include name="**/*.java" />
- <exclude name="**/test/**" />
- </fileset>
- <fileset dir="${commons-dbcp.home}">
- <include name="**/*.java" />
- <exclude name="**/test/**" />
- <exclude name="**/managed/**" />
- </fileset>
- </copy>
- <replace dir="${tomcat-dbcp.home}/src/java/org/apache/commons"
- encoding="ISO-8859-1">
- <replacefilter token="org.apache.commons"
- value="org.apache.tomcat.dbcp" />
- </replace>
- <replace dir="${tomcat-dbcp.home}/src/java/org/apache/commons/pool/impl"
- encoding="ISO-8859-1">
- <replacefilter token="enum"
- value="enumeration" />
- </replace>
-
- <mkdir dir="${tomcat-dbcp.home}/src/java/org/apache/tomcat/dbcp" />
- <move todir="${tomcat-dbcp.home}/src/java/org/apache/tomcat/dbcp">
- <fileset dir="${tomcat-dbcp.home}/src/java/org/apache/commons" />
- </move>
- <mkdir dir="${tomcat-dbcp.home}/classes"/>
- <javac destdir="${tomcat-dbcp.home}/classes"
- optimize="off"
- debug="${compile.debug}"
- deprecation="${compile.deprecation}"
- source="${compile.source}"
- target="${compile.target}"
- sourcepath="${tomcat-dbcp.home}/src/java"
- srcdir="${tomcat-dbcp.home}/src/java"
- encoding="ISO-8859-1"
- includeantruntime="false">
- <include name="**" />
- </javac>
- <jarIt jarfile="${tomcat-dbcp.jar}"
- filesDir="${tomcat-dbcp.home}/classes"
- filesId="files.tomcat-dbcp" />
- <jarIt jarfile="${tomcat-dbcp-src.jar}"
- filesDir="${tomcat-dbcp.home}/src/java"
- filesId="files.tomcat-dbcp" />
- </target>
-
- <!-- =============== Utility Targets to support downloads ================ -->
-
- <target name="proxyflags">
- <!-- check proxy parameters. -->
- <condition property="useproxy">
- <equals arg1="${proxy.use}" arg2="on" />
- </condition>
- </target>
-
- <target name="setproxy" depends="proxyflags" if="useproxy">
- <taskdef name="setproxy"
- classname="org.apache.tools.ant.taskdefs.optional.net.SetProxy" />
- <setproxy proxyhost="${proxy.host}" proxyport="${proxy.port}"
- proxyuser="${proxy.user}" proxypassword="${proxy.password}" />
- <echo message="Using ${proxy.host}:${proxy.port} to download ${sourcefile}"/>
- </target>
-
- <target name="testexist">
- <echo message="Testing for ${destfile}"/>
- <available file="${destfile}" property="exist"/>
- </target>
-
- <target name="downloadgz" unless="exist" depends="setproxy,testexist">
- <!-- Download and extract the package -->
- <get src="${sourcefile}" dest="${base.path}/file.tar.gz" />
- <gunzip src="${base.path}/file.tar.gz" dest="${base.path}/file.tar"/>
- <untar src="${base.path}/file.tar" dest="${base.path}"/>
- <delete file="${base.path}/file.tar"/>
- <delete file="${base.path}/file.tar.gz"/>
- </target>
-
- <target name="downloadgz-2" unless="exist" depends="setproxy,testexist">
- <!-- Download and extract the package from the two alternative locations -->
- <delete file="${base.path}/file.tar" quiet="true" />
- <delete file="${base.path}/file.tar.gz" quiet="true" />
- <antcall target="trydownload">
- <param name="sourcefile" value="${sourcefile.1}" />
- <param name="destfile" value="${base.path}/file.tar.gz" />
- </antcall>
- <antcall target="trydownload">
- <param name="sourcefile" value="${sourcefile.2}" />
- <param name="destfile" value="${base.path}/file.tar.gz" />
- </antcall>
- <gunzip src="${base.path}/file.tar.gz" dest="${base.path}/file.tar"/>
- <untar src="${base.path}/file.tar" dest="${base.path}"/>
- <delete file="${base.path}/file.tar"/>
- <delete file="${base.path}/file.tar.gz"/>
- </target>
-
- <target name="downloadzip" unless="exist" depends="setproxy,testexist">
- <!-- Download and extract the package -->
- <get src="${sourcefile}" dest="${base.path}/file.zip" />
- <mkdir dir="${destdir}" />
- <unzip src="${base.path}/file.zip" dest="${destdir}"/>
- <delete file="${base.path}/file.zip"/>
- </target>
-
- <target name="downloadzip-2" unless="exist" depends="testexist">
- <!-- Download and extract the package from the two alternative locations -->
- <delete file="${base.path}/file.zip" quiet="true" />
- <antcall target="trydownload">
- <param name="sourcefile" value="${sourcefile.1}" />
- <param name="destfile" value="${base.path}/file.zip" />
- </antcall>
- <antcall target="trydownload">
- <param name="sourcefile" value="${sourcefile.2}" />
- <param name="destfile" value="${base.path}/file.zip" />
- </antcall>
- <mkdir dir="${destdir}" />
- <unzip src="${base.path}/file.zip" dest="${destdir}"/>
- <delete file="${base.path}/file.zip"/>
- </target>
-
- <target name="downloadfile" unless="exist" depends="setproxy,testexist">
- <!-- Download extract the file -->
- <mkdir dir="${destdir}" />
- <get src="${sourcefile}" dest="${destfile}" />
- </target>
-
- <target name="downloadfile-2" unless="exist" depends="testexist">
- <!-- Download the file from the two alternative locations -->
- <mkdir dir="${destdir}" />
-
- <antcall target="trydownload">
- <param name="sourcefile" value="${sourcefile.1}" />
- </antcall>
-
- <antcall target="trydownload">
- <param name="sourcefile" value="${sourcefile.2}" />
- </antcall>
-
- <available file="${destfile}" property="exist"/>
- <fail unless="exist" message="Failed to download [${destfile}]. All download sources are unavailable." />
- </target>
-
- <target name="trydownload.check" depends="setproxy">
- <condition property="trydownload.run">
- <and>
- <not>
- <available file="${destfile}" />
- </not>
- <http url="${sourcefile}" />
- </and>
- </condition>
- </target>
-
- <target name="trydownload" if="trydownload.run" depends="trydownload.check">
- <!-- Downloads a file if not yet downloaded and the source URL is available -->
- <get src="${sourcefile}" dest="${destfile}" />
- </target>
-
- <!-- ============================ IDE Support ============================ -->
-
- <target name="ide-eclipse" depends="deploy, extras-webservices-prepare"
- description="Prepares the source tree to be built in Eclipse">
-
- <!-- Copy the sample project files into the root directory -->
- <copy file="${tomcat.home}/res/ide-support/eclipse/eclipse.project" tofile="${tomcat.home}/.project"/>
- <copy file="${tomcat.home}/res/ide-support/eclipse/eclipse.classpath" tofile="${tomcat.home}/.classpath"/>
-
- <echo>Eclipse project files created.
-Read the Building page on the Apache Tomcat documentation site for details on how to configure your Eclipse workplace.</echo>
- </target>
-
<!-- ======================= Macros, Taskdefs etc ======================== -->
<macrodef name="jarIt" description="utility macro for standard JAR packaging">

View File

@ -1,12 +0,0 @@
--- conf/tomcat-users.xml 2011-02-04 13:52:30.000000000 +0100
+++ conf/tomcat-users.xml-gil 2011-02-28 17:27:16.000000000 +0100
@@ -33,4 +33,9 @@
<user username="both" password="tomcat" roles="tomcat,role1"/>
<user username="role1" password="tomcat" roles="role1"/>
-->
+
+<!-- The host manager webapp is restricted to users with role "admin" -->
+<!--<user name="tomcat" password="password" roles="admin" />-->
+<!-- The manager webapp is restricted to users with role "manager" -->
+<!--<user name="tomcat" password="password" roles="manager" />-->
</tomcat-users>

View File

@ -1,438 +0,0 @@
diff -urN java/org/apache/catalina/startup/LDAPUserDatabase.java java/org/apache/catalina/startup-gil/LDAPUserDatabase.java
--- java/org/apache/catalina/startup/LDAPUserDatabase.java 1970-01-01 01:00:00.000000000 +0100
+++ java/org/apache/catalina/startup-gil/LDAPUserDatabase.java 2011-03-01 16:54:57.000000000 +0100
@@ -0,0 +1,196 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+
+package org.apache.catalina.startup;
+
+import java.util.Enumeration;
+import java.util.Hashtable;
+
+import javax.naming.Context;
+import javax.naming.NamingEnumeration;
+import javax.naming.NamingException;
+import javax.naming.directory.Attribute;
+import javax.naming.directory.Attributes;
+import javax.naming.directory.SearchControls;
+import javax.naming.directory.SearchResult;
+import javax.naming.ldap.Control;
+import javax.naming.ldap.InitialLdapContext;
+import javax.naming.ldap.LdapContext;
+import javax.naming.ldap.PagedResultsControl;
+import javax.naming.ldap.PagedResultsResponseControl;
+
+
+/**
+ * Concrete implementation of the <code>UserDatabase</code> interface
+ * that retrieves user data from LDAP server.
+ *
+ * @author Jan Rękorajski
+ * @version 0.1
+ */
+
+public final class LDAPUserDatabase
+ implements UserDatabase {
+
+ // --------------------------------------------------------- Constructors
+
+ /**
+ * Initialize a new instance of this user database component.
+ */
+ public LDAPUserDatabase() {
+ super();
+ }
+
+ // --------------------------------------------------- Instance Variables
+
+ /**
+ * The set of home directories for all defined users, keyed by username.
+ */
+ private Hashtable<String,String> homes = new Hashtable();
+
+ /**
+ * The UserConfig listener with which we are associated.
+ */
+ private UserConfig userConfig = null;
+
+ // ----------------------------------------------------------- Properties
+
+ /**
+ * Return the UserConfig listener with which we are associated.
+ */
+ public UserConfig getUserConfig() {
+ return (this.userConfig);
+ }
+
+ /**
+ * Set the UserConfig listener with which we are associated.
+ *
+ * @param userConfig The new UserConfig listener
+ */
+ public void setUserConfig(UserConfig userConfig) {
+ this.userConfig = userConfig;
+ init();
+ }
+
+ // ------------------------------------------------------- Public Methods
+
+ /**
+ * Return an absolute pathname to the home directory for the specified user.
+ *
+ * @param user User for which a home directory should be retrieved
+ */
+ public String getHome(String user) {
+ return homes.get(user);
+ }
+
+
+ /**
+ * Return an enumeration of the usernames defined on this server.
+ */
+ public Enumeration<String> getUsers() {
+ return (homes.keys());
+ }
+
+ // ------------------------------------------------------ Private Methods
+
+
+ /**
+ * Initialize our set of users and home directories.
+ */
+ private void init() {
+ String connectionURL = userConfig.getConnectionURL();
+ String connectionName = userConfig.getConnectionName();
+ String connectionPassword = userConfig.getConnectionPassword();
+ String authentication = userConfig.getAuthentication();
+ String searchBase = userConfig.getSearchBase();
+ String searchFilter = userConfig.getSearchFilter();
+ boolean searchSubtree = userConfig.getSearchSubtree();
+ String userAttr = userConfig.getUserAttr();
+ String homeAttr = userConfig.getHomeAttr();
+ int pageSize = userConfig.getPageSize();
+
+ try {
+ Hashtable<String,String> env = new Hashtable<String,String>();
+
+ env.put(Context.INITIAL_CONTEXT_FACTORY, "com.sun.jndi.ldap.LdapCtxFactory");
+ if (connectionName != null)
+ env.put(Context.SECURITY_PRINCIPAL, connectionName);
+ if (connectionPassword != null)
+ env.put(Context.SECURITY_CREDENTIALS, connectionPassword);
+ if (connectionURL != null)
+ env.put(Context.PROVIDER_URL, connectionURL);
+ if (authentication != null)
+ env.put(Context.SECURITY_AUTHENTICATION, authentication);
+
+ LdapContext ctx = new InitialLdapContext(env, null);
+
+ SearchControls constraints = new SearchControls();
+ String returnAttrs[] = { userAttr, homeAttr };
+ constraints.setReturningAttributes(returnAttrs);
+ if (searchSubtree) {
+ constraints.setSearchScope(SearchControls.SUBTREE_SCOPE);
+ } else {
+ constraints.setSearchScope(SearchControls.ONELEVEL_SCOPE);
+ }
+
+ // Request the paged results control
+ if (pageSize > 0) {
+ Control[] ctls = new Control[]{ new PagedResultsControl(pageSize, Control.NONCRITICAL) };
+ ctx.setRequestControls(ctls);
+ }
+
+ byte[] cookie = null;
+ do {
+ NamingEnumeration results = ctx.search(searchBase, searchFilter, constraints);
+ while (results != null && results.hasMore()) {
+ SearchResult sr = (SearchResult)results.next();
+ String username = null;
+ String home = null;
+ Attributes attr = sr.getAttributes();
+ Attribute a = attr.get(homeAttr);
+ if (a != null && a.size() == 1)
+ home = (String)a.get();
+ a = attr.get(userAttr);
+ if ((home != null) && (a != null)) {
+ // Add all possible names of this user and corresponding directory
+ for (int i = 0; i < a.size(); i++) {
+ username = (String)a.get(i);
+ if (username != null) {
+ homes.put(username, home);
+ }
+ }
+ }
+ }
+ cookie = null;
+ Control[] controls = ctx.getResponseControls();
+ if (controls != null) {
+ for (int i = 0; i < controls.length; i++) {
+ if (controls[i] instanceof PagedResultsResponseControl) {
+ PagedResultsResponseControl prrc = (PagedResultsResponseControl)controls[i];
+ cookie = prrc.getCookie();
+ }
+ }
+ }
+ if (cookie != null) {
+ ctx.setRequestControls(new Control[]{ new PagedResultsControl(pageSize, cookie, Control.CRITICAL) });
+ }
+ } while ((cookie != null) && (cookie.length != 0));
+ } catch (Exception e) {
+ // e.printStackTrace();
+ }
+ }
+}
\ Manca newline alla fine del file
diff -urN java/org/apache/catalina/startup/UserConfig.java java/org/apache/catalina/startup-gil/UserConfig.java
--- java/org/apache/catalina/startup/UserConfig.java 2010-04-29 15:43:39.000000000 +0200
+++ java/org/apache/catalina/startup-gil/UserConfig.java 2011-03-01 17:10:43.000000000 +0100
@@ -83,6 +83,65 @@
/**
+ * The connection URL for the LDAP server we will contact.
+ */
+ private String connectionURL = null;
+
+
+ /**
+ * The connection username for the LDAP server we will contact.
+ */
+ private String connectionName = null;
+
+
+ /**
+ * The connection password for the LDAP server we will contact.
+ */
+ private String connectionPassword = null;
+
+
+ /**
+ * The type of authentication to use
+ */
+ private String authentication = null;
+
+
+ /**
+ * The page size for paged LDAP query.
+ */
+ private int pageSize = 0;
+
+
+ /**
+ * The base element for user searches.
+ */
+ private String searchBase = "";
+
+
+ /**
+ * The message format used to search for users.
+ */
+ private String searchFilter = "(objectClass=posixAccount)";
+
+
+ /**
+ * Should we search the entire subtree for matching users?
+ */
+ private boolean searchSubtree = false;
+
+
+ /**
+ * The attibute that denotes user name(s).
+ */
+ private String userAttr = "uid";
+
+
+ /**
+ * The attibute that denotes user home directory.
+ */
+ private String homeAttr = "homeDirectory";
+
+ /**
* The string resources for this package.
*/
private static final StringManager sm =
@@ -186,6 +245,167 @@
}
+
+ /**
+ * The connection URL for the LDAP server we will contact.
+ */
+ public String getConnectionURL() {
+
+ return (this.connectionURL);
+
+ }
+ public void setConnectionURL(String connectionURL) {
+
+ this.connectionURL = connectionURL;
+
+ }
+
+
+ /**
+ * The connection username for the LDAP server we will contact.
+ */
+ public String getConnectionName() {
+
+ return (this.connectionName);
+
+ }
+ public void setConnectionName(String connectionName) {
+
+ this.connectionName = connectionName;
+
+ }
+
+
+ /**
+ * The connection password for the LDAP server we will contact.
+ */
+ public String getConnectionPassword() {
+
+ return (this.connectionPassword);
+
+ }
+ public void setConnectionPassword(String connectionPassword) {
+
+ this.connectionPassword = connectionPassword;
+
+ }
+
+ /**
+ * Return the type of authentication to use.
+ */
+ public String getAuthentication() {
+
+ return (this.authentication);
+
+ }
+
+ /**
+ * Set the type of authentication to use.
+ *
+ * @param authentication The authentication
+ */
+ public void setAuthentication(String authentication) {
+
+ this.authentication = authentication;
+
+ }
+
+
+ /**
+ * Return the page size for paged LDAP query.
+ */
+ public int getPageSize() {
+
+ return (this.pageSize);
+
+ }
+
+ /**
+ * Set the page size for paged LDAP query.
+ *
+ * @param pagesize The page size
+ */
+ public void setPageSize(int pageSize) {
+
+ this.pageSize = pageSize;
+
+ }
+
+
+ /**
+ * The base element for user searches.
+ */
+ public String getSearchBase() {
+
+ return (this.searchBase);
+
+ }
+ public void setSearchBase(String searchBase) {
+
+ this.searchBase = searchBase;
+
+ }
+
+
+ /**
+ * The message format used to search for users.
+ */
+ public String getSearchFilter() {
+
+ return (this.searchFilter);
+
+ }
+ public void setSearchFilter(String searchFilter) {
+
+ this.searchFilter = searchFilter;
+
+ }
+
+
+ /**
+ * Should we search the entire subtree for matching users?
+ */
+ public boolean getSearchSubtree() {
+
+ return (this.searchSubtree);
+
+ }
+ public void setSearchSubtree(boolean searchSubtree) {
+
+ this.searchSubtree = searchSubtree;
+
+ }
+
+
+ /**
+ * The attibute that denotes user name(s).
+ */
+ public String getUserAttr() {
+
+ return (this.userAttr);
+
+ }
+ public void setUserAttr(String userAttr) {
+
+ this.userAttr = userAttr;
+
+ }
+
+
+ /**
+ * The attibute that denotes user home directory.
+ */
+ public String getHomeAttr() {
+
+ return (this.homeAttr);
+
+ }
+ public void setHomeAttr(String homeAttr) {
+
+ this.homeAttr = homeAttr;
+
+ }
+
/**
* Return the user database class name for this component.

View File

@ -1,13 +0,0 @@
--- conf/catalina.policy 2010-08-02 13:00:51.000000000 +0200
+++ conf/catalina.policy-gil 2011-03-01 15:17:32.000000000 +0100
@@ -52,6 +52,10 @@
permission java.security.AllPermission;
};
+// These permissions apply to all shared system extensions
+grant codeBase "file:/usr/share/java/-" {
+ permission java.security.AllPermission;
+};
// ========== CATALINA CODE PERMISSIONS =======================================

View File

@ -1,32 +0,0 @@
--- conf/server.xml 2011-03-01 21:01:34.000000000 +0100
+++ conf/server.xml-gil 2011-03-01 21:07:52.000000000 +0100
@@ -69,12 +69,14 @@
-->
<Connector port="8080" protocol="HTTP/1.1"
connectionTimeout="20000"
+ URIEncoding="UTF-8"
redirectPort="8443" />
<!-- A "Connector" using the shared thread pool-->
<!--
<Connector executor="tomcatThreadPool"
port="8080" protocol="HTTP/1.1"
connectionTimeout="20000"
+ URIEncoding="UTF-8"
redirectPort="8443" />
-->
<!-- Define a SSL HTTP/1.1 Connector on port 8443
@@ -83,12 +85,12 @@
described in the APR documentation -->
<!--
<Connector port="8443" protocol="HTTP/1.1" SSLEnabled="true"
- maxThreads="150" scheme="https" secure="true"
+ maxThreads="150" scheme="https" secure="true" URIEncoding="UTF-8"
clientAuth="false" sslProtocol="TLS" />
-->
<!-- Define an AJP 1.3 Connector on port 8009 -->
- <Connector port="8009" protocol="AJP/1.3" redirectPort="8443" />
+ <Connector port="8009" protocol="AJP/1.3" URIEncoding="UTF-8" redirectPort="8443" />
<!-- An Engine represents the entry point (within Catalina) that processes

View File

@ -1,49 +0,0 @@
--- conf/server.xml 2011-02-23 20:23:59.000000000 +0100
+++ conf/server.xml-gil 2011-03-01 16:41:16.000000000 +0100
@@ -136,6 +136,46 @@
prefix="localhost_access_log." suffix=".txt"
pattern="%h %l %u %t &quot;%r&quot; %s %b" resolveHosts="false"/>
+ <!--
+ Automatically map a request URI starting with a tilde
+ character ("~") and a username to a directory
+ (commonly named public_html) in that user's home directory
+ on the server.
+ -->
+ <!--
+ Use /etc/passwd file to identify valid users
+ -->
+ <!--
+ <Listener className="org.apache.catalina.startup.UserConfig"
+ directoryName="public_html"
+ userClass="org.apache.catalina.startup.PasswdUserDatabase"/>
+ -->
+ <!--
+ Use all directories found in a specified base directory
+ to be considered "user home" directories
+ -->
+ <!--
+ <Listener className="org.apache.catalina.startup.UserConfig"
+ directoryName="public_html"
+ homeBase="/home/users"
+ userClass="org.apache.catalina.startup.HomesUserDatabase"/>
+ -->
+ <!--
+ Use LDAP search to identify valid users
+ -->
+ <!--
+ <Listener className="org.apache.catalina.startup.UserConfig"
+ directoryName="public_html"
+ connectionURL="ldaps://ldap.example.com/"
+ connectionName="uid=tomcat,ou=people,dc=example,dc=com"
+ connectionPassword="secret"
+ searchBase="ou=People,dc=mim,dc=uw,dc=edu,dc=pl"
+ searchFilter="(objectClass=posixAccount)"
+ searchSubtree="false"
+ pageSize="1000"
+ userClass="org.apache.catalina.startup.LDAPUserDatabase"/>
+ -->
+
</Host>
</Engine>
</Service>

View File

@ -1,18 +0,0 @@
--- conf/tomcat-users.xml 2011-03-02 00:56:49.000000000 +0100
+++ conf/tomcat-users.xml-gil 2011-03-02 01:07:08.000000000 +0100
@@ -26,11 +26,15 @@
and thus are ignored when reading this file. Do not forget to remove
<!.. ..> that surrounds them.
-->
+ <!--.. add password ..-->
<!--
+ <role rolename="manager"/>
<role rolename="tomcat"/>
+ <role rolename="admin"/>
<role rolename="role1"/>
<user username="tomcat" password="tomcat" roles="tomcat"/>
<user username="both" password="tomcat" roles="tomcat,role1"/>
+ <user username="admin" password=".." roles="admin,manager"/>
<user username="role1" password="tomcat" roles="role1"/>
-->

View File

@ -1,50 +0,0 @@
# System-wide configuration file for tomcat6 services
# This will be sourced by tomcat6 and any secondary service
# Values will be overridden by service-specific configuration
# files in /etc/sysconfig
#
# Use this one to change default values for all services
# Change the service specific ones to affect only one service
# (see, for instance, /etc/sysconfig/tomcat7)
#
# Where your java installation lives
JAVA_HOME="@@@JAVAHOME@@@"
# Where your tomcat installation lives
CATALINA_BASE="@@@TCHOME@@@"
CATALINA_HOME="@@@TCHOME@@@"
JASPER_HOME="@@@TCHOME@@@"
CATALINA_TMPDIR="@@@TCTEMP@@@"
# You can pass some parameters to java here if you wish to
#JAVA_OPTS="-Xminf0.1 -Xmaxf0.3"
# Use JAVA_OPTS to set java.library.path for libtcnative.so
#JAVA_OPTS="-Djava.library.path=@@@LIBDIR@@@"
# What user should run tomcat
TOMCAT_USER="tomcat"
# You can change your tomcat locale here
#LANG="en_US"
# Run tomcat under the Java Security Manager
SECURITY_MANAGER="false"
# Time to wait in seconds, before killing process
SHUTDOWN_WAIT="30"
# Whether to annoy the user with "attempting to shut down" messages or not
SHUTDOWN_VERBOSE="false"
# Set the TOMCAT_PID location
CATALINA_PID="/var/run/tomcat7.pid"
# Connector port is 8080 for this tomcat7 instance
#CONNECTOR_PORT="8080"
# If you wish to further customize your tomcat7 environment,
# put your own definitions here
# (i.e. LD_LIBRARY_PATH for some jdbc drivers)

View File

@ -1,291 +0,0 @@
#!/bin/bash
#
# tomcat6 This shell script takes care of starting and stopping Tomcat
#
# chkconfig: - 80 20
#
### BEGIN INIT INFO
# Provides: tomcat7
# Required-Start: $network $syslog
# Required-Stop: $network $syslog
# Default-Start:
# Default-Stop:
# Description: Release implementation for Servlet 3.0 and JSP 2.2
# Short-Description: start and stop tomcat
### END INIT INFO
#
# - originally written by Henri Gomez, Keith Irwin, and Nicolas Mailhot
# - heavily rewritten by Deepak Bhole and Jason Corley
#
## Source function library.
#. /etc/rc.d/init.d/functions
# Source LSB function library.
if [ -r /lib/lsb/init-functions ]; then
. /lib/lsb/init-functions
else
exit 1
fi
DISTRIB_ID=`lsb_release -i -s 2>/dev/null`
NAME="$(basename $0)"
unset ISBOOT
if [ "${NAME:0:1}" = "S" -o "${NAME:0:1}" = "K" ]; then
NAME="${NAME:3}"
ISBOOT="1"
fi
# For SELinux we need to use 'runuser' not 'su'
if [ -x "/sbin/runuser" ]; then
SU="/sbin/runuser"
else
SU="/bin/su"
fi
# Get the tomcat config (use this for environment specific settings)
TOMCAT_CFG="/etc/tomcat7/tomcat7.conf"
if [ -r "$TOMCAT_CFG" ]; then
. $TOMCAT_CFG
fi
# Get instance specific config file
if [ -r "/etc/sysconfig/${NAME}" ]; then
. /etc/sysconfig/${NAME}
fi
# Define which connector port to use
CONNECTOR_PORT="${CONNECTOR_PORT:-8080}"
# Path to the tomcat launch script
TOMCAT_SCRIPT="/usr/sbin/tomcat7"
# Tomcat program name
TOMCAT_PROG="${NAME}"
# Define the tomcat username
TOMCAT_USER="${TOMCAT_USER:-tomcat}"
# Define the tomcat log file
TOMCAT_LOG="${TOMCAT_LOG:-/var/log/tomcat7/catalina.out}"
RETVAL="0"
# Look for open ports, as the function name might imply
function findFreePorts() {
local isSet1="false"
local isSet2="false"
local isSet3="false"
local lower="8000"
randomPort1="0"
randomPort2="0"
randomPort3="0"
local -a listeners="( $(
netstat -ntl | \
awk '/^tcp/ {gsub("(.)*:", "", $4); print $4}'
) )"
while [ "$isSet1" = "false" ] || \
[ "$isSet2" = "false" ] || \
[ "$isSet3" = "false" ]; do
let port="${lower}+${RANDOM:0:4}"
if [ -z `expr " ${listeners[*]} " : ".*\( $port \).*"` ]; then
if [ "$isSet1" = "false" ]; then
export randomPort1="$port"
isSet1="true"
elif [ "$isSet2" = "false" ]; then
export randomPort2="$port"
isSet2="true"
elif [ "$isSet3" = "false" ]; then
export randomPort3="$port"
isSet3="true"
fi
fi
done
}
function makeHomeDir() {
if [ ! -d "$CATALINA_HOME" ]; then
echo "$CATALINA_HOME does not exist, creating"
if [ ! -d "/usr/share/${NAME}" ]; then
mkdir /usr/share/${NAME}
cp -pLR /usr/share/tomcat7/* /usr/share/${NAME}
fi
mkdir -p /var/log/${NAME} \
/var/cache/${NAME} \
/var/tmp/${NAME}
ln -fs /var/cache/${NAME} ${CATALINA_HOME}/work
ln -fs /var/tmp/${NAME} ${CATALINA_HOME}/temp
cp -pLR /usr/share/${NAME}/bin $CATALINA_HOME
cp -pLR /usr/share/${NAME}/conf $CATALINA_HOME
ln -fs /usr/share/java/tomcat7 ${CATALINA_HOME}/lib
ln -fs /usr/share/tomcat7/webapps ${CATALINA_HOME}/webapps
chown ${TOMCAT_USER}:${TOMCAT_USER} /var/log/${NAME}
fi
}
function parseOptions() {
options=""
options="$options $(
awk '!/^#/ && !/^$/ { ORS=" "; print "export ", $0, ";" }' \
$TOMCAT_CFG
)"
if [ -r "/etc/sysconfig/${NAME}" ]; then
options="$options $(
awk '!/^#/ && !/^$/ { ORS=" ";
print "export ", $0, ";" }' \
/etc/sysconfig/${NAME}
)"
fi
TOMCAT_SCRIPT="$options ${TOMCAT_SCRIPT}"
}
# See how we were called.
function start() {
echo -n "Starting ${TOMCAT_PROG}: "
if [ -f "/var/lock/subsys/${NAME}" ] ; then
if [ -f "/var/run/${NAME}.pid" ]; then
read kpid < /var/run/${NAME}.pid
# if checkpid $kpid 2>&1; then
if [ -d "/proc/${kpid}" ]; then
log_success_msg
if [ "$DISTRIB_ID" = "MandrivaLinux" ]; then
echo
fi
return 0
fi
fi
fi
# fix permissions on the log and pid files
export CATALINA_PID="/var/run/${NAME}.pid"
touch $CATALINA_PID
chown ${TOMCAT_USER}:${TOMCAT_USER} $CATALINA_PID
touch $TOMCAT_LOG
chown ${TOMCAT_USER}:${TOMCAT_USER} $TOMCAT_LOG
if [ "$CATALINA_HOME" != "/usr/share/tomcat7" ]; then
# Create a tomcat directory if it doesn't exist
makeHomeDir
# If CATALINA_HOME doesn't exist modify port number so that
# multiple instances don't interfere with each other
findFreePorts
sed -i -e "s/8005/${randomPort1}/g" -e "s/8080/${CONNECTOR_PORT}/g" \
-e "s/8009/${randomPort2}/g" -e "s/8443/${randomPort3}/g" \
${CATALINA_HOME}/conf/server.xml
fi
parseOptions
if [ "$SECURITY_MANAGER" = "true" ]; then
$SU - $TOMCAT_USER -c "${TOMCAT_SCRIPT} start-security" \
>> $TOMCAT_LOG 2>&1
else
$SU - $TOMCAT_USER -c "${TOMCAT_SCRIPT} start" >> $TOMCAT_LOG 2>&1
fi
RETVAL="$?"
if [ "$RETVAL" -eq 0 ]; then
log_success_msg
touch /var/lock/subsys/${NAME}
else
log_failure_msg
fi
if [ "$DISTRIB_ID" = "MandrivaLinux" ]; then
echo
fi
return $RETVAL
}
function stop() {
RETVAL="0"
echo -n "Stopping ${TOMCAT_PROG}: "
if [ -f "/var/lock/subsys/${NAME}" ]; then
parseOptions
$SU - $TOMCAT_USER -c "${TOMCAT_SCRIPT} stop" >> $TOMCAT_LOG 2>&1
RETVAL="$?"
if [ "$RETVAL" -eq "0" ]; then
count="0"
if [ -f "/var/run/${NAME}.pid" ]; then
read kpid < /var/run/${NAME}.pid
until [ "$(ps --pid $kpid | grep -c $kpid)" -eq "0" ] || \
[ "$count" -gt "$SHUTDOWN_WAIT" ]; do
if [ "$SHUTDOWN_VERBOSE" = "true" ]; then
echo "waiting for processes $kpid to exit"
fi
sleep 1
let count="${count}+1"
done
if [ "$count" -gt "$SHUTDOWN_WAIT" ]; then
if [ "$SHUTDOWN_VERBOSE" = "true" ]; then
echo "killing processes which didn't stop after $SHUTDOWN_WAIT seconds"
fi
kill -9 $kpid
fi
log_success_msg
fi
rm -f /var/lock/subsys/${NAME} /var/run/${NAME}.pid
else
log_failure_msg
fi
else
log_success_msg
fi
if [ "$DISTRIB_ID" = "MandrivaLinux" ]; then
echo
fi
return $RETVAL
}
# See how we were called.
case "$1" in
start)
start
;;
stop)
stop
;;
restart)
stop
start
;;
condrestart|try-restart)
if [ -f "/var/run/${NAME}.pid" ]; then
stop
start
fi
;;
reload)
RETVAL="3"
;;
force-reload)
if [ -f "/var/run/${NAME}.pid" ]; then
stop
start
fi
;;
status)
if [ -f "/var/run/${NAME}.pid" ]; then
# status ${NAME}
# RETVAL="$?"
read kpid < /var/run/${NAME}.pid
if [ -d "/proc/${kpid}" ]; then
echo "${NAME} (pid ${kpid}) is running..."
RETVAL="0"
fi
else
pid="$(/usr/bin/pgrep -d , -u ${TOMCAT_USER} -G ${TOMCAT_USER} java)"
if [ -z "$pid" ]; then
# status ${NAME}
# RETVAL="$?"
echo "${NAME} is stopped"
RETVAL="3"
else
echo "${NAME} (pid $pid) is running..."
RETVAL="0"
fi
fi
;;
version)
${TOMCAT_SCRIPT} version
;;
*)
echo "Usage: $0 {start|stop|restart|condrestart|try-restart|reload|force-reload|status|version}"
RETVAL="2"
esac
exit $RETVAL

View File

@ -1,8 +0,0 @@
@@@TCLOG@@@/catalina.out {
copytruncate
weekly
rotate 52
compress
missingok
create 0644 tomcat tomcat
}

View File

@ -1,56 +0,0 @@
# Service-specific configuration file for tomcat7. This will be sourced by
# the SysV init script after the global configuration file
# /etc/tomcat7/tomcat7.conf, thus allowing values to be overridden in
# a per-service manner.
#
# NEVER change the init script itself. To change values for all services make
# your changes in /etc/tomcat7/tomcat7.conf
#
# To change values for a specific service make your edits here.
# To create a new service create a link from /etc/init.d/<your new service> to
# /etc/init.d/tomcat7 (do not copy the init script) and make a copy of the
# /etc/sysconfig/tomcat7 file to /etc/sysconfig/<your new service> and change
# the property values so the two services won't conflict. Register the new
# service in the system as usual (see chkconfig and similars).
#
# Where your java installation lives
#JAVA_HOME="@@@JAVAHOME@@@"
# Where your tomcat installation lives
#CATALINA_BASE="@@@TCHOME@@@"
#CATALINA_HOME="@@@TCHOME@@@"
#JASPER_HOME="@@@TCHOME@@@"
#CATALINA_TMPDIR="@@@TCTEMP@@@"
# You can pass some parameters to java here if you wish to
#JAVA_OPTS="-Xminf0.1 -Xmaxf0.3"
# Use JAVA_OPTS to set java.library.path for libtcnative.so
#JAVA_OPTS="-Djava.library.path=@@@LIBDIR@@@"
# What user should run tomcat
#TOMCAT_USER="tomcat"
# You can change your tomcat locale here
#LANG="en_US"
# Run tomcat under the Java Security Manager
#SECURITY_MANAGER="false"
# Time to wait in seconds, before killing process
#SHUTDOWN_WAIT="30"
# Whether to annoy the user with "attempting to shut down" messages or not
#SHUTDOWN_VERBOSE="false"
# Set the TOMCAT_PID location
#CATALINA_PID="/var/run/tomcat7.pid"
# Connector port is 8080 for this tomcat7 instance
#CONNECTOR_PORT="8080"
# If you wish to further customize your tomcat7 environment,
# put your own definitions here
# (i.e. LD_LIBRARY_PATH for some jdbc drivers)

View File

@ -1,49 +0,0 @@
#!/bin/sh
#
# tomcat6-digest script
# JPackage Project <http://www.jpackage.org/>
# Source functions library
if [ -f /usr/share/java-utils/java-functions ] ; then
. /usr/share/java-utils/java-functions
else
echo "Can't find functions library, aborting"
exit 1
fi
# Get the tomcat config (use this for environment specific settings)
if [ -z "${TOMCAT_CFG}" ]; then
TOMCAT_CFG="/etc/tomcat7/tomcat7.conf"
fi
if [ -r "$TOMCAT_CFG" ]; then
. $TOMCAT_CFG
fi
set_javacmd
#jsse.jar=$JAVA_HOME/jre/lib/jsse.jar
#jcert.jar=$JAVA_HOME/jre/lib/jce.jar
#jnet.jar=$JAVA_HOME/jre/lib/rt.jar
#jdbc20ext.jar=$JAVA_HOME/jre/lib/rt.jar
# CLASSPATH munging
if [ -n "$JSSE_HOME" ]; then
CLASSPATH="${CLASSPATH}:$(build-classpath jcert jnet jsse 2>/dev/null)"
fi
CLASSPATH="${CLASSPATH}:${CATALINA_HOME}/bin/bootstrap.jar"
CLASSPATH="${CLASSPATH}:${CATALINA_HOME}/bin/tomcat-juli.jar"
export CLASSPATH
# Configuration
MAIN_CLASS="org.apache.catalina.startup.Tool"
BASE_OPTIONS=""
BASE_FLAGS="-Dcatalina.home=\"$CATALINA_HOME\""
BASE_JARS="apache-commons-daemon tomcat7/catalina tomcat7-servlet-3.0-api tomcat7/tomcat-coyote"
# Set parameters
set_classpath $BASE_JARS
set_flags $BASE_FLAGS
set_options $BASE_OPTIONS
# Let's start
run "$@"

View File

@ -1,99 +1,23 @@
%define jsp_api_version 2.2
%define servlet_api_version 3.0
%define el_api_version 2.2
%define with_embed 1
%define pkgname apache-tomcat-%{version}-src
%define pkg_dir %{_builddir}/apache-tomcat-%{version}/%{pkgname}
%define tom_name tomcat7
%define native_ver 1.1.20
%define daemon_ver 1.0.5
%define logging_ver 1.1.1
%define dojo_ver 1.1.1
# FHS 2.3 compliant tree structure - http://www.pathname.com/fhs/2.3/
%define appdir %{_localstatedir}/lib/%{tom_name}/webapps
%define bindir %{_datadir}/%{tom_name}/bin
%define confdir %{_sysconfdir}/%{tom_name}
%define homedir %{_datadir}/%{tom_name}
%define libdir %{_javadir}/%{tom_name}
%define logdir %{_localstatedir}/log/%{tom_name}
%global cachedir %{_localstatedir}/cache/%{tom_name}
%define tempdir %{cachedir}/temp
%define workdir %{cachedir}/work
%define javahome /usr/lib/jvm/java
%define version_build %(echo %version | cut -d. -f 3-)
Name: apache-tomcat
Version: 7.0.20
Release: 1mamba
Summary: Apache Servlet/JSP Engine, RI for Servlet %{servlet_api_version}/JSP %{jsp_api_version} API
Version: 7.0.103
Release: 2mamba
Summary: Apache Servlet/JSP Engine, RI for Servlet 3.0/JSP 2.2 API
Group: System/Servers
Vendor: openmamba
Distribution: openmamba
Packager: gil <puntogil@libero.it>
Packager: Silvan Calarco <silvan.calarco@mambasoft.it>
URL: http://tomcat.apache.org
Source0: http://apache.fis.uniroma2.it/tomcat/tomcat-7/v%{version}/src/apache-tomcat-%{version}-src.tar.gz
# svn export http://svn.apache.org/repos/asf/tomcat/tc7.0.x/tags/TOMCAT_7_0_9/ apache-tomcat-7.0.9-src
#Source0: apache-tomcat-%{version}-src-svn.tar.gz
Source1: apache-tomcat-7.0.conf
Source2: apache-tomcat-7.0.init
Source3: apache-tomcat-7.0.sysconfig
Source4: apache-tomcat-7.0.wrapper
Source5: apache-tomcat-7.0.logrotate
Source6: apache-tomcat-7.0-digest.script
Source7: apache-tomcat-7.0-tool-wrapper.script
Source8: apache-tomcat-7.0-log4j.properties
Source9: http://archive.apache.org/dist/commons/logging/source/commons-logging-%{logging_ver}-src.tar.gz
Source10: apache-tomcat-7.0-build.properties
Source11: apache-tomcat-7.0-context-host-manager.xml
Source12: apache-tomcat-7.0-context-examples.xml
Source13: apache-tomcat-7.0-context-docs.xml
Source14: apache-tomcat-7.0-context-ROOT.xml
Source15: apache-tomcat-7.0-context-manager.xml
#Source16: http://download.dojotoolkit.org/release-%{dojo_ver}/dojo-release-%{dojo_ver}.tar.gz
Patch0: apache-tomcat-7.0.8-build_xml.patch
Patch1: apache-tomcat-7.0.8-bootstrap-MANIFEST.MF.patch
Patch2: apache-tomcat-7.0.8-tomcat-users-webapp.patch
Patch3: apache-tomcat-7.0.9-catalina_policy-javadir.patch
Patch4: apache-tomcat-7.0.9-server_xml-userdir.patch
Patch5: apache-tomcat-7.0.9-server_xml-URIEncoding-utf8.patch
Patch6: apache-tomcat-7.0.9-tomcat-users_xml-admin.patch
Patch7: apache-tomcat-7.0.9-LDAPUserDatabase.patch
License: Apache Software License Version 2.0
BuildRequires: apache-ant
BuildRequires: apache-ant-trax
BuildRequires: apache-log4j
BuildRequires: apache-commons-dbcp
BuildRequires: apache-geronimo-1.2-specs
BuildRequires: coreutils
BuildRequires: eclipse-ecj
BuildRequires: findutils
BuildRequires: jakarta-commons-collections
BuildRequires: jakarta-commons-collections-tomcat5
BuildRequires: apache-commons-daemon
BuildRequires: apache-commons-pool
BuildRequires: apache-tomcat-dbcp == %{version}
BuildRequires: jakarta-taglibs-standard
BuildRequires: java-checkstyle == 5.1
BuildRequires: java-excalibur-avalon-framework
BuildRequires: java-excalibur-avalon-logkit
BuildRequires: java-json
BuildRequires: java-junit3
BuildRequires: java-mysql-connector
BuildRequires: java-openjdk
BuildRequires: java-wsdl4j
Source0: https://archive.apache.org/dist/tomcat/tomcat-7/v%{version}/bin/apache-tomcat-%{version}.tar.gz
Source1: tomcat7.service
Source2: tomcat7.sysusers
Source3: tomcat7.tmpfiles
License: Apache License 2.0
## AUTOBUILDREQ-BEGIN
## AUTOBUILDREQ-END
BuildRequires: jpackage-utils
Requires: apache-geronimo-1.2-specs
Requires: eclipse-ecj
Requires: apache-commons-daemon
Requires: apache-commons-daemon-jsvc
Requires: eclipse-ecj
Requires: jakarta-commons-logging == %{logging_ver}
Requires: java-checkstyle == 5.1
Requires: java-mysql-connector
Requires: java-openjdk-runtime
Requires: java-wsdl4j
Requires: libtomcat-native == %{native_ver}
Requires: lib%{tom_name} = %{?epoch:%epoch:}%{version}-%{release}
Requires: procps
Requires: shadow-common
BuildRoot: %{_tmppath}/%{name}-%{version}-root
@ -105,691 +29,113 @@ The Java Servlet and JavaServer Pages specifications are developed by Sun under
Tomcat is developed in an open and participatory environment and released under the Apache Software License 2.0. Tomcat is intended to be a collaboration of the best-of-breed developers from around the world.
We invite you to participate in this open development project.
%package admin
Group: System/Servers
Summary: The host-manager and manager web applications for Apache Tomcat
Requires: %{name} = %{?epoch:%epoch:}%{version}-%{release}
%description admin
Tomcat is the servlet container that is used in the official Reference Implementation for the Java Servlet and JavaServer Pages technologies.
The Java Servlet and JavaServer Pages specifications are developed by Sun under the Java Community Process.
The host-manager and manager web applications for Apache Tomcat.
%package webapps
Group: System/Servers
Summary: The ROOT and examples web applications for Apache Tomcat
Requires: %{name} = %{?epoch:%epoch:}%{version}-%{release}
Requires: jakarta-taglibs-standard
Obsoletes: %{name}-devel
Provides: %{name}-devel
%description webapps
Tomcat is the servlet container that is used in the official Reference Implementation for the Java Servlet and JavaServer Pages technologies.
The Java Servlet and JavaServer Pages specifications are developed by Sun under the Java Community Process.
The ROOT and examples web applications for Apache Tomcat.
%package el-%{el_api_version}-api
Group: Development/Libraries/Java
Summary: Expression Language v1.0 API
Provides: elapi7
%description el-%{el_api_version}-api
Tomcat is the servlet container that is used in the official Reference Implementation for the Java Servlet and JavaServer Pages technologies.
The Java Servlet and JavaServer Pages specifications are developed by Sun under the Java Community Process.
This package contains the implementation classes of the Apache Tomcat Expression Language v1.0 API.
%package servlet-%{servlet_api_version}-api
Group: Development/Libraries/Java
Summary: Java API for Servlets
Provides: servletapi7
%description servlet-%{servlet_api_version}-api
Tomcat is the servlet container that is used in the official Reference Implementation for the Java Servlet and JavaServer Pages technologies.
The Java Servlet and JavaServer Pages specifications are developed by Sun under the Java Community Process.
This subproject contains the source code for the implementation classes of the Java Servlet and JSP APIs (packages javax.servlet).
%package jsp-%{jsp_api_version}-api
Group: Development/Libraries/Java
Summary: Java API for JavaServer Pages
Requires: %{name}-servlet-%{servlet_api_version}-api = %{?epoch:%epoch:}%{version}-%{release}
Provides: jspapi7
%description jsp-%{jsp_api_version}-api
Tomcat is the servlet container that is used in the official Reference Implementation for the Java Servlet and JavaServer Pages technologies.
The Java Servlet and JavaServer Pages specifications are developed by Sun under the Java Community Process.
Contains the implementation classes of the Apache Tomcat JSP API (packages javax.servlet.jsp)
%package javadoc
Group: Documentation
Summary: Javadoc for %{name}
%description javadoc
Tomcat is the servlet container that is used in the official Reference Implementation for the Java Servlet and JavaServer Pages technologies.
The Java Servlet and JavaServer Pages specifications are developed by Sun under the Java Community Process.
This package contains documentation for %{name}.
%package el-%{el_api_version}-api-javadoc
Group: Documentation
Summary: Javadoc for %{name}-el-%{el_api_version}-api
%description el-%{el_api_version}-api-javadoc
Tomcat is the servlet container that is used in the official Reference Implementation for the Java Servlet and JavaServer Pages technologies.
The Java Servlet and JavaServer Pages specifications are developed by Sun under the Java Community Process.
This package contains documentation for %{name}-el-%{el_api_version}-api.
%package jsp-%{jsp_api_version}-api-javadoc
Group: Documentation
Summary: Javadoc for %{name}-jsp-%{jsp_api_version}-api
%description jsp-%{jsp_api_version}-api-javadoc
Tomcat is the servlet container that is used in the official Reference Implementation for the Java Servlet and JavaServer Pages technologies.
The Java Servlet and JavaServer Pages specifications are developed by Sun under the Java Community Process.
This package contains documentation for %{name}-jsp-%{jsp_api_version}-api.
%package servlet-%{servlet_api_version}-api-javadoc
Group: Documentation
Summary: Javadoc for %{name}-servlet-%{servlet_api_version}-api
%description servlet-%{servlet_api_version}-api-javadoc
Tomcat is the servlet container that is used in the official Reference Implementation for the Java Servlet and JavaServer Pages technologies.
The Java Servlet and JavaServer Pages specifications are developed by Sun under the Java Community Process.
This package contains documentation for %{name}-servlet-%{servlet_api_version}-api.
%package -n lib%{tom_name}
Group: Development/Languages
Summary: Libraries needed to run the Tomcat Web container
Requires: eclipse-ecj
Requires: jakarta-commons-collections-tomcat5
Requires: apache-commons-dbcp
Requires: apache-commons-pool
Requires: apache-tomcat-dbcp == %{version}
Requires: %{name}-jsp-%{jsp_api_version}-api = %{?epoch:%epoch:}%{version}-%{release}
Requires: %{name}-servlet-%{servlet_api_version}-api = %{?epoch:%epoch:}%{version}-%{release}
Requires: coreutils
%description -n lib%{tom_name}
Tomcat is the servlet container that is used in the official Reference Implementation for the Java Servlet and JavaServer Pages technologies.
The Java Servlet and JavaServer Pages specifications are developed by Sun under the Java Community Process.
This package contains libraries needed to run the Tomcat Web container.
%package webapp-docs
Group: Documentation
Summary: The docs web application for Apache Tomcat
Requires: %{name} = %{?epoch:%epoch:}%{version}-%{release}
Requires: jakarta-taglibs-standard
%description webapp-docs
Tomcat is the servlet container that is used in the official Reference Implementation for the Java Servlet and JavaServer Pages technologies.
The Java Servlet and JavaServer Pages specifications are developed by Sun under the Java Community Process.
The docs web application for Apache Tomcat.
%package log4j
Group: System/Servers
Summary: Log4j support for Apache Tomcat
Requires: apache-log4j
Requires: jakarta-commons-logging
%description log4j
Tomcat is the servlet container that is used in the official Reference Implementation for the Java Servlet and JavaServer Pages technologies.
The Java Servlet and JavaServer Pages specifications are developed by Sun under the Java Community Process.
This package contains Log4j support for Apache Tomcat
%prep
%setup -q -c -T -a 0
find . -type f \( -name "*.bat" -o -name "*.jar" -o -name "*.class" -o -name Thumbs.db -o -name "*.war" -o -name "*.gz" -o -name "*.zip" \) | xargs -t rm
pushd %{pkg_dir}/
%patch0 -p0
%patch1 -p0
%patch2 -p0
%patch3 -p0
%patch4 -p0
%patch5 -p0
%patch6 -p0
%patch7 -p0
mkdir -p tomcat-native-%{native_ver}/ output/extras-src-jars
mkdir -p tomcat7-deps/dbcp/
ln -sf %{_javadir}/tomcat7/tomcat-dbcp.jar tomcat7-deps/dbcp/tomcat-dbcp.jar
ln -sf $(build-classpath jakarta-taglibs-core) webapps/examples/WEB-INF/lib/jstl.jar
ln -sf $(build-classpath jakarta-taglibs-standard) webapps/examples/WEB-INF/lib/standard.jar
%if %with_embed
mkdir -p output/extras/logging
(
cd output/extras/logging
tar -xf %{SOURCE9}
)
%endif
cp %{SOURCE10} build.properties
popd
%setup -q
%build
export CLASSPATH=$(build-classpath wsdl4j ant/ant-trax)
pushd apache-tomcat-%{version}-src
ant -Dbase.path="." \
-Dbuild.compiler="modern" \
-Dcommons-collections.jar="$(build-classpath commons-collections)" \
-Dcommons-daemon.jar="$(build-classpath apache-commons-daemon)" \
-Djasper-jdt.jar="$(build-classpath eclipse-ecj)" \
-Dcheckstyle.jar="$(build-classpath checkstyle)" \
-Djdt.jar="$(build-classpath eclipse-ecj)" \
-Djson-lib.jar="$(build-classpath json)" \
-Djaxrpc-lib.jar="$(build-classpath geronimo/jaxrpc-1.1-api)" \
-Dlogkit.jar="$(build-classpath excalibur/avalon-logkit)" \
-Dlog4j.jar="$(build-classpath log4j)" \
-Davalon-framework.jar="$(build-classpath excalibur/avalon-framework)" \
-Djunit.jar="$(build-classpath junit)" \
-Dversion="%{version}" \
-Dno.build.dbcp=true \
-Dtrydownload.run=false \
-Dversion.build="%{version_build}"
ant dist-prepare
%if %with_embed
CLASSPATH=$CLASSPATH:$(build-classpath excalibur/avalon-framework excalibur/avalon-logkit log4j commons-logging)
CLASSPATH=$CLASSPATH::%{pkg_dir}/output/build/lib/jsp-api.jar:%{pkg_dir}/output/build/lib/servlet-api.jar
ant -Dservletapi.jar=%{pkg_dir}/output/build/lib/servlet-api.jar -Dlog4j12.present=true embed-jars embed-extras
%endif
ant dist-source
ant javadoc
rm output/build/lib/*ecj.jar
rm -rf output/build/bin/tomcat-native.tar.gz output/build/bin/commons-daemon.jar
# this file is in apache-tomcat-dbcp package
rm output/build/lib/tomcat-dbcp.jar
popd
pushd apache-tomcat-%{version}-src/output
pushd dist/src/webapps/docs/appdev/sample/src
mkdir -p ../web/WEB-INF/classes
javac -cp ../../../../../../../../output/build/lib/servlet-api.jar -d ../web/WEB-INF/classes mypackage/Hello.java
pushd ../web
jar cf ../../../../../../../../output/build/webapps/docs/appdev/sample/sample.war *
popd
popd
popd
%install
[ "%{buildroot}" != / ] && rm -rf "%{buildroot}"
install -d -m 0755 %{buildroot}%{_bindir}
install -d -m 0755 %{buildroot}%{_sbindir}
install -d -m 0755 %{buildroot}%{_javadocdir}/%{tom_name}
install -d -m 0755 %{buildroot}%{_javadocdir}/elapi7
install -d -m 0755 %{buildroot}%{_javadocdir}/jspapi7
install -d -m 0755 %{buildroot}%{_javadocdir}/servletapi7
install -d -m 0755 %{buildroot}%{_initrddir}
install -d -m 0755 %{buildroot}%{_sysconfdir}/logrotate.d
install -d -m 0755 %{buildroot}%{_sysconfdir}/sysconfig
install -d -m 0755 %{buildroot}%{appdir}
install -d -m 0755 %{buildroot}%{bindir}
install -d -m 0755 %{buildroot}%{confdir}
install -d -m 0755 %{buildroot}%{confdir}/Catalina/localhost
install -d -m 0755 %{buildroot}%{libdir}
install -d -m 0755 %{buildroot}%{logdir}
install -d -m 0755 %{buildroot}%{homedir}
install -d -m 0755 %{buildroot}%{tempdir}
install -d -m 0755 %{buildroot}%{workdir}
# Tomcat general files (from Arch Linux)
install -dm 755 %{buildroot}%{_javadir}/tomcat7
install -dm 755 %{buildroot}%{_datadir}/tomcat7
cp -dr --no-preserve=ownership bin %{buildroot}%{_datadir}/tomcat7
# commons-daemon and tomcat-natives are packaged on their own
rm %{buildroot}%{_datadir}/tomcat7/bin/{*.bat,commons-daemon*,tomcat-native.tar.gz}
ln -s %{_javadir}/commons-daemon.jar %{buildroot}%{_datadir}/tomcat7/bin/commons-daemon.jar
cp -a %{SOURCE11} %{buildroot}%{confdir}/Catalina/localhost/host-manager.xml
cp -a %{SOURCE12} %{buildroot}%{confdir}/Catalina/localhost/examples.xml
cp -a %{SOURCE13} %{buildroot}%{confdir}/Catalina/localhost/docs.xml
cp -a %{SOURCE14} %{buildroot}%{confdir}/Catalina/localhost/ROOT.xml
cp -a %{SOURCE15} %{buildroot}%{confdir}/Catalina/localhost/manager.xml
install -m 644 lib/* %{buildroot}%{_javadir}/tomcat7
# eclipse-ecj is packaged on its own
rm %{buildroot}%{_javadir}/tomcat7/ecj-*.jar
ln -s ../eclipse-ecj.jar %{buildroot}%{_javadir}/tomcat7/ecj.jar
pushd %{pkg_dir}/output/build
ln -sf $(build-classpath eclipse-ecj) lib/ecj.jar
ln -sf %{_javadir}/commons-collections-tomcat5.jar lib/commons-collections-tomcat5.jar
ln -sf %{_javadir}/dbcp/commons-dbcp.jar lib/apache-commons-dbcp.jar
ln -sf %{_javadir}/pool/commons-pool.jar lib/apache-commons-pool.jar
ln -sf $(build-classpath apache-commons-daemon) lib/
build-jar-repository -p webapps/examples/WEB-INF/lib taglibs-core.jar taglibs-standard.jar 2>&1
cp -a bin/*.{jar,xml} %{buildroot}%{bindir}
ln -sf $(build-classpath apache-commons-daemon) %{buildroot}%{bindir}/commons-daemon.jar
cp -a %{SOURCE8} conf/log4j.properties
cp -a conf/*.{policy,properties,xml} %{buildroot}%{confdir}
cp -a lib/*.jar %{buildroot}%{libdir}
cp -a webapps/* %{buildroot}%{appdir}
popd
ln -s %{_javadir}/tomcat7 %{buildroot}%{_datadir}/tomcat7/lib
%if %with_embed
pushd %{pkg_dir}/output/
cp -a extras/catalina-jmx-remote.jar %{buildroot}%{libdir}
cp -a extras/catalina-ws.jar %{buildroot}%{libdir}
cp -a extras/tomcat-juli-adapters.jar %{buildroot}%{libdir}/tomcat-extras-juli-adapters.jar
cp -a extras/tomcat-juli.jar %{buildroot}%{libdir}/tomcat-extras-juli.jar
cp -a embed/*.jar %{buildroot}%{libdir}
popd
%endif
# We log through systemd but this would still be required for stock Tomcat logging
install -dm 775 %{buildroot}/var/log/tomcat7
ln -s /var/log/tomcat7 %{buildroot}%{_datadir}/tomcat7/logs
touch %{buildroot}/var/log/tomcat7/catalina.{out,err}
pushd %{pkg_dir}/output/dist/webapps
cp -a docs/api/* %{buildroot}%{_javadocdir}/%{tom_name}
cp -a docs/elapi/* %{buildroot}%{_javadocdir}/elapi7
cp -a docs/jspapi/* %{buildroot}%{_javadocdir}/jspapi7
cp -a docs/servletapi/* %{buildroot}%{_javadocdir}/servletapi7
popd
sed -e "s|\@\@\@JAVAHOME\@\@\@|%{javahome}|g" \
-e "s|\@\@\@TCHOME\@\@\@|%{homedir}|g" \
-e "s|\@\@\@TCTEMP\@\@\@|%{tempdir}|g" \
-e "s|\@\@\@LIBDIR\@\@\@|%{_libdir}|g" %{SOURCE1} \
> %{buildroot}%{confdir}/%{tom_name}.conf
sed -e "s|\@\@\@JAVAHOME\@\@\@|%{javahome}|g" \
-e "s|\@\@\@TCHOME\@\@\@|%{homedir}|g" \
-e "s|\@\@\@TCTEMP\@\@\@|%{tempdir}|g" \
-e "s|\@\@\@LIBDIR\@\@\@|%{_libdir}|g" %{SOURCE3} \
> %{buildroot}%{_sysconfdir}/sysconfig/%{tom_name}
install -m 0644 %{SOURCE2} \
%{buildroot}%{_initrddir}/%{tom_name}
install -m 0644 %{SOURCE4} \
%{buildroot}%{_sbindir}/%{tom_name}
ln -s %{tom_name} %{buildroot}%{_sbindir}/d%{tom_name}
sed -e "s|\@\@\@TCLOG\@\@\@|%{logdir}|g" %{SOURCE5} \
> %{buildroot}%{_sysconfdir}/logrotate.d/%{tom_name}
sed -e "s|\@\@\@TCHOME\@\@\@|%{homedir}|g" \
-e "s|\@\@\@TCTEMP\@\@\@|%{tempdir}|g" \
-e "s|\@\@\@LIBDIR\@\@\@|%{_libdir}|g" %{SOURCE6} \
> %{buildroot}%{_bindir}/%{tom_name}-digest
sed -e "s|\@\@\@TCHOME\@\@\@|%{homedir}|g" \
-e "s|\@\@\@TCTEMP\@\@\@|%{tempdir}|g" \
-e "s|\@\@\@LIBDIR\@\@\@|%{_libdir}|g" %{SOURCE7} \
> %{buildroot}%{_bindir}/%{tom_name}-tool-wrapper
install -dm 775 %{buildroot}%{_sysconfdir}/tomcat7
install -m 640 conf/* %{buildroot}%{_sysconfdir}/tomcat7
install -dm 775 %{buildroot}%{_sysconfdir}/tomcat7/Catalina
ln -s /etc/tomcat7 %{buildroot}%{_datadir}/tomcat7/conf
pushd %{buildroot}%{_javadir}
mv %{tom_name}/jsp-api.jar %{tom_name}-jsp-%{jsp_api_version}-api-%{version}.jar
mv %{tom_name}/servlet-api.jar \
%{tom_name}-servlet-%{servlet_api_version}-api-%{version}.jar
mv %{tom_name}/el-api.jar %{tom_name}-el-%{el_api_version}-api-%{version}.jar
ln -s %{tom_name}-jsp-%{jsp_api_version}-api-%{version}.jar \
%{tom_name}-jsp-%{jsp_api_version}-api.jar
ln -s %{tom_name}-jsp-%{jsp_api_version}-api-%{version}.jar \
jspapi7-%{version}.jar
ln -s %{tom_name}-jsp-%{jsp_api_version}-api-%{version}.jar \
jspapi7.jar
ln -s %{tom_name}-servlet-%{servlet_api_version}-api-%{version}.jar \
%{tom_name}-servlet-%{servlet_api_version}-api.jar
ln -s %{tom_name}-servlet-%{servlet_api_version}-api-%{version}.jar \
servletapi7-%{version}.jar
ln -s %{tom_name}-servlet-%{servlet_api_version}-api-%{version}.jar \
servletapi7.jar
ln -s %{tom_name}-el-%{el_api_version}-api-%{version}.jar \
%{tom_name}-el-%{el_api_version}-api.jar
ln -s %{tom_name}-el-%{el_api_version}-api-%{version}.jar \
elapi7-%{version}.jar
ln -s %{tom_name}-el-%{el_api_version}-api-%{version}.jar \
elapi7.jar
popd
install -dm 775 %{buildroot}/var/lib/tomcat7
cp -r webapps %{buildroot}/var/lib/tomcat7
chmod 775 %{buildroot}/var/lib/tomcat7/webapps
ln -s /var/lib/tomcat7/webapps %{buildroot}%{_datadir}/tomcat7/webapps
pushd %{buildroot}%{libdir}
for i in *.jar; do
j="$(echo $i | sed -e 's,\.jar$,,')"
mv ${j}.jar ${j}-%{version}.jar
ln -s ${j}-%{version}.jar ${j}.jar
done
ln -s ../%{tom_name}-jsp-%{jsp_api_version}-api-%{version}.jar .
ln -s ../%{tom_name}-servlet-%{servlet_api_version}-api-%{version}.jar .
ln -s ../%{tom_name}-el-%{el_api_version}-api-%{version}.jar .
cp -p $(build-classpath commons-collections) .
cp -p $(build-classpath log4j) .
ln -sf log4j.jar log4j-%{version}.jar
ln -sf $(build-classpath dbcp/commons-dbcp) commons-dbcp.jar
# ln -sf $(build-classpath pool/commons-pool) commons-pool.jar
ln -sf $(build-classpath commons-collections-tomcat5) .
ln -sf $(build-classpath checkstyle-all) checkstyle.jar
# ln -sf $(build-classpath dbcp/commons-dbcp) apache-commons-dbcp.jar
ln -sf $(build-classpath eclipse-ecj) eclipse-ecj.jar
ln -sf $(build-classpath eclipse-ecj) jasper-jdt.jar
ln -s ../../tomcat7/bin/tomcat-juli.jar tomcat-juli-%{version}.jar
ln -s ../../tomcat7/bin/tomcat-juli.jar tomcat-juli.jar
ln -sf $(build-classpath apache-commons-daemon) commons-daemon.jar
%if %with_embed
ln -sf $(build-classpath geronimo/jaxrpc-1.1-api) jaxrpc.jar
ln -sf $(build-classpath wsdl4j) wsdl4j.jar
ln -sf $(build-classpath wsdl4j) jsr109.jar
%endif
popd
install -dm 1777 %{buildroot}/var/tmp
install -dm 775 %{buildroot}/var/tmp/tomcat7/{temp,work}
ln -s /var/tmp/tomcat7/temp %{buildroot}%{_datadir}/tomcat7/temp
ln -s /var/tmp/tomcat7/work %{buildroot}%{_datadir}/tomcat7/work
pushd %{buildroot}%{homedir}
ln -s %{appdir} webapps
ln -s %{confdir} conf
ln -s %{libdir} lib
ln -s %{logdir} logs
ln -s %{tempdir} temp
ln -s %{workdir} work
popd
mkdir -p %{buildroot}%{appdir}/sample
pushd %{buildroot}%{appdir}/sample
jar xf %{buildroot}%{appdir}/docs/appdev/sample/sample.war
popd
rm %{buildroot}%{appdir}/docs/appdev/sample/sample.war
mkdir -p %{buildroot}%{_mavenpomdir}
# for backwards compatibility
%add_to_maven_depmap javax.servlet servlet-api %{servlet_api_version} JPP %{tom_name}-servlet-%{servlet_api_version}-api
%add_to_maven_depmap org.apache.tomcat tomcat-servlet-api %{version} JPP %{tom_name}-servlet-%{servlet_api_version}-api
mv %{buildroot}%{_mavendepmapfragdir}/%{name} %{buildroot}%{_mavendepmapfragdir}/%{name}-servlet-api
pushd %{pkg_dir}/output/dist/src/res/maven
# this file is in apache-tomcat-dbcp package
rm -rf tomcat-dbcp.pom
for pom in *.pom; do
sed -i 's/@MAVEN.DEPLOY.VERSION@/%{version}/g' $pom
done
for pom in tomcat-annotations-api.pom \
tomcat-jasper-el.pom \
tomcat-jasper.pom \
tomcat-catalina-ant.pom \
tomcat-catalina-ha.pom \
tomcat-catalina-jmx-remote.pom \
tomcat-catalina-ws.pom \
tomcat-catalina.pom; do
artifact=`echo $pom | sed -e s:^tomcat-::g`
cp -a $pom %{buildroot}%{_mavenpomdir}/JPP.%{tom_name}-$artifact
%add_to_maven_depmap org.apache.tomcat $pom %{version} JPP/%{tom_name} $artifact
done
cp -a tomcat-tribes.pom %{buildroot}%{_mavenpomdir}/JPP.%{tom_name}-catalina-tribes.pom
%add_to_maven_depmap org.apache.tomcat tomcat-catalina %{version} JPP/%{tom_name} catalina-tribes
cp -a tomcat-servlet-api.pom %{buildroot}%{_mavenpomdir}/JPP-%{tom_name}-servlet-%{servlet_api_version}-api.pom
cp -a tomcat-jsp-api.pom %{buildroot}%{_mavenpomdir}/JPP-%{tom_name}-jsp-%{jsp_api_version}-api.pom
%add_to_maven_depmap javax.servlet.jsp jsp-api %{jsp_api_version} JPP %{tom_name}-jsp-%{jsp_api_version}-api
%add_to_maven_depmap org.apache.tomcat jsp-api %{jsp_api_version} JPP %{tom_name}-jsp-%{jsp_api_version}-api
%add_to_maven_depmap org.apache.tomcat tomcat-jsp-api %{version} JPP %{tom_name}-jsp-%{jsp_api_version}-api
cp -a tomcat-el-api.pom %{buildroot}%{_mavenpomdir}/JPP-%{tom_name}-el-%{el_api_version}-api.pom
%add_to_maven_depmap javax.el el-api %{el_api_version} JPP %{tom_name}-el-%{el_api_version}-api
%add_to_maven_depmap org.apache.tomcat el-api %{el_api_version} JPP %{tom_name}-el-%{el_api_version}-api
%add_to_maven_depmap org.apache.tomcat tomcat-el-api %{version} JPP %{tom_name}-el-%{el_api_version}-api
for pom in tomcat-api.pom \
tomcat-coyote.pom \
tomcat-i18n-es.pom \
tomcat-i18n-fr.pom \
tomcat-i18n-ja.pom \
tomcat-juli.pom \
tomcat-util.pom; do
cp -a $pom %{buildroot}%{_mavenpomdir}/JPP.%{tom_name}-$pom
artifact=`basename $pom .pom`
%add_to_maven_depmap org.apache.tomcat $artifact %{version} JPP/%{tom_name} $artifact
done
cp -a tomcat-tribes.pom %{buildroot}%{_mavenpomdir}/JPP.%{tom_name}-catalina-tribes.pom
%add_to_maven_depmap org.apache.tomcat tribes %{version} JPP/%{tom_name} catalina-tribes
%add_to_maven_depmap org.apache.tomcat tomcat-tribes %{version} JPP/%{tom_name} catalina-tribes
%if %with_embed
cp -a tomcat-embed-logging-log4j.pom %{buildroot}%{_mavenpomdir}/JPP.%{tom_name}-tomcat-embed-logging-log4j.pom
%add_to_maven_depmap org.apache.tomcat.embed tomcat-embed-logging-log4j %{version} JPP/%{tom_name} tomcat-embed-logging-log4j
cp -a tomcat-embed-core.pom %{buildroot}%{_mavenpomdir}/JPP.%{tom_name}-tomcat-embed-core.pom
%add_to_maven_depmap org.apache.tomcat.embed tomcat-embed-core %{version} JPP/%{tom_name} tomcat-embed-core
cp -a tomcat-embed-jasper.pom %{buildroot}%{_mavenpomdir}/JPP.%{tom_name}-tomcat-embed-jasper.pom
%add_to_maven_depmap org.apache.tomcat.embed tomcat-embed-jasper %{version} JPP/%{tom_name} tomcat-embed-jasper
cp -a tomcat-embed-logging-juli.pom %{buildroot}%{_mavenpomdir}/JPP.%{tom_name}-tomcat-embed-logging-juli.pom
%add_to_maven_depmap org.apache.tomcat.embed tomcat-embed-logging-juli %{version} JPP/%{tom_name} tomcat-embed-logging-juli
cp -a tomcat-extras-juli-adapters.pom %{buildroot}%{_mavenpomdir}/JPP.%{tom_name}-tomcat-extras-juli-adapters.pom
%add_to_maven_depmap org.apache.tomcat.extras tomcat-extras-juli-adapters %{version} JPP%{tom_name} tomcat-extras-juli-adapters
cp -a tomcat-extras-juli.pom %{buildroot}%{_mavenpomdir}/JPP.%{tom_name}-tomcat-extras-juli.pom
%add_to_maven_depmap org.apache.tomcat.extras tomcat-extras-juli %{version} JPP/%{tom_name} tomcat-extras-juli
%endif
popd
install -Dm 644 %{SOURCE1} %{buildroot}%{_unitdir}/tomcat7.service
install -Dm 644 %{SOURCE2} %{buildroot}%{_sysusersdir}/tomcat7.conf
install -Dm 644 %{SOURCE3} %{buildroot}%{_tmpfilesdir}/tomcat7.conf
%clean
[ "%{buildroot}" != / ] && rm -rf "%{buildroot}"
%pre
%{_sbindir}/groupadd -g 91 -r tomcat 2>/dev/null || :
%{_sbindir}/useradd -c "Apache Tomcat" -u 91 -g tomcat -s /bin/sh -r -d %{homedir} tomcat 2>/dev/null || :
%post
/sbin/chkconfig --add %{tom_name}
%update_maven_depmap
%post jsp-%{jsp_api_version}-api
%{_sbindir}/update-alternatives --install %{_javadir}/jsp.jar jsp %{_javadir}/%{tom_name}-jsp-%{jsp_api_version}-api.jar 20700
%post servlet-%{servlet_api_version}-api
%{_sbindir}/update-alternatives --install %{_javadir}/servlet.jar servlet %{_javadir}/%{tom_name}-servlet-%{servlet_api_version}-api.jar 20700
%post el-%{el_api_version}-api
%{_sbindir}/update-alternatives --install %{_javadir}/elspec.jar elspec %{_javadir}/%{tom_name}-el-%{el_api_version}-api.jar 20700
%systemd_post tomcat7
:
%preun
%{__rm} -rf %{workdir}/* %{tempdir}/*
if [ "$1" = "0" ]; then
%{_initrddir}/%{tom_name} stop >/dev/null 2>&1
/sbin/chkconfig --del %{tom_name}
fi
%systemd_preun tomcat7
:
%postun
%update_maven_depmap
%postun jsp-%{jsp_api_version}-api
if [ "$1" = "0" ]; then
%{_sbindir}/update-alternatives --remove jsp %{_javadir}/%{tom_name}-jsp-%{jsp_api_version}-api.jar
fi
%postun servlet-%{servlet_api_version}-api
if [ "$1" = "0" ]; then
%{_sbindir}/update-alternatives --remove servlet %{_javadir}/%{tom_name}-servlet-%{servlet_api_version}-api.jar
fi
%postun el-%{el_api_version}-api
if [ "$1" = "0" ]; then
%{_sbindir}/update-alternatives --remove elspec %{_javadir}/%{tom_name}-el-%{el_api_version}-api.jar
fi
%systemd_postun tomcat7
:
%files
%defattr(-,root,root)
%attr(0755,root,root) %{_initrddir}/tomcat7
%attr(0644,root,root) %config(noreplace) %{_sysconfdir}/logrotate.d/tomcat7
%config(noreplace) %{_sysconfdir}/sysconfig/tomcat7
%attr(0775,root,tomcat) %dir %{logdir}
%attr(0775,root,tomcat) %dir %{confdir}
%attr(0775,root,tomcat) %dir %{confdir}/Catalina/
%attr(0775,root,tomcat) %dir %{confdir}/Catalina/localhost
%config(noreplace) %attr(660,root,tomcat) %verify(not md5 mtime size) %{confdir}/catalina.policy
%config(noreplace) %attr(660,root,tomcat) %verify(not md5 mtime size) %{confdir}/catalina.properties
%config(noreplace) %attr(660,root,tomcat) %verify(not md5 mtime size) %{confdir}/context.xml
%config(noreplace) %attr(660,root,tomcat) %verify(not md5 mtime size) %{confdir}/logging.properties
%config(noreplace) %attr(660,root,tomcat) %verify(not md5 mtime size) %{confdir}/server.xml
%config(noreplace) %attr(660,root,tomcat) %verify(not md5 mtime size) %{confdir}/tomcat-users.xml
%config(noreplace) %attr(660,root,tomcat) %verify(not md5 mtime size) %{confdir}/tomcat7.conf
%config(noreplace) %attr(660,root,tomcat) %verify(not md5 mtime size) %{confdir}/web.xml
%attr(0775,root,tomcat) %dir %{cachedir}
%attr(0775,root,tomcat) %dir %{tempdir}
%attr(0775,root,tomcat) %dir %{workdir}
%attr(0755,root,root) %{_bindir}/tomcat7-digest
%attr(0755,root,root) %{_bindir}/tomcat7-tool-wrapper
%attr(0755,root,root) %{_sbindir}/dtomcat7
%attr(0755,root,root) %{_sbindir}/tomcat7
%{bindir}/bootstrap.jar
%{bindir}/commons-daemon.jar
%{bindir}/catalina-tasks.xml
%{bindir}/tomcat-juli.jar
%{libdir}/tomcat-juli-%{version}.jar
%{libdir}/tomcat-juli.jar
%{homedir}/conf
%{homedir}/lib
%{homedir}/logs
%{homedir}/temp
%{homedir}/webapps
%{homedir}/work
%{_mavendepmapfragdir}/*
%doc apache-tomcat-%{version}-src/{LICENSE,NOTICE,RELEASE*}
%files admin
%defattr(-,root,root)
%config(noreplace) %attr(664,root,tomcat) %verify(not md5 mtime size) %{confdir}/Catalina/localhost/*manager.xml
%{appdir}/host-manager
%{appdir}/manager
%files webapps
%defattr(-,root,root)
%config(noreplace) %attr(664,root,tomcat) %verify(not md5 mtime size) %{confdir}/Catalina/localhost/examples.xml
%config(noreplace) %attr(664,root,tomcat) %verify(not md5 mtime size) %{confdir}/Catalina/localhost/ROOT.xml
%{appdir}/ROOT
%{appdir}/examples
%{appdir}/sample
%files el-%{el_api_version}-api
%defattr(-,root,root)
%{libdir}/%{tom_name}-el-%{el_api_version}-api-%{version}.jar
%{_javadir}/%{tom_name}-el-%{el_api_version}-api-%{version}.jar
%{_javadir}/%{tom_name}-el-%{el_api_version}-api.jar
%{_javadir}/elapi7-%{version}.jar
%{_javadir}/elapi7.jar
%{_mavenpomdir}/JPP-tomcat7-el-%{el_api_version}-api.pom
%files servlet-%{servlet_api_version}-api
%defattr(-,root,root)
%{libdir}/%{tom_name}-servlet-%{servlet_api_version}-api-%{version}.jar
%{_javadir}/%{tom_name}-servlet-%{servlet_api_version}-api-%{version}.jar
%{_javadir}/%{tom_name}-servlet-%{servlet_api_version}-api.jar
%{_javadir}/servletapi7-%{version}.jar
%{_javadir}/servletapi7.jar
%{_mavenpomdir}/JPP-tomcat7-servlet-%{servlet_api_version}-api.pom
%files jsp-%{jsp_api_version}-api
%defattr(-,root,root)
%{libdir}/%{tom_name}-jsp-%{jsp_api_version}-api-%{version}.jar
%{_javadir}/%{tom_name}-jsp-%{jsp_api_version}-api-%{version}.jar
%{_javadir}/%{tom_name}-jsp-%{jsp_api_version}-api.jar
%{_javadir}/jspapi7-%{version}.jar
%{_javadir}/jspapi7.jar
%{_mavenpomdir}/JPP-tomcat7-jsp-%{jsp_api_version}-api.pom
%files javadoc
%defattr(-,root,root)
%{_javadocdir}/%{tom_name}
%files el-%{el_api_version}-api-javadoc
%defattr(-,root,root)
%{_javadocdir}/elapi7
%files jsp-%{jsp_api_version}-api-javadoc
%defattr(-,root,root)
%{_javadocdir}/jspapi7
%files servlet-%{servlet_api_version}-api-javadoc
%defattr(-,root,root)
%{_javadocdir}/servletapi7
%files -n lib%{tom_name}
%defattr(-,root,root)
%{libdir}/annotations-api-%{version}.jar
%{libdir}/annotations-api.jar
%{libdir}/catalina-%{version}.jar
%{libdir}/catalina-ant-%{version}.jar
%{libdir}/catalina-ant.jar
%{libdir}/catalina-ha-%{version}.jar
%{libdir}/catalina-ha.jar
%{libdir}/catalina-tribes-%{version}.jar
%{libdir}/catalina-tribes.jar
%{libdir}/catalina.jar
%{libdir}/catalina-jmx-remote-%{version}.jar
%{libdir}/catalina-jmx-remote.jar
%{libdir}/catalina-ws-%{version}.jar
%{libdir}/catalina-ws.jar
%{libdir}/tomcat-api-%{version}.jar
%{libdir}/tomcat-api.jar
%{libdir}/tomcat-util-%{version}.jar
%{libdir}/tomcat-util.jar
%{libdir}/jasper-%{version}.jar
%{libdir}/jasper.jar
%{libdir}/jasper-el-%{version}.jar
%{libdir}/jasper-el.jar
%{libdir}/tomcat-coyote-%{version}.jar
%{libdir}/tomcat-coyote.jar
%{libdir}/tomcat-i18n-es-%{version}.jar
%{libdir}/tomcat-i18n-es.jar
%{libdir}/tomcat-i18n-fr-%{version}.jar
%{libdir}/tomcat-i18n-fr.jar
%{libdir}/tomcat-i18n-ja-%{version}.jar
%{libdir}/tomcat-i18n-ja.jar
%{libdir}/checkstyle.jar
%{libdir}/apache-commons-daemon-%{version}.jar
%{libdir}/apache-commons-daemon.jar
%{libdir}/apache-commons-dbcp-%{version}.jar
%{libdir}/apache-commons-dbcp.jar
%{libdir}/apache-commons-pool-%{version}.jar
%{libdir}/apache-commons-pool.jar
%{libdir}/commons-collections-tomcat5-%{version}.jar
%{libdir}/commons-collections-tomcat5.jar
%{libdir}/commons-collections.jar
%{libdir}/commons-daemon.jar
%{libdir}/commons-dbcp.jar
%{libdir}/ecj-%{version}.jar
%{libdir}/ecj.jar
%{libdir}/eclipse-ecj-%{version}.jar
%{libdir}/eclipse-ecj.jar
%{libdir}/jasper-jdt.jar
%{_datadir}/java/%{tom_name}/tomcat-jdbc-%{version}.jar
%{_datadir}/java/%{tom_name}/tomcat-jdbc.jar
%{_mavenpomdir}/JPP.%{tom_name}-annotations-api.pom
%{_mavenpomdir}/JPP.%{tom_name}-catalina-ant.pom
%{_mavenpomdir}/JPP.%{tom_name}-catalina-ha.pom
%{_mavenpomdir}/JPP.%{tom_name}-catalina-jmx-remote.pom
%{_mavenpomdir}/JPP.%{tom_name}-catalina-tribes.pom
%{_mavenpomdir}/JPP.%{tom_name}-catalina-ws.pom
%{_mavenpomdir}/JPP.%{tom_name}-catalina.pom
%{_mavenpomdir}/JPP.%{tom_name}-jasper-el.pom
%{_mavenpomdir}/JPP.%{tom_name}-jasper.pom
%{_mavenpomdir}/JPP.%{tom_name}-tomcat-api.pom
%{_mavenpomdir}/JPP.%{tom_name}-tomcat-coyote.pom
%if %with_embed
%{libdir}/tomcat-embed-core-%{version}.jar
%{libdir}/tomcat-embed-core.jar
%{libdir}/tomcat-embed-jasper-%{version}.jar
%{libdir}/tomcat-embed-jasper.jar
%{libdir}/tomcat-embed-logging-juli-%{version}.jar
%{libdir}/tomcat-embed-logging-juli.jar
%{libdir}/tomcat-embed-logging-log4j-%{version}.jar
%{libdir}/tomcat-embed-logging-log4j.jar
%{libdir}/tomcat-extras-juli-%{version}.jar
%{libdir}/tomcat-extras-juli.jar
%{libdir}/tomcat-extras-juli-adapters-%{version}.jar
%{libdir}/tomcat-extras-juli-adapters.jar
%{libdir}/jaxrpc.jar
%{libdir}/jsr109.jar
%{libdir}/wsdl4j.jar
%{_mavenpomdir}/JPP.%{tom_name}-tomcat-embed-core.pom
%{_mavenpomdir}/JPP.%{tom_name}-tomcat-embed-jasper.pom
%{_mavenpomdir}/JPP.%{tom_name}-tomcat-embed-logging-juli.pom
%{_mavenpomdir}/JPP.%{tom_name}-tomcat-embed-logging-log4j.pom
%{_mavenpomdir}/JPP.%{tom_name}-tomcat-extras-juli-adapters.pom
%{_mavenpomdir}/JPP.%{tom_name}-tomcat-extras-juli.pom
%endif
%{_mavenpomdir}/JPP.%{tom_name}-tomcat-i18n-es.pom
%{_mavenpomdir}/JPP.%{tom_name}-tomcat-i18n-fr.pom
%{_mavenpomdir}/JPP.%{tom_name}-tomcat-i18n-ja.pom
%{_mavenpomdir}/JPP.%{tom_name}-tomcat-juli.pom
%{_mavenpomdir}/JPP.%{tom_name}-tomcat-util.pom
%files webapp-docs
%defattr(0644,root,root,0755)
%config(noreplace) %attr(664,root,tomcat) %verify(not md5 mtime size) %{confdir}/Catalina/localhost/docs.xml
%{appdir}/docs
%files log4j
%defattr(0644,root,tomcat,0775)
%config(noreplace) %attr(664,root,tomcat) %verify(not md5 mtime size) %{confdir}/log4j.properties
%{libdir}/log4j-%{version}.jar
%{libdir}/log4j.jar
%dir %{_sysconfdir}/tomcat7
%attr(-,tomcat7,root) %{_sysconfdir}/tomcat7/catalina.policy
%attr(-,tomcat7,root) %{_sysconfdir}/tomcat7/catalina.properties
%attr(-,tomcat7,root) %{_sysconfdir}/tomcat7/context.xml
%attr(-,tomcat7,root) %{_sysconfdir}/tomcat7/logging.properties
%attr(-,tomcat7,root) %{_sysconfdir}/tomcat7/server.xml
%attr(-,tomcat7,root) %{_sysconfdir}/tomcat7/tomcat-users.xml
%attr(-,tomcat7,root) %{_sysconfdir}/tomcat7/tomcat-users.xsd
%attr(-,tomcat7,root) %{_sysconfdir}/tomcat7/web.xml
%{_unitdir}/tomcat7.service
%{_sysusersdir}/tomcat7.conf
%{_tmpfilesdir}/tomcat7.conf
%dir %{_datadir}/java/tomcat7
%{_datadir}/java/tomcat7/*.jar
%dir %{_datadir}/tomcat7/bin
%{_datadir}/tomcat7/bin/*
%{_datadir}/tomcat7/conf
%{_datadir}/tomcat7/lib
%{_datadir}/tomcat7/logs
%{_datadir}/tomcat7/temp
%{_datadir}/tomcat7/webapps
%{_datadir}/tomcat7/work
%attr(-,tomcat7,root) %dir %{_localstatedir}/lib/tomcat7
%attr(-,tomcat7,root) %dir %{_localstatedir}/lib/tomcat7/webapps
%attr(-,tomcat7,root) %dir %{_localstatedir}/lib/tomcat7/webapps/ROOT
%attr(-,tomcat7,root) %{_localstatedir}/lib/tomcat7/webapps/ROOT/*
%attr(-,tomcat7,root) %dir %{_localstatedir}/lib/tomcat7/webapps/docs
%attr(-,tomcat7,root) %{_localstatedir}/lib/tomcat7/webapps/docs/*
%attr(-,tomcat7,root) %dir %{_localstatedir}/lib/tomcat7/webapps/examples
%attr(-,tomcat7,root) %{_localstatedir}/lib/tomcat7/webapps/examples/*
%attr(-,tomcat7,root) %dir %{_localstatedir}/lib/tomcat7/webapps/host-manager
%attr(-,tomcat7,root) %{_localstatedir}/lib/tomcat7/webapps/host-manager/*
%attr(-,tomcat7,root) %dir %{_localstatedir}/lib/tomcat7/webapps/manager
%attr(-,tomcat7,root) %{_localstatedir}/lib/tomcat7/webapps/manager/*
%attr(-,tomcat7,root) %{_localstatedir}/log/tomcat7/catalina.err
%attr(-,tomcat7,root) %{_localstatedir}/log/tomcat7/catalina.out
%changelog
* Thu May 21 2020 Silvan Calarco <silvan.calarco@mambasoft.it> 7.0.103-2mamba
- require apache-commons-daemon and apache-commons-daemon-jsvc
* Sat May 16 2020 Silvan Calarco <silvan.calarco@mambasoft.it> 7.0.103-1mamba
- update to 7.0.103
* Fri Aug 26 2011 Automatic Build System <autodist@mambasoft.it> 7.0.20-1mamba
- update to 7.0.20

35
tomcat7.service Normal file
View File

@ -0,0 +1,35 @@
[Unit]
Description=Tomcat 7 servlet container
After=network.target
[Service]
Type=forking
PIDFile=/var/run/tomcat7.pid
Environment=CATALINA_PID=/var/run/tomcat7.pid
Environment=TOMCAT_JAVA_HOME=/usr/lib/jvm/default-runtime
Environment=CATALINA_HOME=/usr/share/tomcat7
Environment=CATALINA_BASE=/usr/share/tomcat7
Environment=CATALINA_OPTS=
Environment=ERRFILE=SYSLOG
Environment=OUTFILE=SYSLOG
ExecStart=/usr/bin/jsvc \
-Dcatalina.home=${CATALINA_HOME} \
-Dcatalina.base=${CATALINA_BASE} \
-Djava.io.tmpdir=/var/tmp/tomcat7/temp \
-cp /usr/share/java/commons-daemon.jar:/usr/share/java/eclipse-ecj.jar:${CATALINA_HOME}/bin/bootstrap.jar:${CATALINA_HOME}/bin/tomcat-juli.jar \
-user tomcat7 \
-java-home ${TOMCAT_JAVA_HOME} \
-pidfile /var/run/tomcat7.pid \
-errfile ${ERRFILE} \
-outfile ${OUTFILE} \
$CATALINA_OPTS \
org.apache.catalina.startup.Bootstrap
ExecStop=/usr/bin/jsvc \
-pidfile /var/run/tomcat7.pid \
-stop \
org.apache.catalina.startup.Bootstrap
[Install]
WantedBy=multi-user.target

1
tomcat7.sysusers Normal file
View File

@ -0,0 +1 @@
u tomcat7 65063 "Tomcat 7 user" /usr/share/tomcat7

5
tomcat7.tmpfiles Normal file
View File

@ -0,0 +1,5 @@
d /var/tmp/tomcat7/temp 0775 tomcat7 tomcat7
d /var/tmp/tomcat7/work 0775 tomcat7 tomcat7
d /var/lib/tomcat7 0775 tomcat7 tomcat7
d /var/lib/tomcat7/webapps 0775 tomcat7 tomcat7
d /var/log/tomcat7 0775 tomcat7 log