www-servers/tomcat: bump to 9.0.50

Package-Manager: Portage-3.0.20, Repoman-3.0.3
Signed-off-by: Miroslav Šulc <fordfrog@gentoo.org>
This commit is contained in:
Miroslav Šulc
2021-07-05 16:15:10 +02:00
parent ea58134712
commit 2c38b7c30a
3 changed files with 228 additions and 0 deletions

View File

@@ -5,5 +5,6 @@ DIST apache-tomcat-8.5.66-src.tar.gz 5879748 BLAKE2B bfef20872bd19ffa2bb34b98a1d
DIST apache-tomcat-8.5.68-src.tar.gz 5907026 BLAKE2B 2312edb94f98ee98b594325fbc32521776e9cadc4422a3a46f3651f1fee072a99c5f6874378ac06215396504d34ad750edd6ec3399a3931554068195a8ee15ef SHA512 579a35f944ead756995d288b66ea8a4ab30289a90c32aa01119abcea85a8524f6594ce5cb7ac9df6d352c1e3b54a18c814b5d3a6409dce6a43614e3a89284066
DIST apache-tomcat-9.0.46-src.tar.gz 6068533 BLAKE2B 400814281aedd588c008a1363199f8602e856870d4c39d536b13f8a357c2390d2db689940f4a6971ec74a84e8e400174e72610e0d64a220de41f2dff419dda3c SHA512 dc380e23aa87273c6ba32e79659e768c551b07812635c2f1c62d2c34b493b1d3d51b4548fec5014fdb36f8461fc90942aa7917874ddf3d6f5c5345d8ca02dfc1
DIST apache-tomcat-9.0.48-src.tar.gz 6080015 BLAKE2B 9b2cac8143ca8186857d7d53e8737f2f7d2ec8e0ca03d32447ad25b429cbf37c1c7b39bc6e4b93679c08bd5f4940280d00946a70e9fa82f8c2a596ea18a2a4c6 SHA512 9b762f6d1a1f6c75e10f1bc05c39a647ae2165f3b81c09ff73cc286f3c487b034b9d14c73b808c73b35f55f642848831a0329d9d611c8bbb3928559e552a3ff3
DIST apache-tomcat-9.0.50-src.tar.gz 6086608 BLAKE2B 59b5eb1616d377193f330fd8c5abb6e98926ab0a2f75b1ea14251d249837aad733f55a0b79f2a67de57f612dd1afdeae53836be97e81701d8dc27ecb0a381d4a SHA512 1032d2d5c342fb495b76426fdc301e0e5546815e709e604061d7aa2cdab19bcd376adc957fd25dee1d574306186eafd2e9d24140dd5e725b130128592cac47a2
DIST biz.aQute.bnd-5.1.1.jar 16088761 BLAKE2B 59906cc39ea27ef20cbf82de1ba78096f34dc417da6dc5c28e21f6e92c0625efecf14cec6c5faf0ab17551c31a6c87a24614c2ac75ac902cfea30199ecc0d39f SHA512 8092b083e7b86e75bf27233964763b88bee74d8ae141c85e387c1cc8bd0cbf3a54be27afea29931fb3ae950700a515fd4a28cfe8e7f26cbaaec506aa06357a37
DIST biz.aQute.bndlib-5.1.1.jar 3652944 BLAKE2B dad9f9835fb407a36e0eae4b65fa2fda147e06ab3f3211a2ed2f1631aeccd6d14d198c325793cb1ce9a57b719a836db230d0452715744ba5a4a6c2983c17916b SHA512 d7da056ba541ae0862159bf5e38e1a5351b2ab5388c88733b46601c2d7dab8970f16af00df186a6cb67fbe81ef53f2c8402db9d28a8c6819dadf60a1df40879b

View File

