Gentoo Archives: gentoo-commits

From: "Miroslav Šulc" <fordfrog@g.o>
To: gentoo-commits@l.g.o
Subject: [gentoo-commits] repo/gentoo:master commit in: www-servers/tomcat/files/, www-servers/tomcat/
Date: Mon, 05 Jul 2021 14:15:24
Message-Id: 1625494518.2c38b7c30a8f0d67e0c8dd5e5d1226a8f3cba725.fordfrog@gentoo
1 commit: 2c38b7c30a8f0d67e0c8dd5e5d1226a8f3cba725
2 Author: Miroslav Šulc <fordfrog <AT> gentoo <DOT> org>
3 AuthorDate: Mon Jul 5 14:15:10 2021 +0000
4 Commit: Miroslav Šulc <fordfrog <AT> gentoo <DOT> org>
5 CommitDate: Mon Jul 5 14:15:18 2021 +0000
6 URL: https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=2c38b7c3
7
8 www-servers/tomcat: bump to 9.0.50
9
10 Package-Manager: Portage-3.0.20, Repoman-3.0.3
11 Signed-off-by: Miroslav Šulc <fordfrog <AT> gentoo.org>
12
13 www-servers/tomcat/Manifest | 1 +
14 .../files/tomcat-9.0.50-insufficient-ecj.patch | 40 +++++
15 www-servers/tomcat/tomcat-9.0.50.ebuild | 187 +++++++++++++++++++++
16 3 files changed, 228 insertions(+)
17
18 diff --git a/www-servers/tomcat/Manifest b/www-servers/tomcat/Manifest
19 index a16ae46662a..9d9b9d3ebd5 100644
20 --- a/www-servers/tomcat/Manifest
21 +++ b/www-servers/tomcat/Manifest
22 @@ -5,5 +5,6 @@ DIST apache-tomcat-8.5.66-src.tar.gz 5879748 BLAKE2B bfef20872bd19ffa2bb34b98a1d
23 DIST apache-tomcat-8.5.68-src.tar.gz 5907026 BLAKE2B 2312edb94f98ee98b594325fbc32521776e9cadc4422a3a46f3651f1fee072a99c5f6874378ac06215396504d34ad750edd6ec3399a3931554068195a8ee15ef SHA512 579a35f944ead756995d288b66ea8a4ab30289a90c32aa01119abcea85a8524f6594ce5cb7ac9df6d352c1e3b54a18c814b5d3a6409dce6a43614e3a89284066
24 DIST apache-tomcat-9.0.46-src.tar.gz 6068533 BLAKE2B 400814281aedd588c008a1363199f8602e856870d4c39d536b13f8a357c2390d2db689940f4a6971ec74a84e8e400174e72610e0d64a220de41f2dff419dda3c SHA512 dc380e23aa87273c6ba32e79659e768c551b07812635c2f1c62d2c34b493b1d3d51b4548fec5014fdb36f8461fc90942aa7917874ddf3d6f5c5345d8ca02dfc1
25 DIST apache-tomcat-9.0.48-src.tar.gz 6080015 BLAKE2B 9b2cac8143ca8186857d7d53e8737f2f7d2ec8e0ca03d32447ad25b429cbf37c1c7b39bc6e4b93679c08bd5f4940280d00946a70e9fa82f8c2a596ea18a2a4c6 SHA512 9b762f6d1a1f6c75e10f1bc05c39a647ae2165f3b81c09ff73cc286f3c487b034b9d14c73b808c73b35f55f642848831a0329d9d611c8bbb3928559e552a3ff3
26 +DIST apache-tomcat-9.0.50-src.tar.gz 6086608 BLAKE2B 59b5eb1616d377193f330fd8c5abb6e98926ab0a2f75b1ea14251d249837aad733f55a0b79f2a67de57f612dd1afdeae53836be97e81701d8dc27ecb0a381d4a SHA512 1032d2d5c342fb495b76426fdc301e0e5546815e709e604061d7aa2cdab19bcd376adc957fd25dee1d574306186eafd2e9d24140dd5e725b130128592cac47a2
27 DIST biz.aQute.bnd-5.1.1.jar 16088761 BLAKE2B 59906cc39ea27ef20cbf82de1ba78096f34dc417da6dc5c28e21f6e92c0625efecf14cec6c5faf0ab17551c31a6c87a24614c2ac75ac902cfea30199ecc0d39f SHA512 8092b083e7b86e75bf27233964763b88bee74d8ae141c85e387c1cc8bd0cbf3a54be27afea29931fb3ae950700a515fd4a28cfe8e7f26cbaaec506aa06357a37
28 DIST biz.aQute.bndlib-5.1.1.jar 3652944 BLAKE2B dad9f9835fb407a36e0eae4b65fa2fda147e06ab3f3211a2ed2f1631aeccd6d14d198c325793cb1ce9a57b719a836db230d0452715744ba5a4a6c2983c17916b SHA512 d7da056ba541ae0862159bf5e38e1a5351b2ab5388c88733b46601c2d7dab8970f16af00df186a6cb67fbe81ef53f2c8402db9d28a8c6819dadf60a1df40879b
29
30 diff --git a/www-servers/tomcat/files/tomcat-9.0.50-insufficient-ecj.patch b/www-servers/tomcat/files/tomcat-9.0.50-insufficient-ecj.patch
31 new file mode 100644
32 index 00000000000..13e82c9c651
33 --- /dev/null
34 +++ b/www-servers/tomcat/files/tomcat-9.0.50-insufficient-ecj.patch
35 @@ -0,0 +1,40 @@
36 +diff --git a/java/org/apache/jasper/compiler/JDTCompiler.java b/java/org/apache/jasper/compiler/JDTCompiler.java
37 +index 10d80e0..34ff7e0 100644
38 +--- a/java/org/apache/jasper/compiler/JDTCompiler.java
39 ++++ b/java/org/apache/jasper/compiler/JDTCompiler.java
40 +@@ -306,11 +306,11 @@ public class JDTCompiler extends org.apache.jasper.compiler.Compiler {
41 + } else if(opt.equals("13")) {
42 + settings.put(CompilerOptions.OPTION_Source, CompilerOptions.VERSION_13);
43 + } else if(opt.equals("14")) {
44 +- settings.put(CompilerOptions.OPTION_Source, CompilerOptions.VERSION_14);
45 ++ settings.put(CompilerOptions.OPTION_Source, "14");
46 + } else if(opt.equals("15")) {
47 +- settings.put(CompilerOptions.OPTION_Source, CompilerOptions.VERSION_15);
48 ++ settings.put(CompilerOptions.OPTION_Source, "15");
49 + } else if(opt.equals("16")) {
50 +- settings.put(CompilerOptions.OPTION_Source, CompilerOptions.VERSION_16);
51 ++ settings.put(CompilerOptions.OPTION_Source, "16");
52 + } else if(opt.equals("17")) {
53 + // Constant not available in latest ECJ version shipped with
54 + // Tomcat. May be supported in a snapshot build.
55 +@@ -366,14 +366,14 @@ public class JDTCompiler extends org.apache.jasper.compiler.Compiler {
56 + settings.put(CompilerOptions.OPTION_TargetPlatform, CompilerOptions.VERSION_13);
57 + settings.put(CompilerOptions.OPTION_Compliance, CompilerOptions.VERSION_13);
58 + } else if(opt.equals("14")) {
59 +- settings.put(CompilerOptions.OPTION_TargetPlatform, CompilerOptions.VERSION_14);
60 +- settings.put(CompilerOptions.OPTION_Compliance, CompilerOptions.VERSION_14);
61 ++ settings.put(CompilerOptions.OPTION_TargetPlatform, "14");
62 ++ settings.put(CompilerOptions.OPTION_Compliance, "14");
63 + } else if(opt.equals("15")) {
64 +- settings.put(CompilerOptions.OPTION_TargetPlatform, CompilerOptions.VERSION_15);
65 +- settings.put(CompilerOptions.OPTION_Compliance, CompilerOptions.VERSION_15);
66 ++ settings.put(CompilerOptions.OPTION_TargetPlatform, "15");
67 ++ settings.put(CompilerOptions.OPTION_Compliance, "15");
68 + } else if(opt.equals("16")) {
69 +- settings.put(CompilerOptions.OPTION_TargetPlatform, CompilerOptions.VERSION_16);
70 +- settings.put(CompilerOptions.OPTION_Compliance, CompilerOptions.VERSION_16);
71 ++ settings.put(CompilerOptions.OPTION_TargetPlatform, "16");
72 ++ settings.put(CompilerOptions.OPTION_Compliance, "16");
73 + } else if(opt.equals("17")) {
74 + // Constant not available in latest ECJ version shipped with
75 + // Tomcat. May be supported in a snapshot build.
76
77 diff --git a/www-servers/tomcat/tomcat-9.0.50.ebuild b/www-servers/tomcat/tomcat-9.0.50.ebuild
78 new file mode 100644
79 index 00000000000..8905e0fad24
80 --- /dev/null
81 +++ b/www-servers/tomcat/tomcat-9.0.50.ebuild
82 @@ -0,0 +1,187 @@
83 +# Copyright 1999-2021 Gentoo Authors
84 +# Distributed under the terms of the GNU General Public License v2
85 +
86 +EAPI=7
87 +
88 +JAVA_PKG_IUSE="doc source test"
89 +
90 +inherit java-pkg-2 java-ant-2 prefix
91 +
92 +MY_P="apache-${PN}-${PV}-src"
93 +
94 +# Currently we bundle binary versions of bnd.jar and bndlib.jar
95 +# See bugs #203080 and #676116
96 +BND_VERSION="5.1.1"
97 +BND="biz.aQute.bnd-${BND_VERSION}.jar"
98 +BNDLIB="biz.aQute.bndlib-${BND_VERSION}.jar"
99 +
100 +DESCRIPTION="Tomcat Servlet-4.0/JSP-2.3/EL-3.0/WebSocket-1.1/JASPIC-1.1 Container"
101 +HOMEPAGE="https://tomcat.apache.org/"
102 +SRC_URI="mirror://apache/${PN}/tomcat-9/v${PV}/src/${MY_P}.tar.gz
103 + https://repo.maven.apache.org/maven2/biz/aQute/bnd/biz.aQute.bnd/${BND_VERSION}/${BND}
104 + https://repo.maven.apache.org/maven2/biz/aQute/bnd/biz.aQute.bndlib/${BND_VERSION}/${BNDLIB}"
105 +
106 +LICENSE="Apache-2.0"
107 +SLOT="9"
108 +KEYWORDS="~amd64 ~x86 ~amd64-linux ~x86-linux ~x86-solaris"
109 +IUSE="extra-webapps"
110 +
111 +RESTRICT="test" # can we run them on a production system?
112 +
113 +ECJ_SLOT="4.15"
114 +SAPI_SLOT="4.0"
115 +
116 +COMMON_DEP="dev-java/eclipse-ecj:${ECJ_SLOT}
117 + dev-java/glassfish-xmlrpc-api:0
118 + ~dev-java/tomcat-servlet-api-${PV}:${SAPI_SLOT}
119 + dev-java/wsdl4j:0"
120 +RDEPEND="${COMMON_DEP}
121 + acct-group/tomcat
122 + acct-user/tomcat
123 + virtual/jre"
124 +DEPEND="${COMMON_DEP}
125 + app-admin/pwgen
126 + >=dev-java/ant-core-1.9.13
127 + virtual/jdk:1.8
128 + test? (
129 + >=dev-java/ant-junit-1.9:0
130 + dev-java/easymock:3.2
131 + )"
132 +
133 +S=${WORKDIR}/${MY_P}
134 +
135 +PATCHES=(
136 + "${FILESDIR}/${PN}-9.0.50-insufficient-ecj.patch"
137 +)
138 +
139 +BND_HOME="${S}/tomcat-build-libs/bnd"
140 +BNDLIB_HOME="${S}/tomcat-build-libs/bndlib"
141 +BND_JAR="${BND_HOME}/${BND}"
142 +BNDLIB_JAR="${BNDLIB_HOME}/${BND_LIB}"
143 +
144 +src_unpack() {
145 + unpack ${MY_P}.tar.gz
146 +
147 + mkdir -p "${BND_HOME}" "${BNDLIB_HOME}" || die "Failed to create dir"
148 + ln -s "${DISTDIR}/${BND}" "${BND_HOME}/" || die "Failed to symlink bnd-*.jar"
149 + ln -s "${DISTDIR}/${BND}" "${BNDLIB_HOME}/" || die "Failed to symlink bndlib-*.jar"
150 +}
151 +
152 +src_prepare() {
153 + default
154 +
155 + find -name '*.jar' -type f -delete -print || die
156 +
157 + # Remove bundled servlet-api
158 + rm -rv java/javax/{el,servlet} || die
159 +
160 + eapply "${FILESDIR}/${PN}-9.0.46-build.xml.patch"
161 +
162 + # For use of catalina.sh in netbeans
163 + sed -i -e "/^# ----- Execute The Requested Command/ a\
164 + CLASSPATH=\`java-config --with-dependencies --classpath ${PN}-${SLOT}\`" \
165 + bin/catalina.sh || die
166 +
167 + java-pkg-2_src_prepare
168 +}
169 +
170 +JAVA_ANT_REWRITE_CLASSPATH="true"
171 +
172 +EANT_BUILD_TARGET="deploy"
173 +EANT_GENTOO_CLASSPATH="eclipse-ecj-${ECJ_SLOT},tomcat-servlet-api-${SAPI_SLOT},wsdl4j"
174 +EANT_TEST_GENTOO_CLASSPATH="easymock-3.2"
175 +EANT_GENTOO_CLASSPATH_EXTRA="${S}/output/classes"
176 +EANT_NEEDS_TOOLS="true"
177 +EANT_EXTRA_ARGS="-Dversion=${PV}-gentoo -Dversion.number=${PV} -Dcompile.debug=false -Dbnd.jar=${BND_JAR} -Dbndlib.jar=${BNDLIB_JAR}"
178 +
179 +# revisions of the scripts
180 +IM_REV="-r2"
181 +INIT_REV="-r1"
182 +
183 +src_configure() {
184 + java-ant-2_src_configure
185 +
186 + eapply "${FILESDIR}/${PN}-9.0.37-fix-build-rewrite.patch"
187 +}
188 +
189 +src_compile() {
190 + EANT_GENTOO_CLASSPATH_EXTRA+=":$(java-pkg_getjar --build-only ant-core ant.jar):$(java-pkg_getjars --build-only glassfish-xmlrpc-api)"
191 + LC_ALL=C java-pkg-2_src_compile
192 +}
193 +
194 +src_test() {
195 + java-pkg-2_src_test
196 +}
197 +
198 +src_install() {
199 + local dest="/usr/share/${PN}-${SLOT}"
200 +
201 + java-pkg_jarinto "${dest}"/bin
202 + java-pkg_dojar output/build/bin/*.jar
203 + exeinto "${dest}"/bin
204 + doexe output/build/bin/*.sh
205 +
206 + java-pkg_jarinto "${dest}"/lib
207 + java-pkg_dojar output/build/lib/*.jar
208 +
209 + dodoc RELEASE-NOTES RUNNING.txt
210 + use doc && java-pkg_dojavadoc output/dist/webapps/docs/api
211 + use source && java-pkg_dosrc java/*
212 +
213 + ### Webapps ###
214 +
215 + # add missing docBase
216 + local apps="host-manager manager"
217 + for app in ${apps}; do
218 + sed -i -e "s|=\"true\" >|=\"true\" docBase=\"\$\{catalina.home\}/webapps/${app}\" >|" \
219 + output/build/webapps/${app}/META-INF/context.xml || die
220 + done
221 +
222 + insinto "${dest}"/webapps
223 + doins -r output/build/webapps/{host-manager,manager,ROOT}
224 + use extra-webapps && doins -r output/build/webapps/{docs,examples}
225 +
226 + ### Config ###
227 +
228 + # create "logs" directory in $CATALINA_BASE
229 + # and set correct perms, see #458890
230 + dodir "${dest}"/logs
231 + fperms 0750 "${dest}"/logs
232 +
233 + # replace the default pw with a random one, see #92281
234 + local randpw="$(pwgen -s -B 15 1)"
235 + sed -i -e "s|SHUTDOWN|${randpw}|" output/build/conf/server.xml || die
236 +
237 + # prepend gentoo.classpath to common.loader, see #453212
238 + sed -i -e 's/^common\.loader=/\0${gentoo.classpath},/' output/build/conf/catalina.properties || die
239 +
240 + insinto "${dest}"
241 + doins -r output/build/conf
242 +
243 + ### rc ###
244 +
245 + cp "${FILESDIR}"/tomcat{.conf,${INIT_REV}.init,-instance-manager${IM_REV}.bash} "${T}" || die
246 + eprefixify "${T}"/tomcat{.conf,${INIT_REV}.init,-instance-manager${IM_REV}.bash}
247 + sed -i -e "s|@SLOT@|${SLOT}|g" "${T}"/tomcat{.conf,${INIT_REV}.init,-instance-manager${IM_REV}.bash} || die
248 +
249 + insinto "${dest}"/gentoo
250 + doins "${T}"/tomcat.conf
251 + exeinto "${dest}"/gentoo
252 + newexe "${T}"/tomcat${INIT_REV}.init tomcat.init
253 + newexe "${T}"/tomcat-instance-manager${IM_REV}.bash tomcat-instance-manager.bash
254 +}
255 +
256 +pkg_postinst() {
257 + elog "New ebuilds of Tomcat support running multiple instances. If you used prior version"
258 + elog "of Tomcat (<7.0.32), you have to migrate your existing instance to work with new Tomcat."
259 + elog "You can find more information at https://wiki.gentoo.org/wiki/Apache_Tomcat"
260 +
261 + elog "To manage Tomcat instances, run:"
262 + elog " ${EPREFIX}/usr/share/${PN}-${SLOT}/gentoo/tomcat-instance-manager.bash --help"
263 +
264 + ewarn "tomcat-dbcp.jar is not built at this time. Please fetch jar"
265 + ewarn "from upstream binary if you need it. Gentoo Bug # 144276"
266 +
267 + einfo "Please read https://wiki.gentoo.org/wiki/Apache_Tomcat and"
268 + einfo "https://wiki.gentoo.org/wiki/Project:Java/Tomcat_6_Guide for more information."
269 +}