commit: 87cac225ff947b18da33ab37796a78deeb3cb20d Author: Volkmar W. Pogatzki <gentoo <AT> pogatzki <DOT> net> AuthorDate: Wed Apr 9 11:18:20 2025 +0000 Commit: Miroslav Šulc <fordfrog <AT> gentoo <DOT> org> CommitDate: Thu Apr 10 16:26:23 2025 +0000 URL: https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=87cac225
www-servers/tomcat: add 11.0.6 Not keyworded because it needs a version of eclipse-ecj which can only be built with a higher Java version which is not yet keyworded. Signed-off-by: Volkmar W. Pogatzki <gentoo <AT> pogatzki.net> Closes: https://github.com/gentoo/gentoo/pull/41514 Signed-off-by: Miroslav Šulc <fordfrog <AT> gentoo.org> www-servers/tomcat/Manifest | 2 + .../tomcat-11.0.6-avoid_eclipse-ecj_4.35.patch | 43 +++++ www-servers/tomcat/tomcat-11.0.6.ebuild | 190 +++++++++++++++++++++ 3 files changed, 235 insertions(+) diff --git a/www-servers/tomcat/Manifest b/www-servers/tomcat/Manifest index fb89cb42d89e..4e5205455367 100644 --- a/www-servers/tomcat/Manifest +++ b/www-servers/tomcat/Manifest @@ -4,6 +4,8 @@ DIST apache-tomcat-10.1.40-src.tar.gz 6995521 BLAKE2B b196e637d488501cf6b309d452 DIST apache-tomcat-10.1.40-src.tar.gz.asc 833 BLAKE2B 5b28148654ea28d637529f40388c9f1f0a9f415f131a4ee25c6b0667da03ee5e071363490c5b966b70c01e4efc9184f2f834307726ee2b06320870d2bed98e81 SHA512 0b2f3aa14613dd507d11451b922cf570e065f13f7f070a62805ccaebb2fcd2c3ae3ac66caee5d6161d94ec0b4706e314643a1465c8e7988ba34a936eff96f29c DIST apache-tomcat-11.0.5-src.tar.gz 6918820 BLAKE2B 90789cf6cd68cbf813ce47a7860bec03f22f00fabf90df7742e9e37a8dea458445f54e9dea4ac26d9b5b2143c337973a89c71af16fe3d0d500115b7fb158c5e4 SHA512 58d864c0a560c840b303d20b34b1aeb9c03a534bb58badcf407144d1797d355f8f83e91963b8a8f656cae6abd6f9228206eeec3c5ff61a6318f5a9393ee2f91a DIST apache-tomcat-11.0.5-src.tar.gz.asc 849 BLAKE2B 2ebf1daddf32988d7e708eacf2d6d606d671f55fee6061d4d3381f029eb616a3e367ad982816ea63eefa8fd75b4b1f6360409ca3f9883519b72c1a7896270eb9 SHA512 c1f7d37e5e81a94fb5e5522831e772d29035b2e9684a90471ae45680d18ab536fd8acf72b06f648635df9e0cc32a69bdaab38442598684d388eb4acf9015cecb +DIST apache-tomcat-11.0.6-src.tar.gz 6923455 BLAKE2B 1381bfe42390235e9726c5704ff943707b3f8f776a25ca8093f013b39bdcf219eb43e0151eafda7d86b9d7f4f2f6d4d117bc9f9be46b77147287387109967771 SHA512 83ac60a058eb1fdff77b94708cd1c54efe7754b2dc4db6fe9ebae58791db74901a9646707d3e5f34856d134fa9a50e77866a3c1726dfec7622b064cee3265b9f +DIST apache-tomcat-11.0.6-src.tar.gz.asc 849 BLAKE2B 21ac13391c6fe25496ede76af999032dfaec14edb3d8babe99bf63f6fed047eedb240c4aa557370d787c62cf2169a7e4333a036231f81f2684b4407b30fbf55e SHA512 9a42f9a7264c8f757b710b1cf6ab0642b0446838b56644ef51799b0f2c7202d03e7fd57d89e6bc42fedbf8ab42838128151554d5109e5206ca36853e3b9eab9b DIST apache-tomcat-9.0.102-src.tar.gz 7133459 BLAKE2B 211ce90f9b3ea4fb4ec213ed4523c5934fd105afa6e6b9664297d26e3fa21cc2c61f8f5f9c88bcc9af3a2a2c27c13417053db30dc3d24572f61c54607aea1153 SHA512 2f06b1432a217470097704040cd7aed70e169981140f78c6fd6d46d55b2fd36fa174d85f34f288138f9373469d8c98cddeb3cd030c76dc69c724ab3e3b978095 DIST apache-tomcat-9.0.102-src.tar.gz.asc 833 BLAKE2B 79fd45f7d94b66c0140c20dbf2711005e512e2709dc105d78e774145a07ad681c2264bef56099329db5d371252dcad4d6b7fa2762534db691ff383ff5c7b84ca SHA512 deb59a0dd77dcac3ce9996360883341d9450f00a6fcaedffb1d162e37344cb28cb816d5342b3d5c401edbfa76aae8b474c5228210f1a414d5ac1a2c71a5d9020 DIST apache-tomcat-9.0.104-src.tar.gz 7141508 BLAKE2B 125a38e2e46e190e84368f7269968b5724cc84dea0b1ced5f6edf0fc2f494b6fb60d70b27fc046ce4007565b428ad922c3e14ed8b0f1960726b0cc67d01d95af SHA512 d2d66a1e0bf55cd6379154a023aaccec5e4007a95412e7207ecf729d315c6afdc3125a985cdf1289ad66162a180f24798161436e99d792e24deee71aaf521a4c diff --git a/www-servers/tomcat/files/tomcat-11.0.6-avoid_eclipse-ecj_4.35.patch b/www-servers/tomcat/files/tomcat-11.0.6-avoid_eclipse-ecj_4.35.patch new file mode 100644 index 000000000000..8515cab96a71 --- /dev/null +++ b/www-servers/tomcat/files/tomcat-11.0.6-avoid_eclipse-ecj_4.35.patch @@ -0,0 +1,43 @@ + +In order to allow building tomcat-11.0.6 with java 21 we have to use an older version of eclipse-ecj. +We cannot keyword eclipse-ecj:4.35 as long we don't have Java 23 or higher keyworded. +Otherwise compilation would run into this error: + + [javac] /var/tmp/portage/www-servers/tomcat-11.0.6/work/apache-tomcat-11.0.6-src/java/org/apache/jasper/compiler/JDTCompiler.java:327: error: cannot find symbol + [javac] settings.put(CompilerOptions.OPTION_Source, CompilerOptions.VERSION_23); + [javac] ^ + [javac] symbol: variable VERSION_23 + [javac] location: class CompilerOptions + [javac] /var/tmp/portage/www-servers/tomcat-11.0.6/work/apache-tomcat-11.0.6-src/java/org/apache/jasper/compiler/JDTCompiler.java:415: error: cannot find symbol + [javac] settings.put(CompilerOptions.OPTION_TargetPlatform, CompilerOptions.VERSION_23); + [javac] ^ + [javac] symbol: variable VERSION_23 + [javac] location: class CompilerOptions + [javac] /var/tmp/portage/www-servers/tomcat-11.0.6/work/apache-tomcat-11.0.6-src/java/org/apache/jasper/compiler/JDTCompiler.java:416: error: cannot find symbol + [javac] settings.put(CompilerOptions.OPTION_Compliance, CompilerOptions.VERSION_23); + [javac] ^ + [javac] symbol: variable VERSION_23 + [javac] location: class CompilerOptions + +--- a/java/org/apache/jasper/compiler/JDTCompiler.java ++++ b/java/org/apache/jasper/compiler/JDTCompiler.java +@@ -324,7 +324,7 @@ public class JDTCompiler extends org.apache.jasper.compiler.Compiler { + } else if (opt.equals("22")) { + settings.put(CompilerOptions.OPTION_Source, CompilerOptions.VERSION_22); + } else if (opt.equals("23")) { +- settings.put(CompilerOptions.OPTION_Source, CompilerOptions.VERSION_23); ++ settings.put(CompilerOptions.OPTION_Source, "23"); + } else if (opt.equals("24")) { + // Constant not available in latest ECJ version shipped with + // Tomcat. May be supported in a snapshot build. +@@ -412,8 +412,8 @@ public class JDTCompiler extends org.apache.jasper.compiler.Compiler { + settings.put(CompilerOptions.OPTION_TargetPlatform, CompilerOptions.VERSION_22); + settings.put(CompilerOptions.OPTION_Compliance, CompilerOptions.VERSION_22); + } else if (opt.equals("23")) { +- settings.put(CompilerOptions.OPTION_TargetPlatform, CompilerOptions.VERSION_23); +- settings.put(CompilerOptions.OPTION_Compliance, CompilerOptions.VERSION_23); ++ settings.put(CompilerOptions.OPTION_TargetPlatform, "23"); ++ settings.put(CompilerOptions.OPTION_Compliance, "23"); + } else if (opt.equals("24")) { + // Constant not available in latest ECJ version shipped with + // Tomcat. May be supported in a snapshot build. diff --git a/www-servers/tomcat/tomcat-11.0.6.ebuild b/www-servers/tomcat/tomcat-11.0.6.ebuild new file mode 100644 index 000000000000..e567904a0461 --- /dev/null +++ b/www-servers/tomcat/tomcat-11.0.6.ebuild @@ -0,0 +1,190 @@ +# Copyright 1999-2025 Gentoo Authors +# Distributed under the terms of the GNU General Public License v2 + +EAPI=8 + +JAVA_PKG_IUSE="doc source test" + +inherit java-pkg-2 prefix verify-sig + +MY_P="apache-${P}-src" + +DESCRIPTION="Tomcat Servlet-6.1/JSP-4.0/EL-6.0/WebSocket-2.2/JASPIC-3.1 Container" +HOMEPAGE="https://tomcat.apache.org/" +SRC_URI="mirror://apache/${PN}/tomcat-$(ver_cut 1)/v${PV}/src/${MY_P}.tar.gz + verify-sig? ( https://downloads.apache.org/tomcat/tomcat-$(ver_cut 1)/v${PV}/src/${MY_P}.tar.gz.asc )" +S=${WORKDIR}/${MY_P} + +LICENSE="Apache-2.0" +SLOT="11" + +KEYWORDS="~amd64 ~arm64 ~amd64-linux" +IUSE="extra-webapps" + +RESTRICT="test" # can we run them on a production system? + +# We use ECJ_SLOT="4.33" instead of "4.35" because "4.35" would need Java +# version 23 or higher to build which is not keyworded: +# To use "4.33" we also added "tomcat-11.0.6-avoid_eclipse-ecj_4.35.patch". +ECJ_SLOT="4.33" + +COMMON_DEP=" + dev-java/bnd-annotation:0 + dev-java/eclipse-ecj:${ECJ_SLOT} + dev-java/jax-rpc-api:0 + >=dev-java/jakartaee-migration-1.0.7-r2:0 + dev-java/wsdl4j:0" + +# jre-17:* because of line 1081, build.xml +# <filter token="target.jdk" value="${compile.release}"/> +RDEPEND=" + ${COMMON_DEP} + acct-group/tomcat + acct-user/tomcat + >=virtual/jre-17:*" +DEPEND=" + ${COMMON_DEP} + app-admin/pwgen + >=dev-java/ant-1.10.14-r3:0 + dev-java/bnd:0 + dev-java/bnd-ant:0 + dev-java/bnd-util:0 + dev-java/bndlib:0 + dev-java/libg:0 + dev-java/osgi-cmpn:8 + dev-java/osgi-core:0 + dev-java/slf4j-api:0 + >=virtual/jdk-17:* + test? ( + >=dev-java/ant-1.10.14-r3:0[junit] + dev-java/easymock:3.2 + )" + +BDEPEND="verify-sig? ( ~sec-keys/openpgp-keys-apache-tomcat-${PV}:${PV} )" +VERIFY_SIG_OPENPGP_KEY_PATH="/usr/share/openpgp-keys/tomcat-${PV}.apache.org.asc" + +PATCHES=( + "${FILESDIR}/tomcat-10.1.20-do-not-copy.patch" + "${FILESDIR}/tomcat-11.0.0-offline.patch" + "${FILESDIR}/tomcat-11.0.6-avoid_eclipse-ecj_4.35.patch" + "${FILESDIR}/tomcat-9.0.87-gentoo-bnd.patch" +) + +src_prepare() { + default #780585 + java-pkg-2_src_prepare + java-pkg_clean + + cat > build.properties <<-EOF || die + compile.debug=false + execute.download=false + exist=true # skip target="downloadfile-2" + version=${PV}-gentoo + version.number=${PV} + ant.jar=$(java-pkg_getjar --build-only ant ant.jar) + bnd-annotation.jar=$(java-pkg_getjars bnd-annotation) + bnd-ant.jar=$(java-pkg_getjars --build-only bnd-ant) + bnd-util.jar=$(java-pkg_getjars --build-only bnd-util) + bnd.jar=$(java-pkg_getjars --build-only bnd) + bndlib.jar=$(java-pkg_getjars --build-only bndlib) + jaxrpc-lib.jar=$(java-pkg_getjars jax-rpc-api) + jdt.jar=$(java-pkg_getjars eclipse-ecj-${ECJ_SLOT}) + libg.jar=$(java-pkg_getjars --build-only libg) + migration-lib.jar=$(java-pkg_getjars jakartaee-migration) + osgi-cmpn.jar=$(java-pkg_getjars --build-only osgi-cmpn-8) + osgi-core.jar=$(java-pkg_getjars --build-only osgi-core) + slf4j-api.jar=$(java-pkg_getjars --build-only slf4j-api) + wsdl4j-lib.jar=$(java-pkg_getjars wsdl4j) + EOF + if use test; then + echo "easymock.jar=$(java-pkg_getjars --build-only easymock-3.2)" \ + >> build.properties || die "easymock" + fi + + # For use of catalina.sh in netbeans + sed -i -e "/^# ----- Execute The Requested Command/ a\ + CLASSPATH=\`java-config --with-dependencies --classpath ${PN}-${SLOT}\`" \ + bin/catalina.sh || die +} + +# revisions of the scripts +IM_REV="-r2" +INIT_REV="-r1" + +src_compile() { + LC_ALL=C eant + use doc && LC_ALL=C eant javadoc +} + +src_test() { + eant test +} + +src_install() { + local dest="/usr/share/${PN}-${SLOT}" + + java-pkg_jarinto "${dest}"/bin + java-pkg_dojar output/build/bin/*.jar + exeinto "${dest}"/bin + doexe output/build/bin/*.sh + + java-pkg_jarinto "${dest}"/lib + java-pkg_dojar output/build/lib/*.jar + + dodoc RELEASE-NOTES RUNNING.txt + use doc && java-pkg_dojavadoc output/dist/webapps/docs/api + use source && java-pkg_dosrc java/* + + ### Webapps ### + + # add missing docBase + local apps="host-manager manager" + for app in ${apps}; do + sed -i -e "s|=\"true\" >|=\"true\" docBase=\"\$\{catalina.home\}/webapps/${app}\" >|" \ + output/build/webapps/${app}/META-INF/context.xml || die + done + + insinto "${dest}"/webapps + doins -r output/build/webapps/{host-manager,manager,ROOT} + use extra-webapps && doins -r output/build/webapps/{docs,examples} + + ### Config ### + + # create "logs" directory in $CATALINA_BASE + # and set correct perms, see #458890 + dodir "${dest}"/logs + fperms 0750 "${dest}"/logs + + # replace the default pw with a random one, see #92281 + local randpw="$(pwgen -s -B 15 1)" + sed -i -e "s|SHUTDOWN|${randpw}|" output/build/conf/server.xml || die + + # prepend gentoo.classpath to common.loader, see #453212 + sed -i -e 's/^common\.loader=/\0${gentoo.classpath},/' output/build/conf/catalina.properties || die + + insinto "${dest}" + doins -r output/build/conf + + ### rc ### + + cp "${FILESDIR}"/tomcat{.conf,${INIT_REV}.init,-instance-manager${IM_REV}.bash} "${T}" || die + eprefixify "${T}"/tomcat{.conf,${INIT_REV}.init,-instance-manager${IM_REV}.bash} + sed -i -e "s|@SLOT@|${SLOT}|g" "${T}"/tomcat{.conf,${INIT_REV}.init,-instance-manager${IM_REV}.bash} || die + + insinto "${dest}"/gentoo + doins "${T}"/tomcat.conf + exeinto "${dest}"/gentoo + newexe "${T}"/tomcat${INIT_REV}.init tomcat.init + newexe "${T}"/tomcat-instance-manager${IM_REV}.bash tomcat-instance-manager.bash +} + +pkg_postinst() { + einfo "Ebuilds of Tomcat support running multiple instances. To manage Tomcat instances, run:" + einfo " ${EPREFIX}/usr/share/${PN}-${SLOT}/gentoo/tomcat-instance-manager.bash --help" + + ewarn "Please note that since version 10 the primary package for all implemented APIs" + ewarn "has changed from javax.* to jakarta.*. This will almost certainly require code" + ewarn "changes to enable applications to migrate from Tomcat 9 and earlier to Tomcat 10 and later." + + einfo "Please read https://wiki.gentoo.org/wiki/Apache_Tomcat" +}
