Compare commits

..

No commits in common. "c8-beta" and "c10s" have entirely different histories.

35 changed files with 266 additions and 392 deletions

1
.fmf/version Normal file
View File

@ -0,0 +1 @@
1

7
.gitignore vendored
View File

@ -1 +1,6 @@
SOURCES/tomcat-9.0.62.redhat-00018-src.zip
apache-tomcat-*-src.tar.gz
tomcat-*-src.zip
results_tomcat
tomcat*.src.rpm
apache-tomcat-*-src/
tomcat-*-src/

View File

@ -1 +0,0 @@
5becf21ed1eb5c031c31d5f295ce499234e98f82 SOURCES/tomcat-9.0.62.redhat-00018-src.zip

View File

@ -1,40 +0,0 @@
diff --git a/java/org/apache/catalina/mbeans/JmxRemoteLifecycleListener.java b/java/org/apache/catalina/mbeans/JmxRemoteLifecycleListener.java
index f62f8d1..db19960 100644
--- a/java/org/apache/catalina/mbeans/JmxRemoteLifecycleListener.java
+++ b/java/org/apache/catalina/mbeans/JmxRemoteLifecycleListener.java
@@ -611,34 +611,28 @@ public class JmxRemoteLifecycleListener extends SSLHostConfig implements Lifecyc
* Better to use the internal API than re-invent the wheel.
*/
@SuppressWarnings("restriction")
- private static class JmxRegistry extends sun.rmi.registry.RegistryImpl {
+ private static class JmxRegistry {
private static final long serialVersionUID = -3772054804656428217L;
private final String jmxName;
private final Remote jmxServer;
public JmxRegistry(int port, RMIClientSocketFactory csf,
RMIServerSocketFactory ssf, String jmxName, Remote jmxServer) throws RemoteException {
- super(port, csf, ssf);
this.jmxName = jmxName;
this.jmxServer = jmxServer;
}
- @Override
public Remote lookup(String name)
throws RemoteException, NotBoundException {
return (jmxName.equals(name)) ? jmxServer : null;
}
- @Override
public void bind(String name, Remote obj)
throws RemoteException, AlreadyBoundException, AccessException {
}
- @Override
public void unbind(String name)
throws RemoteException, NotBoundException, AccessException {
}
- @Override
public void rebind(String name, Remote obj)
throws RemoteException, AccessException {
}
- @Override
public String[] list() throws RemoteException {
return new String[] { jmxName };
}

View File

@ -1,8 +0,0 @@
diff -up ./java/org/apache/tomcat/util/modeler/mbeans-descriptors.dtd.orig ./java/org/apache/tomcat/util/modeler/mbeans-descriptors.dtd
--- ./java/org/apache/tomcat/util/modeler/mbeans-descriptors.dtd.orig 2023-02-07 14:11:25.294179017 -0500
+++ ./java/org/apache/tomcat/util/modeler/mbeans-descriptors.dtd 2023-02-07 14:11:28.629196705 -0500
@@ -1,4 +1,3 @@
-<?xml version="1.0" encoding="UTF-8"?>
<!--
Licensed to the Apache Software Foundation (ASF) under one or more
contributor license agreements. See the NOTICE file distributed with

View File

@ -1,7 +0,0 @@
# Add the JAVA 9 specific start-up parameters required by Tomcat
JDK_JAVA_OPTIONS="$JDK_JAVA_OPTIONS --add-opens=java.base/java.lang=ALL-UNNAMED"
JDK_JAVA_OPTIONS="$JDK_JAVA_OPTIONS --add-opens=java.base/java.io=ALL-UNNAMED"
JDK_JAVA_OPTIONS="$JDK_JAVA_OPTIONS --add-opens=java.base/java.util=ALL-UNNAMED"
JDK_JAVA_OPTIONS="$JDK_JAVA_OPTIONS --add-opens=java.base/java.util.concurrent=ALL-UNNAMED"
JDK_JAVA_OPTIONS="$JDK_JAVA_OPTIONS --add-opens=java.rmi/sun.rmi.transport=ALL-UNNAMED"
export JDK_JAVA_OPTIONS

View File

@ -1,74 +0,0 @@
diff --git a/build.xml b/build.xml
index 5a0be1b..2131211 100644
--- a/build.xml
+++ b/build.xml
@@ -3062,7 +3062,7 @@ skip.installer property in build.properties" />
<target name="download-compile"
description="Download components necessary to compile"
- depends="setup-bnd">
+ >
<!-- Download Commons Daemon -->
<antcall target="downloadgz-2">
diff --git a/java/org/apache/el/ExpressionFactoryImpl.java b/java/org/apache/el/ExpressionFactoryImpl.java
index a6faeb6..5afbda7 100644
--- a/java/org/apache/el/ExpressionFactoryImpl.java
+++ b/java/org/apache/el/ExpressionFactoryImpl.java
@@ -33,7 +33,7 @@ import org.apache.el.util.MessageFactory;
*
* @author Jacob Hookom [jacob@hookom.net]
*/
-@aQute.bnd.annotation.spi.ServiceProvider(value=ExpressionFactory.class)
+//@aQute.bnd.annotation.spi.ServiceProvider(value=ExpressionFactory.class)
public class ExpressionFactoryImpl extends ExpressionFactory {
@Override
diff --git a/java/org/apache/juli/logging/LogFactory.java b/java/org/apache/juli/logging/LogFactory.java
index 56c805a..bd6eb0d 100644
--- a/java/org/apache/juli/logging/LogFactory.java
+++ b/java/org/apache/juli/logging/LogFactory.java
@@ -21,7 +21,7 @@ import java.nio.file.FileSystems;
import java.util.ServiceLoader;
import java.util.logging.LogManager;
-import aQute.bnd.annotation.spi.ServiceConsumer;
+//import aQute.bnd.annotation.spi.ServiceConsumer;
/**
* This is a modified LogFactory that uses a simple {@link ServiceLoader} based
@@ -63,7 +63,7 @@ import aQute.bnd.annotation.spi.ServiceConsumer;
* @author Costin Manolache
* @author Richard A. Sitze
*/
-@ServiceConsumer(value=org.apache.juli.logging.Log.class)
+//@ServiceConsumer(value=org.apache.juli.logging.Log.class)
public class LogFactory {
private static final LogFactory singleton = new LogFactory();
diff --git a/java/org/apache/tomcat/websocket/WsContainerProvider.java b/java/org/apache/tomcat/websocket/WsContainerProvider.java
index 3cb8873..7bc50f6 100644
--- a/java/org/apache/tomcat/websocket/WsContainerProvider.java
+++ b/java/org/apache/tomcat/websocket/WsContainerProvider.java
@@ -19,7 +19,7 @@ package org.apache.tomcat.websocket;
import javax.websocket.ContainerProvider;
import javax.websocket.WebSocketContainer;
-@aQute.bnd.annotation.spi.ServiceProvider(value=ContainerProvider.class)
+//@aQute.bnd.annotation.spi.ServiceProvider(value=ContainerProvider.class)
public class WsContainerProvider extends ContainerProvider {
@Override
diff --git a/java/org/apache/tomcat/websocket/server/DefaultServerEndpointConfigurator.java b/java/org/apache/tomcat/websocket/server/DefaultServerEndpointConfigurator.java
index 5c385ed..2e4e82e 100644
--- a/java/org/apache/tomcat/websocket/server/DefaultServerEndpointConfigurator.java
+++ b/java/org/apache/tomcat/websocket/server/DefaultServerEndpointConfigurator.java
@@ -26,7 +26,7 @@ import javax.websocket.HandshakeResponse;
import javax.websocket.server.HandshakeRequest;
import javax.websocket.server.ServerEndpointConfig;
-@aQute.bnd.annotation.spi.ServiceProvider(value=ServerEndpointConfig.Configurator.class)
+//@aQute.bnd.annotation.spi.ServiceProvider(value=ServerEndpointConfig.Configurator.class)
public class DefaultServerEndpointConfigurator
extends ServerEndpointConfig.Configurator {

View File

@ -1,25 +0,0 @@
--- conf/catalina.policy.orig 2022-11-04 16:17:41.227506990 +0800
+++ conf/catalina.policy 2022-11-04 16:21:51.393351415 +0800
@@ -56,6 +56,15 @@ grant codeBase "file:${java.home}/lib/ex
// permission java.security.AllPermission;
//};
+// ========== RHEL SPECIFIC CODE PERMISSIONS =======================================
+
+
+// Allowing everything in /usr/share/java allows too many unknowns to be permitted
+// Specifying the individual jars that tomcat needs to function with the security manager
+// is the safest way forward.
+grant codeBase "file:/usr/share/java/ecj/ecj.jar" {
+ permission java.security.AllPermission;
+};
// ========== CATALINA CODE PERMISSIONS =======================================
@@ -261,4 +270,4 @@ grant codeBase "file:${catalina.home}/we
//
// The permissions granted to a specific JAR
// grant codeBase "war:file:${catalina.base}/webapps/examples.war*/WEB-INF/lib/foo.jar" {
-// };
\ No newline at end of file
+// };

View File

@ -1,12 +0,0 @@
diff -up ./res/bnd/build-defaults.bnd.orig ./res/bnd/build-defaults.bnd
--- ./res/bnd/build-defaults.bnd.orig 2020-07-13 13:47:01.229077747 -0400
+++ ./res/bnd/build-defaults.bnd 2020-07-13 13:47:12.923095618 -0400
@@ -13,7 +13,7 @@
# See the License for the specific language governing permissions and
# limitations under the License.
-Bundle-Version: ${version_cleanup;${version}}
+Bundle-Version: ${version}
Specification-Title: Apache Tomcat
Specification-Version: ${version.major.minor}

View File

@ -1,42 +0,0 @@
#!/bin/bash
if [ -r /usr/share/java-utils/java-functions ]; then
. /usr/share/java-utils/java-functions
else
echo "Can't read Java functions library, aborting"
exit 1
fi
_save_function() {
local ORIG_FUNC=$(declare -f $1)
local NEWNAME_FUNC="$2${ORIG_FUNC#$1}"
eval "$NEWNAME_FUNC"
}
run_jsvc(){
if [ -x /usr/bin/jsvc ]; then
TOMCAT_USER="${TOMCAT_USER:-tomcat}"
JSVC="/usr/bin/jsvc"
JSVC_OPTS="-nodetach -pidfile /var/run/jsvc-tomcat${NAME}.pid -user ${TOMCAT_USER} -outfile ${CATALINA_BASE}/logs/catalina.out -errfile ${CATALINA_BASE}/logs/catalina.out"
if [ "$1" = "stop" ]; then
JSVC_OPTS="${JSVC_OPTS} -stop"
fi
exec "${JSVC}" ${JSVC_OPTS} ${FLAGS} -classpath "${CLASSPATH}" ${OPTIONS} "${MAIN_CLASS}" "${@}"
else
echo "Can't find /usr/bin/jsvc executable"
fi
}
_save_function run run_java
run() {
if [ "${USE_JSVC}" = "true" ] ; then
run_jsvc $@
else
run_java $@
fi
}

1
ci.fmf Normal file
View File

@ -0,0 +1 @@
resultsdb-testcase: separate

6
gating.yaml Normal file
View File

@ -0,0 +1,6 @@
--- !Policy
product_versions:
- rhel-10
decision_context: osci_compose_gate
rules:
- !PassingTestCaseRule {test_case_name: osci.brew-build./plans/tier1-internal.functional}

View File

@ -0,0 +1,7 @@
# Add the module start-up parameters required by Tomcat
JAVA_OPTS="$JAVA_OPTS --add-opens=java.base/java.lang=ALL-UNNAMED"
JAVA_OPTS="$JAVA_OPTS --add-opens=java.base/java.io=ALL-UNNAMED"
JAVA_OPTS="$JAVA_OPTS --add-opens=java.base/java.util=ALL-UNNAMED"
JAVA_OPTS="$JAVA_OPTS --add-opens=java.base/java.util.concurrent=ALL-UNNAMED"
JAVA_OPTS="$JAVA_OPTS --add-opens=java.rmi/sun.rmi.transport=ALL-UNNAMED"
export JAVA_OPTS

11
plans/tier1-internal.fmf Normal file
View File

@ -0,0 +1,11 @@
summary: Internal Tier1 beakerlib tests.
discover:
- name: rhel
how: fmf
url: git://pkgs.devel.redhat.com/tests/tomcat
filter: 'tier: 1'
execute:
how: tmt
adjust:
enabled: false
when: distro == centos-stream-10

7
plans/tier1-public.fmf Normal file
View File

@ -0,0 +1,7 @@
summary: Public Tier1 beakerlib tests
discover:
how: fmf
url: https://src.fedoraproject.org/tests/tomcat.git
filter: 'tier: 1'
execute:
how: tmt

View File

@ -1,7 +1,6 @@
diff -up ./build.xml.orig ./build.xml
--- build.xml.orig 2021-07-07 10:53:55.493742841 +0800
+++ build.xml 2021-07-07 11:09:43.107968515 +0800
@@ -1020,7 +1020,7 @@
--- build.xml.orig 2025-02-04 18:48:03.291725907 +0100
+++ build.xml 2025-02-04 18:56:28.876849900 +0100
@@ -1071,7 +1071,7 @@
filesDir="${tomcat.classes}"
filesId="files.annotations-api"
manifest="${tomcat.manifests}/annotations-api.jar.manifest"
@ -10,7 +9,7 @@ diff -up ./build.xml.orig ./build.xml
<!-- Servlet Implementation JAR File -->
<jarIt jarfile="${servlet-api.jar}"
@@ -1029,41 +1029,41 @@
@@ -1080,48 +1080,48 @@
manifest="${tomcat.manifests}/servlet-api.jar.manifest"
notice="${tomcat.manifests}/servlet-api.jar.notice"
license="${tomcat.manifests}/servlet-api.jar.license"
@ -39,6 +38,14 @@ diff -up ./build.xml.orig ./build.xml
filesId="files.websocket-api"
manifest="${tomcat.manifests}/websocket-api.jar.manifest"
- addOSGi="true" />
+ addOSGi="false" />
<!-- WebSocket Client API JAR File -->
<jarIt jarfile="${websocket-client-api.jar}"
filesDir="${tomcat.classes}"
filesId="files.websocket-client-api"
manifest="${tomcat.manifests}/websocket-client-api.jar.manifest"
- addOSGi="true" />
+ addOSGi="false" />
<!-- JASPIC API JAR File -->
@ -58,7 +65,7 @@ diff -up ./build.xml.orig ./build.xml
<!-- Bootstrap JAR File -->
<jarIt jarfile="${bootstrap.jar}"
@@ -1075,61 +1075,61 @@
@@ -1133,61 +1133,61 @@
<jarIt jarfile="${tomcat-util.jar}"
filesDir="${tomcat.classes}"
filesId="files.tomcat-util"
@ -130,7 +137,7 @@ diff -up ./build.xml.orig ./build.xml
<!-- Catalina Ant Tasks JAR File -->
<jarIt jarfile="${catalina-ant.jar}"
@@ -1140,27 +1140,27 @@
@@ -1198,27 +1198,27 @@
<jarIt jarfile="${catalina-storeconfig.jar}"
filesDir="${tomcat.classes}"
filesId="files.catalina-storeconfig"
@ -162,7 +169,7 @@ diff -up ./build.xml.orig ./build.xml
<!-- i18n JARs -->
<jar jarfile="${tomcat.build}/lib/tomcat-i18n-cs.jar"
@@ -1620,7 +1620,7 @@
@@ -1704,7 +1704,7 @@
filesId="files.tomcat-embed-core"
notice="${tomcat.manifests}/servlet-api.jar.notice"
license="${tomcat.manifests}/servlet-api.jar.license"
@ -171,7 +178,7 @@ diff -up ./build.xml.orig ./build.xml
addGraal="true"
graalPrefix="org.apache.tomcat.embed/tomcat-embed-core"
graalFiles="res/graal/tomcat-embed-core/native-image"
@@ -1628,7 +1628,7 @@
@@ -1712,7 +1712,7 @@
<jarIt jarfile="${tomcat-embed-el.jar}"
filesDir="${tomcat.classes}"
filesId="files.tomcat-embed-el"
@ -180,7 +187,7 @@ diff -up ./build.xml.orig ./build.xml
addGraal="true"
graalPrefix="org.apache.tomcat.embed/tomcat-embed-el"
graalFiles="res/graal/tomcat-embed-el/native-image"
@@ -1637,7 +1637,7 @@
@@ -1721,7 +1721,7 @@
filesDir="${tomcat.classes}"
filesId="files.tomcat-embed-jasper"
meta-inf="${tomcat.manifests}/jasper.jar"
@ -189,7 +196,7 @@ diff -up ./build.xml.orig ./build.xml
addGraal="true"
graalPrefix="org.apache.tomcat.embed/tomcat-embed-jasper"
graalFiles="res/graal/tomcat-embed-jasper/native-image"
@@ -1646,7 +1646,7 @@
@@ -1730,7 +1730,7 @@
filesDir="${tomcat.classes}"
filesId="files.tomcat-embed-websocket"
meta-inf="${tomcat.manifests}/tomcat-websocket.jar"

1
sources Normal file
View File

@ -0,0 +1 @@
SHA512 (tomcat-10.1.8.redhat-00022-src.zip) = 78c9fadb1cbe42047860acb3894a6e9c47d07ec05229e0a31813737a9ebdc7c7f8ce72077951741535c7ac5e083ab8bd852897f6f6901fd19fbee5f6ca833be9

View File

@ -0,0 +1,30 @@
--- java/org/apache/jasper/compiler/JDTCompiler.java.orig 2025-02-04 19:19:35.610448198 +0100
+++ java/org/apache/jasper/compiler/JDTCompiler.java 2025-02-04 19:22:46.320745556 +0100
@@ -314,9 +314,9 @@ public class JDTCompiler extends org.apa
} else if(opt.equals("17")) {
settings.put(CompilerOptions.OPTION_Source, CompilerOptions.VERSION_17);
} else if(opt.equals("18")) {
- settings.put(CompilerOptions.OPTION_Source, CompilerOptions.VERSION_18);
+ settings.put(CompilerOptions.OPTION_Source, "18");
} else if (opt.equals("19")) {
- settings.put(CompilerOptions.OPTION_Source, CompilerOptions.VERSION_19);
+ settings.put(CompilerOptions.OPTION_Source, "19");
} else if (opt.equals("20")) {
// Constant not available in latest ECJ version shipped with
// Tomcat. May be supported in a snapshot build.
@@ -389,11 +389,11 @@ public class JDTCompiler extends org.apa
settings.put(CompilerOptions.OPTION_TargetPlatform, CompilerOptions.VERSION_17);
settings.put(CompilerOptions.OPTION_Compliance, CompilerOptions.VERSION_17);
} else if(opt.equals("18")) {
- settings.put(CompilerOptions.OPTION_TargetPlatform, CompilerOptions.VERSION_18);
- settings.put(CompilerOptions.OPTION_Compliance, CompilerOptions.VERSION_18);
+ settings.put(CompilerOptions.OPTION_TargetPlatform, "18");
+ settings.put(CompilerOptions.OPTION_Compliance, "18");
} else if (opt.equals("19")) {
- settings.put(CompilerOptions.OPTION_TargetPlatform, CompilerOptions.VERSION_19);
- settings.put(CompilerOptions.OPTION_Compliance, CompilerOptions.VERSION_19);
+ settings.put(CompilerOptions.OPTION_TargetPlatform, "19");
+ settings.put(CompilerOptions.OPTION_Compliance, "19");
} else if (opt.equals("20")) {
// Constant not available in latest ECJ version shipped with
// Tomcat. May be supported in a snapshot build.

View File

@ -0,0 +1,10 @@
--- build.xml.orig 2023-01-29 17:38:29.477052402 +0800
+++ build.xml 2023-01-29 17:42:03.369583841 +0800
@@ -216,6 +216,7 @@
<!-- Classpaths -->
<path id="compile.classpath">
<pathelement location="${bnd.jar}"/>
+ <pathelement location="${bnd-annotation.jar}"/>
<pathelement location="${jdt.jar}"/>
<pathelement location="${jaxrpc-lib.jar}"/>
<pathelement location="${wsdl4j-lib.jar}"/>

View File

@ -0,0 +1,16 @@
--- conf/catalina.policy.orig 2024-05-22 16:12:23.809886452 +0300
+++ conf/catalina.policy 2024-05-22 16:14:38.913939654 +0300
@@ -55,6 +55,14 @@
permission java.security.AllPermission;
};
+// ========== RHEL SPECIFIC CODE PERMISSIONS =======================================
+
+// Allowing everything in /usr/share/java allows too many unknowns to be permitted
+// Specifying the individual jars that tomcat needs to function with the security manager
+// is the safest way forward.
+grant codeBase "file:/usr/share/java/ecj/ecj.jar" {
+ permission java.security.AllPermission;
+};
// ========== CATALINA CODE PERMISSIONS =======================================

View File

@ -28,24 +28,15 @@ CATALINA_HOME="@@@TCHOME@@@"
# System-wide tmp
CATALINA_TMPDIR="/var/cache/tomcat/temp"
# 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=/usr/lib"
# Set default javax.sql.DataSource factory to apache commons one. See rhbz#1214381
JAVA_OPTS="-Djavax.sql.DataSource.Factory=org.apache.commons.dbcp.BasicDataSourceFactory"
# You can change your tomcat locale here
#LANG="en_US"
# Run tomcat under the Java Security Manager
SECURITY_MANAGER="false"
# SHUTDOWN_WAIT has been deprecated. To change the shutdown wait time, set
# TimeoutStopSec in tomcat.service.
# If you wish to further customize your tomcat environment,
# put your own definitions here
# (i.e. LD_LIBRARY_PATH for some jdbc drivers)
# You can also pass parameters to Java here by defining JAVA_OPTS variable
# (e.g. JAVA_OPTS="-Xminf0.1 -Xmaxf0.3")

19
tomcat-build.patch Normal file
View File

@ -0,0 +1,19 @@
diff -up ./res/bnd/build-defaults.bnd.orig ./res/bnd/build-defaults.bnd
--- res/bnd/build-defaults.bnd.orig 2023-10-16 11:23:04.752754202 +0800
+++ res/bnd/build-defaults.bnd 2023-10-16 11:23:29.931876910 +0800
@@ -13,7 +13,7 @@
# See the License for the specific language governing permissions and
# limitations under the License.
-Bundle-Version: ${version_cleanup;${version}}
+Bundle-Version: ${version}
Bundle-License: https://www.apache.org/licenses/LICENSE-2.0.txt
Specification-Title: Apache Tomcat
@@ -36,4 +36,4 @@ X-Compile-Target-JDK: ${compile.release}
-removeheaders: DSTAMP,TODAY,TSTAMP
-module.name: org.apache.${replace;${Bundle-Name};-;.}
\ No newline at end of file
+module.name: org.apache.${replace;${Bundle-Name};-;.}

21
tomcat-functions Normal file
View File

@ -0,0 +1,21 @@
#!/bin/bash
if [ -r /usr/share/java-utils/java-functions ]; then
. /usr/share/java-utils/java-functions
else
echo "Can't read Java functions library, aborting"
exit 1
fi
_save_function() {
local ORIG_FUNC=$(declare -f $1)
local NEWNAME_FUNC="$2${ORIG_FUNC#$1}"
eval "$NEWNAME_FUNC"
}
_save_function run run_java
run() {
run_java $@
}

View File

@ -28,19 +28,17 @@
# OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
#
%global jspspec 2.3
%global major_version 9
%global minor_version 0
%global micro_version 62
%global packdname %{name}-%{major_version}.%{minor_version}.%{micro_version}.redhat-00018-src
%global servletspec 4.0
%global elspec 3.0
%global jspspec 3.1
%global major_version 10
%global minor_version 1
%global micro_version 8
%global packdname %{name}-%{major_version}.%{minor_version}.%{micro_version}.redhat-00022-src
%global servletspec 6.0
%global elspec 5.0
%global tcuid 53
# Recommended version is specified in java/org/apache/catalina/core/AprLifecycleListener.java
%global native_version 1.2.21
# FHS 2.3 compliant tree structure - http://www.pathname.com/fhs/2.3/
# FHS 3.0 compliant tree structure - http://refspecs.linuxfoundation.org/FHS_3.0/fhs/index.html
%global basedir %{_var}/lib/%{name}
%global appdir %{basedir}/webapps
%global homedir %{_datadir}/%{name}
@ -51,65 +49,58 @@
%global cachedir %{_var}/cache/%{name}
%global tempdir %{cachedir}/temp
%global workdir %{cachedir}/work
%global _systemddir /lib/systemd/system
Name: tomcat
Epoch: 1
Version: %{major_version}.%{minor_version}.%{micro_version}
Release: 29%{?dist}
Release: 2%{?dist}
Summary: Apache Servlet/JSP Engine, RI for Servlet %{servletspec}/JSP %{jspspec} API
License: ASL 2.0
License: Apache-2.0
URL: http://tomcat.apache.org/
Source0: %{packdname}.zip
Source1: %{name}-%{major_version}.%{minor_version}.conf
Source3: %{name}-%{major_version}.%{minor_version}.sysconfig
Source4: %{name}-%{major_version}.%{minor_version}.wrapper
Source5: %{name}-%{major_version}.%{minor_version}.logrotate
Source6: %{name}-%{major_version}.%{minor_version}-digest.script
Source7: %{name}-%{major_version}.%{minor_version}-tool-wrapper.script
Source11: %{name}-%{major_version}.%{minor_version}.service
Source21: tomcat-functions
Source30: tomcat-preamble
Source31: tomcat-server
Source32: tomcat-named.service
Source33: java-9-start-up-parameters.conf
Source2: %{name}-%{major_version}.%{minor_version}.sysconfig
Source3: %{name}-%{major_version}.%{minor_version}.wrapper
Source4: %{name}-%{major_version}.%{minor_version}.logrotate
Source5: %{name}-%{major_version}.%{minor_version}-digest.script
Source6: %{name}-%{major_version}.%{minor_version}-tool-wrapper.script
Source7: %{name}-%{major_version}.%{minor_version}.service
Source8: %{name}-functions
Source9: %{name}-preamble
Source10: %{name}-server
Source11: %{name}-named.service
Source12: module-start-up-parameters.conf
Patch0: %{name}-%{major_version}.%{minor_version}-bootstrap-MANIFEST.MF.patch
Patch1: %{name}-%{major_version}.%{minor_version}-tomcat-users-webapp.patch
Patch2: %{name}-build.patch
Patch3: %{name}-%{major_version}.%{minor_version}-catalina-policy.patch
Patch4: rhbz-1857043.patch
# remove bnd dependency which version is too low on rhel8
Patch6: remove-bnd-annotation.patch
Patch7: JmxRemoteLifecycleListener.patch
Patch8: fix-malformed-dtd.patch
Patch4: %{name}-%{major_version}.%{minor_version}-bnd-annotation.patch
Patch5: %{name}-%{major_version}.%{minor_version}-JDTCompiler.patch
Patch6: rhbz-1857043.patch
BuildArch: noarch
BuildRequires: ant
BuildRequires: ecj
BuildRequires: ant >= 1.10.2
BuildRequires: ecj >= 4.20
BuildRequires: findutils
BuildRequires: java-devel
BuildRequires: javapackages-local
BuildRequires: aqute-bnd
BuildRequires: aqute-bndlib
BuildRequires: systemd
BuildRequires: tomcat-jakartaee-migration
Requires: (java-headless >= 1:1.8 or java-1.8.0-headless or java-11-headless or java-17-headless or java >= 1:1.8)
Requires: java-headless
Requires: javapackages-tools
Requires: %{name}-lib = %{epoch}:%{version}-%{release}
%if 0%{?fedora} || 0%{?rhel} > 7
Recommends: tomcat-native >= %{native_version}
%endif
Requires(pre): shadow-utils
Requires(post): systemd
Requires(preun): systemd
Requires(postun): systemd
Conflicts: pki-servlet-engine <= 1:9.0.50
# added after log4j sub-package was removed
Provides: %{name}-log4j = %{epoch}:%{version}-%{release}
Conflicts: tomcat9
%description
Tomcat is the servlet container that is used in the official Reference
@ -124,6 +115,8 @@ to be a collaboration of the best-of-breed developers from around the world.
%package admin-webapps
Summary: The host-manager and manager web applications for Apache Tomcat
Requires: %{name} = %{epoch}:%{version}-%{release}
Conflicts: tomcat9
Conflicts: tomcat9-admin-webapps
%description admin-webapps
The host-manager and manager web applications for Apache Tomcat.
@ -131,6 +124,8 @@ The host-manager and manager web applications for Apache Tomcat.
%package docs-webapp
Summary: The docs web application for Apache Tomcat
Requires: %{name} = %{epoch}:%{version}-%{release}
Conflicts: tomcat9
Conflicts: tomcat9-docs-webapp
%description docs-webapp
The docs web application for Apache Tomcat.
@ -138,10 +133,12 @@ The docs web application for Apache Tomcat.
%package jsp-%{jspspec}-api
Summary: Apache Tomcat JavaServer Pages v%{jspspec} API Implementation Classes
Provides: jsp = %{jspspec}
Obsoletes: %{name}-jsp-2.2-api
Obsoletes: %{name}-jsp-api < %{jspspec}
Obsoletes: %{name}-jsp-2.3-api < %{version}
Requires: %{name}-servlet-%{servletspec}-api = %{epoch}:%{version}-%{release}
Requires: %{name}-el-%{elspec}-api = %{epoch}:%{version}-%{release}
Conflicts: pki-servlet-engine <= 1:9.0.50
Conflicts: tomcat9
Conflicts: tomcat9-jsp-2.3-api
%description jsp-%{jspspec}-api
Apache Tomcat JSP API Implementation Classes.
@ -151,9 +148,14 @@ Summary: Libraries needed to run the Tomcat Web container
Requires: %{name}-jsp-%{jspspec}-api = %{epoch}:%{version}-%{release}
Requires: %{name}-servlet-%{servletspec}-api = %{epoch}:%{version}-%{release}
Requires: %{name}-el-%{elspec}-api = %{epoch}:%{version}-%{release}
Requires: ecj >= 1:4.10
Requires: ecj >= 4.20
Recommends: tomcat-jakartaee-migration
Requires(preun): coreutils
Conflicts: pki-servlet-engine <= 1:9.0.50
Conflicts: tomcat9
Conflicts: tomcat9-lib
Conflicts: tomcat9-jsp-2.3-api
Conflicts: tomcat9-servlet-4.0-api
Conflicts: tomcat9-el-3.0-api
%description lib
Libraries needed to run the Tomcat Web container.
@ -161,10 +163,10 @@ Libraries needed to run the Tomcat Web container.
%package servlet-%{servletspec}-api
Summary: Apache Tomcat Java Servlet v%{servletspec} API Implementation Classes
Provides: servlet = %{servletspec}
Provides: servlet6
Provides: servlet3
Obsoletes: %{name}-servlet-3.1-api
Conflicts: pki-servlet-4.0-api <= 1:9.0.50
Obsoletes: %{name}-servlet-api < %{servletspec}
Obsoletes: %{name}-servlet-4.0-api < %{version}
Conflicts: tomcat9
Conflicts: tomcat9-servlet-4.0-api
%description servlet-%{servletspec}-api
Apache Tomcat Servlet API Implementation Classes.
@ -172,8 +174,10 @@ Apache Tomcat Servlet API Implementation Classes.
%package el-%{elspec}-api
Summary: Apache Tomcat Expression Language v%{elspec} API Implementation Classes
Provides: el_api = %{elspec}
Obsoletes: %{name}-el-2.2-api
Conflicts: pki-servlet-engine <= 1:9.0.50 and pki-servlet-container <= 1:9.0.7
Obsoletes: %{name}-el-api < %{elspec}
Obsoletes: %{name}-el-3.0-api < %{version}
Conflicts: tomcat9
Conflicts: tomcat9-el-3.0-api
%description el-%{elspec}-api
Apache Tomcat EL API Implementation Classes.
@ -181,6 +185,8 @@ Apache Tomcat EL API Implementation Classes.
%package webapps
Summary: The ROOT web application for Apache Tomcat
Requires: %{name} = %{epoch}:%{version}-%{release}
Conflicts: tomcat9
Conflicts: tomcat9-webapps
%description webapps
The ROOT web application for Apache Tomcat.
@ -191,30 +197,26 @@ The ROOT web application for Apache Tomcat.
find . -type f \( -name "*.bat" -o -name "*.class" -o -name Thumbs.db -o -name "*.gz" -o \
-name "*.jar" -o -name "*.war" -o -name "*.zip" \) -delete
%patch -P0 -p0
%patch -P1 -p0
%patch -P2 -p0
%patch -P3 -p0
%patch -P4 -p0
%patch -P6 -p1
%patch -P7 -p1
%patch -P8 -p1
%patch 0 -p0
%patch 1 -p0
%patch 3 -p0
%patch 4 -p0
%patch 5 -p0
%patch 6 -p0
# Remove webservices naming resources as it's generally unused
%{__rm} -rf java/org/apache/naming/factory/webservices
# Configure maven files
%mvn_package ":tomcat-el-api" tomcat-el-api
%mvn_alias "org.apache.tomcat:tomcat-el-api" "org.eclipse.jetty.orbit:javax.el"
%mvn_alias "org.apache.tomcat:tomcat-el-api" "jakarta.servlet:jakarta.servlet-api"
%mvn_package ":tomcat-jsp-api" tomcat-jsp-api
%mvn_alias "org.apache.tomcat:tomcat-jsp-api" "org.eclipse.jetty.orbit:javax.servlet.jsp"
%mvn_alias "org.apache.tomcat:tomcat-jsp-api" "jakarta.servlet:jakarta.servlet.jsp"
%mvn_package ":tomcat-servlet-api" tomcat-servlet-api
%build
export OPT_JAR_LIST="xalan-j2-serializer"
# we don't care about the tarballs and we're going to replace
# tomcat-dbcp.jar with apache-commons-{collections,dbcp,pool}-tomcat5.jar
# we don't care about the tarballs and we're going to replace jars
# so just create a dummy file for later removal
touch HACK
@ -230,15 +232,17 @@ touch HACK
-Dnsis.exe="HACK" \
-Djaxrpc-lib.jar="HACK" \
-Dwsdl4j-lib.jar="HACK" \
-Dbnd.jar="HACK" \
-Dbnd.jar="$(build-classpath aqute-bnd/biz.aQute.bnd)" \
-Dbnd-annotation.jar="$(build-classpath aqute-bnd/biz.aQute.bnd.annotation)" \
-Dversion="%{version}" \
-Dversion.build="%{micro_version}" \
-Dmigration-lib.jar="$(build-classpath tomcat-jakartaee-migration/jakartaee-migration.jar)" \
deploy
# remove some jars that we'll replace with symlinks later
%{__rm} output/build/lib/ecj.jar
%{__rm} output/build/bin/commons-daemon.jar output/build/lib/ecj.jar output/build/lib/jakartaee-migration.jar
# Remove the example webapps per Apache Tomcat Security Considerations
# see https://tomcat.apache.org/tomcat-9.0-doc/security-howto.html
# see https://tomcat.apache.org/tomcat-10.1-doc/security-howto.html
%{__rm} -rf output/build/webapps/examples
@ -246,7 +250,6 @@ touch HACK
# build initial path structure
%{__install} -d -m 0755 ${RPM_BUILD_ROOT}%{_bindir}
%{__install} -d -m 0755 ${RPM_BUILD_ROOT}%{_sbindir}
%{__install} -d -m 0755 ${RPM_BUILD_ROOT}%{_systemddir}
%{__install} -d -m 0755 ${RPM_BUILD_ROOT}%{_sysconfdir}/logrotate.d
%{__install} -d -m 0755 ${RPM_BUILD_ROOT}%{_sysconfdir}/sysconfig
%{__install} -d -m 0755 ${RPM_BUILD_ROOT}%{appdir}
@ -279,33 +282,33 @@ popd
> ${RPM_BUILD_ROOT}%{confdir}/%{name}.conf
%{__sed} -e "s|\@\@\@TCHOME\@\@\@|%{homedir}|g" \
-e "s|\@\@\@TCTEMP\@\@\@|%{tempdir}|g" \
-e "s|\@\@\@LIBDIR\@\@\@|%{_libdir}|g" %{SOURCE3} \
-e "s|\@\@\@LIBDIR\@\@\@|%{_libdir}|g" %{SOURCE2} \
> ${RPM_BUILD_ROOT}%{_sysconfdir}/sysconfig/%{name}
%{__install} -m 0644 %{SOURCE4} \
%{__install} -m 0755 %{SOURCE3} \
${RPM_BUILD_ROOT}%{_sbindir}/%{name}
%{__install} -m 0644 %{SOURCE11} \
%{__install} -m 0644 %{SOURCE7} \
${RPM_BUILD_ROOT}%{_unitdir}/%{name}.service
%{__sed} -e "s|\@\@\@TCLOG\@\@\@|%{logdir}|g" %{SOURCE5} \
%{__sed} -e "s|\@\@\@TCLOG\@\@\@|%{logdir}|g" %{SOURCE4} \
> ${RPM_BUILD_ROOT}%{_sysconfdir}/logrotate.d/%{name}.disabled
%{__sed} -e "s|\@\@\@TCHOME\@\@\@|%{homedir}|g" \
-e "s|\@\@\@TCTEMP\@\@\@|%{tempdir}|g" \
-e "s|\@\@\@LIBDIR\@\@\@|%{_libdir}|g" %{SOURCE6} \
-e "s|\@\@\@LIBDIR\@\@\@|%{_libdir}|g" %{SOURCE5} \
> ${RPM_BUILD_ROOT}%{_bindir}/%{name}-digest
%{__sed} -e "s|\@\@\@TCHOME\@\@\@|%{homedir}|g" \
-e "s|\@\@\@TCTEMP\@\@\@|%{tempdir}|g" \
-e "s|\@\@\@LIBDIR\@\@\@|%{_libdir}|g" %{SOURCE7} \
-e "s|\@\@\@LIBDIR\@\@\@|%{_libdir}|g" %{SOURCE6} \
> ${RPM_BUILD_ROOT}%{_bindir}/%{name}-tool-wrapper
%{__install} -m 0644 %{SOURCE21} \
%{__install} -m 0644 %{SOURCE8} \
${RPM_BUILD_ROOT}%{_libexecdir}/%{name}/functions
%{__install} -m 0755 %{SOURCE30} \
%{__install} -m 0755 %{SOURCE9} \
${RPM_BUILD_ROOT}%{_libexecdir}/%{name}/preamble
%{__install} -m 0755 %{SOURCE31} \
%{__install} -m 0755 %{SOURCE10} \
${RPM_BUILD_ROOT}%{_libexecdir}/%{name}/server
%{__install} -m 0644 %{SOURCE32} \
%{__install} -m 0644 %{SOURCE11} \
${RPM_BUILD_ROOT}%{_unitdir}/%{name}@.service
%{__install} -m 0644 %{SOURCE33} ${RPM_BUILD_ROOT}%{confdir}/conf.d/
%{__install} -m 0644 %{SOURCE12} ${RPM_BUILD_ROOT}%{confdir}/conf.d/
# Substitute libnames in catalina-tasks.xml
sed -i \
@ -326,6 +329,7 @@ popd
pushd output/build
%{_bindir}/build-jar-repository lib ecj 2>&1
%{_bindir}/build-jar-repository lib tomcat-jakartaee-migration 2>&1
popd
pushd ${RPM_BUILD_ROOT}%{libdir}
@ -334,7 +338,9 @@ pushd ${RPM_BUILD_ROOT}%{libdir}
%{__ln_s} ../../java/%{name}-servlet-%{servletspec}-api.jar .
%{__ln_s} ../../java/%{name}-el-%{elspec}-api.jar .
%{__ln_s} $(build-classpath ecj/ecj) jasper-jdt.jar
%{__cp} -a ../../%{name}/bin/tomcat-juli.jar .
%{__ln_s} $(build-classpath tomcat-jakartaee-migration/jakartaee-migration) jakartaee-migration.jar
cp ../../%{name}/bin/tomcat-juli.jar .
popd
# symlink to the FHS locations where we've installed things
@ -401,6 +407,7 @@ popd
%mvn_file org.apache.tomcat:tomcat-websocket-api tomcat/websocket-api
%mvn_artifact res/maven/tomcat-websocket-api.pom ${RPM_BUILD_ROOT}%{libdir}/websocket-api.jar
%mvn_artifact res/maven/tomcat-websocket.pom ${RPM_BUILD_ROOT}%{libdir}/tomcat-websocket.jar
%mvn_artifact res/maven/tomcat-websocket-client-api.pom ${RPM_BUILD_ROOT}%{libdir}/websocket-client-api.jar
%mvn_artifact res/maven/tomcat.pom
%mvn_install
@ -420,43 +427,13 @@ exit 0
# install but don't activate
%systemd_post %{name}.service
%post jsp-%{jspspec}-api
%{_sbindir}/update-alternatives --install %{_javadir}/jsp.jar jsp \
%{_javadir}/%{name}-jsp-%{jspspec}-api.jar 20200
%post servlet-%{servletspec}-api
%{_sbindir}/update-alternatives --install %{_javadir}/servlet.jar servlet \
%{_javadir}/%{name}-servlet-%{servletspec}-api.jar 30000
%post el-%{elspec}-api
%{_sbindir}/update-alternatives --install %{_javadir}/elspec.jar elspec \
%{_javadir}/%{name}-el-%{elspec}-api.jar 20300
%preun
# clean tempdir and workdir on removal or upgrade
%{__rm} -rf %{workdir}/* %{tempdir}/*
%systemd_preun %{name}.service
%postun
%systemd_postun_with_restart %{name}.service
%postun jsp-%{jspspec}-api
if [ "$1" = "0" ]; then
%{_sbindir}/update-alternatives --remove jsp \
%{_javadir}/%{name}-jsp-%{jspspec}-api.jar
fi
%postun servlet-%{servletspec}-api
if [ "$1" = "0" ]; then
%{_sbindir}/update-alternatives --remove servlet \
%{_javadir}/%{name}-servlet-%{servletspec}-api.jar
fi
%postun el-%{elspec}-api
if [ "$1" = "0" ]; then
%{_sbindir}/update-alternatives --remove elspec \
%{_javadir}/%{name}-el-%{elspec}-api.jar
fi
%systemd_postun_with_restart %{name}.service
%files
%defattr(0664,root,tomcat,0755)
@ -490,7 +467,7 @@ fi
%attr(0775,root,tomcat) %dir %{confdir}/Catalina/localhost
%attr(0755,root,tomcat) %dir %{confdir}/conf.d
%{confdir}/conf.d/README
%{confdir}/conf.d/java-9-start-up-parameters.conf
%{confdir}/conf.d/module-start-up-parameters.conf
%config(noreplace) %{confdir}/%{name}.conf
%config(noreplace) %{confdir}/*.policy
%config(noreplace) %{confdir}/*.properties
@ -556,58 +533,31 @@ fi
%defattr(0644,tomcat,tomcat,0755)
%{appdir}/ROOT
%changelog
* Thu Jan 18 2024 Hui Wang <huwang@redhat.com> - 1:9.0.62-29
- Resolves: RHEL-17602
* Tue Feb 11 2025 Adam Krajcik <akrajcik@redhat.com> - 1:10.1.8-2
- Resolves: RHEL-78899 Add missing Obsoletes
* Thu Nov 23 2023 Hui Wang <huwang@redhat.com> - 1:9.0.62-28
- Resolves: RHEL-13907
- Resolves: RHEL-13904
- Resolves: RHEL-12951
- Resolves: RHEL-12544
- Resolves: RHEL-2386
* Wed Feb 05 2025 Adam Krajcik <akrajcik@redhat.com> - 1:10.1.8-1
- Resolves: RHEL-51222 Upgrade tomcat to 10.1.8
* Fri Oct 13 2023 Hui Wang <huwang@redhat.com> - 1:9.0.62-27
- Related: RHEL-12543
- Bump release number
* Tue Oct 29 2024 Troy Dawson <tdawson@redhat.com> - 1:9.0.87-3
- Bump release for October 2024 mass rebuild:
Resolves: RHEL-64018
* Thu Oct 12 2023 Hui Wang <huwang@redhat.com> - 1:9.0.62-16
- Resolves: RHEL-12543 HTTP/2: Multiple HTTP/2 enabled web servers are vulnerable to a DDoS attack (Rapid Reset Attack)
- Remove JDK subpackges which are unused
* Mon Aug 12 2024 Adam Krajcik <akrajcik@redhat.com> - 1:9.0.87-2
- Resolves: RHEL-50166 - Rebase tomcat to version 9.0.87
- Resolves: RHEL-12274 - Use src.zip file as a Source0 instead of tar.gz
- Resolves: RHEL-51277 - Prune changelog to remove non-relevant history
- Resolves: RHEL-52906 - tomcat: Switch to using Java 21 as the default JDK
- Resolves: RHEL-55194 - Fix changelog version
- Resolves: RHEL-46156
tomcat: Improper Handling of Exceptional Conditions (CVE-2024-34750)
* Fri Sep 08 2023 Hui Wang <huwang@redhat.com> - 1:9.0.62-14
- Related: RHEL-2330 Bump release number
* Mon Jun 24 2024 Troy Dawson <tdawson@redhat.com> - 1:9.0.83-3
- Bump release for June 2024 mass rebuild
* Thu Sep 07 2023 Hui Wang <huwang@redhat.com> - 1:9.0.62-13
- Resolves: RHEL-2330 Revert the fix for pki-servlet-engine
* Sat Jan 27 2024 Fedora Release Engineering <releng@fedoraproject.org> - 1:9.0.83-2
- Rebuilt for https://fedoraproject.org/wiki/Fedora_40_Mass_Rebuild
* Fri Aug 25 2023 Coty Sutherland <csutherl@redhat.com> - 1:9.0.62-12
- Related: #2184135 Declare file conflicts
* Fri Aug 25 2023 Coty Sutherland <csutherl@redhat.com> - 1:9.0.62-11
- Resolves: #2184135 Fix bug introduced in initial commit
* Fri Aug 18 2023 Hui Wang <huwang@redhat.com> - 1:9.0.62-10
- Resolves: #2210630 CVE-2023-28709 tomcat
- Resolves: #2181448 CVE-2023-28708 tomcat: not including the secure attribute causes information disclosure
* Thu Aug 17 2023 Hui Wang <huwang@redhat.com> - 1:9.0.62-9
- Resolves: #2184135 Add Obsoletes to tomcat package
* Thu Aug 17 2023 Hui Wang <huwang@redhat.com> - 1:9.0.62-8
- Resolves: #2189676 Missing Tomcat POM files in RHEL 8.9
* Tue Aug 15 2023 Hui Wang <huwang@redhat.com> - 1:9.0.62-7
- Related: #2173874 Tomcat installs older java even though newer java is installed
- Bump release number
* Fri Aug 11 2023 Hui Wang <huwang@redhat.com> - 1:9.0.62-6
- Resolves: #2173874 Tomcat installs older java even though newer java is installed
- Sync with rhel-8.8.0 branch
* Thu Feb 16 2023 Coty Sutherland <csutherl@redhat.com> - 1:9.0.62-5
- Related: #2160455 Add conflicts to subpackage
* Wed Feb 15 2023 Hui Wang <huwang@redhat.com> - 1:9.0.62-4
- Resolves: #2160455 Add Tomcat 9 to RHEL8
* Fri Dec 01 2023 Hui Wang <huwang@redhat.com> - 1:9.0.83-1
- Update to 9.0.83