From 2ed1cb176ab1fb476af4dd672cc2da992701aa69 Mon Sep 17 00:00:00 2001 From: Adam Krajcik Date: Wed, 24 Jul 2024 16:57:21 +0200 Subject: [PATCH] Resolves: RHEL-50166 - Rebase tomcat to version 9.0.87 Resolves: RHEL-12274 - Use src.zip file as a Source0 instead of tar.gz --- .gitignore | 2 ++ JmxRemoteLifecycleListener.patch | 40 ++++++++++++++++++++++++++++++++ sources | 2 +- tomcat-9.0-JDTCompiler.patch | 24 ------------------- tomcat-9.0-bnd-annotation.patch | 6 ++--- tomcat-9.0-log4j.properties | 11 --------- tomcat-build.patch | 19 --------------- tomcat.spec | 38 ++++++++++++++---------------- 8 files changed, 64 insertions(+), 78 deletions(-) create mode 100644 JmxRemoteLifecycleListener.patch delete mode 100644 tomcat-9.0-JDTCompiler.patch delete mode 100644 tomcat-9.0-log4j.properties delete mode 100644 tomcat-build.patch diff --git a/.gitignore b/.gitignore index 471c3e4..7317a53 100644 --- a/.gitignore +++ b/.gitignore @@ -1,4 +1,6 @@ apache-tomcat-*-src.tar.gz +tomcat-*-src.zip results_tomcat tomcat*.src.rpm apache-tomcat-*-src/ +tomcat-*-src/ diff --git a/JmxRemoteLifecycleListener.patch b/JmxRemoteLifecycleListener.patch new file mode 100644 index 0000000..3145a54 --- /dev/null +++ b/JmxRemoteLifecycleListener.patch @@ -0,0 +1,40 @@ +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 }; + } diff --git a/sources b/sources index 4196751..ad39319 100644 --- a/sources +++ b/sources @@ -1 +1 @@ -SHA512 (apache-tomcat-9.0.83-src.tar.gz) = 28e112a9d01918434ad03c414058275bbc4e34be408c2cfe2d819c3a08cadc3c31920e279c5312529aa2f5abf1e002537012c5f06d43ba8894448afd5585c231 +SHA512 (tomcat-9.0.87.redhat-00003-src.zip) = 5064b32f5a572c7333524471a21b4781819eefbaff2449ddef9238bc09792b615b36812e499d7d7ded06b4150360396b49f1da872faad9df341451b13c45f26e diff --git a/tomcat-9.0-JDTCompiler.patch b/tomcat-9.0-JDTCompiler.patch deleted file mode 100644 index edf156a..0000000 --- a/tomcat-9.0-JDTCompiler.patch +++ /dev/null @@ -1,24 +0,0 @@ -diff -up ./java/org/apache/jasper/compiler/JDTCompiler.java ./java/org/apache/jasper/compiler/JDTCompiler.java -index 2e361f2..277d8f4 100644 ---- java/org/apache/jasper/compiler/JDTCompiler.java -+++ java/org/apache/jasper/compiler/JDTCompiler.java -@@ -310,7 +310,7 @@ public class JDTCompiler extends org.apache.jasper.compiler.Compiler { - } else if(opt.equals("15")) { - settings.put(CompilerOptions.OPTION_Source, CompilerOptions.VERSION_15); - } else if(opt.equals("16")) { -- settings.put(CompilerOptions.OPTION_Source, CompilerOptions.VERSION_16); -+ settings.put(CompilerOptions.OPTION_Source, "16"); - } else if(opt.equals("17")) { - // Constant not available in latest ECJ version that runs on - // Java 8. -@@ -377,8 +377,8 @@ public class JDTCompiler extends org.apache.jasper.compiler.Compiler { - settings.put(CompilerOptions.OPTION_TargetPlatform, CompilerOptions.VERSION_15); - settings.put(CompilerOptions.OPTION_Compliance, CompilerOptions.VERSION_15); - } else if(opt.equals("16")) { -- settings.put(CompilerOptions.OPTION_TargetPlatform, CompilerOptions.VERSION_16); -- settings.put(CompilerOptions.OPTION_Compliance, CompilerOptions.VERSION_16); -+ settings.put(CompilerOptions.OPTION_TargetPlatform, "16"); -+ settings.put(CompilerOptions.OPTION_Compliance, "16"); - } else if(opt.equals("17")) { - // Constant not available in latest ECJ version that runs on - // Java 8. diff --git a/tomcat-9.0-bnd-annotation.patch b/tomcat-9.0-bnd-annotation.patch index 9d57c81..9faaadd 100644 --- a/tomcat-9.0-bnd-annotation.patch +++ b/tomcat-9.0-bnd-annotation.patch @@ -1,6 +1,6 @@ ---- 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 @@ +--- build.xml.orig 2023-01-19 10:39:11.163687508 +0800 ++++ build.xml 2023-01-19 10:44:42.960604444 +0800 +@@ -213,6 +213,7 @@ diff --git a/tomcat-9.0-log4j.properties b/tomcat-9.0-log4j.properties deleted file mode 100644 index dfc2309..0000000 --- a/tomcat-9.0-log4j.properties +++ /dev/null @@ -1,11 +0,0 @@ -log4j.rootLogger=debug, R -log4j.appender.R=org.apache.log4j.RollingFileAppender -log4j.appender.R.File=${catalina.base}/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 diff --git a/tomcat-build.patch b/tomcat-build.patch deleted file mode 100644 index cdf73ef..0000000 --- a/tomcat-build.patch +++ /dev/null @@ -1,19 +0,0 @@ -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};-;.} diff --git a/tomcat.spec b/tomcat.spec index db4c9b5..3c7b9e2 100644 --- a/tomcat.spec +++ b/tomcat.spec @@ -31,8 +31,8 @@ %global jspspec 2.3 %global major_version 9 %global minor_version 0 -%global micro_version 83 -%global packdname apache-tomcat-%{version}-src +%global micro_version 87 +%global packdname %{name}-%{major_version}.%{minor_version}.%{micro_version}.redhat-00003-src %global servletspec 4.0 %global elspec 3.0 %global tcuid 53 @@ -56,12 +56,12 @@ Name: tomcat Epoch: 1 Version: %{major_version}.%{minor_version}.%{micro_version} -Release: 3%{?dist} +Release: 1%{?dist} Summary: Apache Servlet/JSP Engine, RI for Servlet %{servletspec}/JSP %{jspspec} API License: ASL 2.0 URL: http://tomcat.apache.org/ -Source0: http://www.apache.org/dist/tomcat/tomcat-%{major_version}/v%{version}/src/%{packdname}.tar.gz +Source0: %{packdname}.zip Source1: %{name}-%{major_version}.%{minor_version}.conf Source3: %{name}-%{major_version}.%{minor_version}.sysconfig Source4: %{name}-%{major_version}.%{minor_version}.wrapper @@ -77,13 +77,12 @@ Source33: java-9-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 Patch6: %{name}-%{major_version}.%{minor_version}-bnd-annotation.patch +Patch7: JmxRemoteLifecycleListener.patch BuildArch: noarch -ExclusiveArch: %{java_arches} noarch BuildRequires: ant BuildRequires: ecj >= 1:4.10 @@ -135,7 +134,6 @@ 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 Requires: %{name}-servlet-%{servletspec}-api = %{epoch}:%{version}-%{release} Requires: %{name}-el-%{elspec}-api = %{epoch}:%{version}-%{release} @@ -158,7 +156,6 @@ Summary: Apache Tomcat Java Servlet v%{servletspec} API Implementation Classes Provides: servlet = %{servletspec} Provides: servlet6 Provides: servlet3 -Obsoletes: %{name}-servlet-3.1-api %description servlet-%{servletspec}-api Apache Tomcat Servlet API Implementation Classes. @@ -166,7 +163,6 @@ 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 %description el-%{elspec}-api Apache Tomcat EL API Implementation Classes. @@ -179,17 +175,17 @@ Requires: %{name} = %{epoch}:%{version}-%{release} The ROOT web application for Apache Tomcat. %prep -%setup -q -n %{packdname} +%setup -q -n apache-%{packdname} # remove pre-built binaries and windows files 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 0 -p0 -%patch 1 -p0 -%patch 2 -p0 -%patch 3 -p0 -%patch 4 -p0 -%patch 6 -p0 +%patch -P0 -p0 +%patch -P1 -p0 +%patch -P3 -p0 +%patch -P4 -p0 +%patch -P6 -p0 +%patch -P7 -p1 # Remove webservices naming resources as it's generally unused %{__rm} -rf java/org/apache/naming/factory/webservices @@ -228,7 +224,7 @@ touch HACK deploy # remove some jars that we'll replace with symlinks later -%{__rm} output/build/bin/commons-daemon.jar output/build/lib/ecj.jar +%{__rm} output/build/lib/ecj.jar # Remove the example webapps per Apache Tomcat Security Considerations # see https://tomcat.apache.org/tomcat-9.0-doc/security-howto.html %{__rm} -rf output/build/webapps/examples @@ -326,8 +322,7 @@ 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 ../../%{name}/bin/tomcat-juli.jar . + %{__cp} -a ../../%{name}/bin/tomcat-juli.jar . popd # symlink to the FHS locations where we've installed things @@ -395,7 +390,6 @@ popd %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.pom - %mvn_install %pre @@ -550,6 +544,10 @@ fi %{appdir}/ROOT %changelog +* Mon Aug 12 2024 Adam Krajcik - 9.0.87-1 +- Resolves: RHEL-50166 - Rebase tomcat to version 9.0.87 +- Resolves: RHEL-12274 - Use src.zip file as a Source0 instead of tar.gz + * Mon Jun 24 2024 Troy Dawson - 1:9.0.83-3 - Bump release for June 2024 mass rebuild