@@ -0,0 +1,40 @@
diff --git a/java/org/apache/jasper/compiler/JDTCompiler.java b/java/org/apache/jasper/compiler/JDTCompiler.java
index 10d80e0..34ff7e0 100644
--- a/java/org/apache/jasper/compiler/JDTCompiler.java
+++ b/java/org/apache/jasper/compiler/JDTCompiler.java
@@ -306,11 +306,11 @@ public class JDTCompiler extends org.apache.jasper.compiler.Compiler {
} else if(opt.equals("13")) {
settings.put(CompilerOptions.OPTION_Source, CompilerOptions.VERSION_13);
} else if(opt.equals("14")) {
- settings.put(CompilerOptions.OPTION_Source, CompilerOptions.VERSION_14);
+ settings.put(CompilerOptions.OPTION_Source, "14");
} else if(opt.equals("15")) {
- settings.put(CompilerOptions.OPTION_Source, CompilerOptions.VERSION_15);
+ settings.put(CompilerOptions.OPTION_Source, "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 shipped with
// Tomcat. May be supported in a snapshot build.
@@ -366,14 +366,14 @@ public class JDTCompiler extends org.apache.jasper.compiler.Compiler {
settings.put(CompilerOptions.OPTION_TargetPlatform, CompilerOptions.VERSION_13);
settings.put(CompilerOptions.OPTION_Compliance, CompilerOptions.VERSION_13);
} else if(opt.equals("14")) {
- settings.put(CompilerOptions.OPTION_TargetPlatform, CompilerOptions.VERSION_14);
- settings.put(CompilerOptions.OPTION_Compliance, CompilerOptions.VERSION_14);
+ settings.put(CompilerOptions.OPTION_TargetPlatform, "14");
+ settings.put(CompilerOptions.OPTION_Compliance, "14");
} else if(opt.equals("15")) {
- settings.put(CompilerOptions.OPTION_TargetPlatform, CompilerOptions.VERSION_15);
- settings.put(CompilerOptions.OPTION_Compliance, CompilerOptions.VERSION_15);
+ settings.put(CompilerOptions.OPTION_TargetPlatform, "15");
+ settings.put(CompilerOptions.OPTION_Compliance, "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 shipped with
// Tomcat. May be supported in a snapshot build.

View File

@@ -0,0 +1,187 @@
# Copyright 1999-2021 Gentoo Authors
# Distributed under the terms of the GNU General Public License v2
EAPI=7
JAVA_PKG_IUSE="doc source test"
inherit java-pkg-2 java-ant-2 prefix
MY_P="apache-${PN}-${PV}-src"
# Currently we bundle binary versions of bnd.jar and bndlib.jar
# See bugs #203080 and #676116
BND_VERSION="5.1.1"
BND="biz.aQute.bnd-${BND_VERSION}.jar"
BNDLIB="biz.aQute.bndlib-${BND_VERSION}.jar"
DESCRIPTION="Tomcat Servlet-4.0/JSP-2.3/EL-3.0/WebSocket-1.1/JASPIC-1.1 Container"
HOMEPAGE="https://tomcat.apache.org/"
SRC_URI="mirror://apache/${PN}/tomcat-9/v${PV}/src/${MY_P}.tar.gz
https://repo.maven.apache.org/maven2/biz/aQute/bnd/biz.aQute.bnd/${BND_VERSION}/${BND}
https://repo.maven.apache.org/maven2/biz/aQute/bnd/biz.aQute.bndlib/${BND_VERSION}/${BNDLIB}"
LICENSE="Apache-2.0"
SLOT="9"
KEYWORDS="~amd64 ~x86 ~amd64-linux ~x86-linux ~x86-solaris"
IUSE="extra-webapps"
RESTRICT="test" # can we run them on a production system?
ECJ_SLOT="4.15"
SAPI_SLOT="4.0"
COMMON_DEP="dev-java/eclipse-ecj:${ECJ_SLOT}
dev-java/glassfish-xmlrpc-api:0
~dev-java/tomcat-servlet-api-${PV}:${SAPI_SLOT}
dev-java/wsdl4j:0"
RDEPEND="${COMMON_DEP}
acct-group/tomcat
acct-user/tomcat
virtual/jre"
DEPEND="${COMMON_DEP}
app-admin/pwgen
>=dev-java/ant-core-1.9.13
virtual/jdk:1.8
test? (
>=dev-java/ant-junit-1.9:0
dev-java/easymock:3.2
)"
S=${WORKDIR}/${MY_P}
PATCHES=(
"${FILESDIR}/${PN}-9.0.50-insufficient-ecj.patch"
)
BND_HOME="${S}/tomcat-build-libs/bnd"
BNDLIB_HOME="${S}/tomcat-build-libs/bndlib"
BND_JAR="${BND_HOME}/${BND}"
BNDLIB_JAR="${BNDLIB_HOME}/${BND_LIB}"
src_unpack() {
unpack ${MY_P}.tar.gz
mkdir -p "${BND_HOME}" "${BNDLIB_HOME}" || die "Failed to create dir"
ln -s "${DISTDIR}/${BND}" "${BND_HOME}/" || die "Failed to symlink bnd-*.jar"
ln -s "${DISTDIR}/${BND}" "${BNDLIB_HOME}/" || die "Failed to symlink bndlib-*.jar"
}
src_prepare() {
default
find -name '*.jar' -type f -delete -print || die
# Remove bundled servlet-api
rm -rv java/javax/{el,servlet} || die
eapply "${FILESDIR}/${PN}-9.0.46-build.xml.patch"
# 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
java-pkg-2_src_prepare
}
JAVA_ANT_REWRITE_CLASSPATH="true"
EANT_BUILD_TARGET="deploy"
EANT_GENTOO_CLASSPATH="eclipse-ecj-${ECJ_SLOT},tomcat-servlet-api-${SAPI_SLOT},wsdl4j"
EANT_TEST_GENTOO_CLASSPATH="easymock-3.2"
EANT_GENTOO_CLASSPATH_EXTRA="${S}/output/classes"
EANT_NEEDS_TOOLS="true"
EANT_EXTRA_ARGS="-Dversion=${PV}-gentoo -Dversion.number=${PV} -Dcompile.debug=false -Dbnd.jar=${BND_JAR} -Dbndlib.jar=${BNDLIB_JAR}"
# revisions of the scripts
IM_REV="-r2"
INIT_REV="-r1"
src_configure() {
java-ant-2_src_configure
eapply "${FILESDIR}/${PN}-9.0.37-fix-build-rewrite.patch"
}
src_compile() {
EANT_GENTOO_CLASSPATH_EXTRA+=":$(java-pkg_getjar --build-only ant-core ant.jar):$(java-pkg_getjars --build-only glassfish-xmlrpc-api)"
LC_ALL=C java-pkg-2_src_compile
}
src_test() {
java-pkg-2_src_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() {
elog "New ebuilds of Tomcat support running multiple instances. If you used prior version"
elog "of Tomcat (<7.0.32), you have to migrate your existing instance to work with new Tomcat."
elog "You can find more information at https://wiki.gentoo.org/wiki/Apache_Tomcat"
elog "To manage Tomcat instances, run:"
elog " ${EPREFIX}/usr/share/${PN}-${SLOT}/gentoo/tomcat-instance-manager.bash --help"
ewarn "tomcat-dbcp.jar is not built at this time. Please fetch jar"
ewarn "from upstream binary if you need it. Gentoo Bug # 144276"
einfo "Please read https://wiki.gentoo.org/wiki/Apache_Tomcat and"
einfo "https://wiki.gentoo.org/wiki/Project:Java/Tomcat_6_Guide for more information."
}