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/, www-servers/tomcat/files/
Date: Wed, 28 Sep 2022 04:33:09
Message-Id: 1664339583.e0fd275f730f28d281fa0db8ee8fc878469e656d.fordfrog@gentoo
1 commit: e0fd275f730f28d281fa0db8ee8fc878469e656d
2 Author: Miroslav Šulc <fordfrog <AT> gentoo <DOT> org>
3 AuthorDate: Wed Sep 28 04:32:58 2022 +0000
4 Commit: Miroslav Šulc <fordfrog <AT> gentoo <DOT> org>
5 CommitDate: Wed Sep 28 04:33:03 2022 +0000
6 URL: https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=e0fd275f
7
8 www-servers/tomcat: bump to 10.0.26
9
10 Signed-off-by: Miroslav Šulc <fordfrog <AT> gentoo.org>
11
12 www-servers/tomcat/Manifest | 1 +
13 .../tomcat/files/tomcat-10.0.26-build.xml.patch | 347 +++++++++++++++++++++
14 www-servers/tomcat/tomcat-10.0.26.ebuild | 198 ++++++++++++
15 3 files changed, 546 insertions(+)
16
17 diff --git a/www-servers/tomcat/Manifest b/www-servers/tomcat/Manifest
18 index 7c69381c5902..68b87e6c8b76 100644
19 --- a/www-servers/tomcat/Manifest
20 +++ b/www-servers/tomcat/Manifest
21 @@ -1,4 +1,5 @@
22 DIST apache-tomcat-10.0.23-src.tar.gz 6136614 BLAKE2B 4eaf963187b9a754ed459d7f85e6f7d329927b949bb4a390a602cdc6651aa037aeec559c511ddb9880b6ec4d7cd97b96d82da341509370e412e1b21b799d8c2e SHA512 19ec026bae75318e9ffbe2e619ad2e12ec116382ea88a1064696275afb3fd13e6f08efe497dde79689bfc828f76e27d114ad3a9284b79c8d956a6a85bdac6360
23 +DIST apache-tomcat-10.0.26-src.tar.gz 6153701 BLAKE2B fb16f83cf71dc97f21739c3714d2d3d201aa6b6b4242c351fabfc04ee767e59b6e376c7c8984dcda12d6942835221c55d4451b2d0a1245a2dbb73636c93da47c SHA512 f66387a3ca67b6b3df8504c4ae089e8f30e389811a8d0b7d2241e115b8cf712a38f3d0fea938cef7fa9745f412aa70ad47840e40e2385fbd1435b636e93b45b4
24 DIST apache-tomcat-10.1.0-src.tar.gz 6060833 BLAKE2B 49f36131c1e809b298ac915e671b9f4df55b55c2ba34d21ee3fdeb8759ddaf53a6780b177e8049446079d91186c52669969f30762ddf776d9f8615e527d5a975 SHA512 08323eec0403473fa97f419d7911980c3dfe7b1607a64741bbe972a737dfa70ea04ea80ca9ab28bf72bdde9d24cf8f7161eeb8b194204c777d1628d00c78611c
25 DIST apache-tomcat-8.5.82-src.tar.gz 6011553 BLAKE2B ea34c0485877ace8c84144f0e75f370c0ac461b5b725d97a07e27014b7a14b1ab88fad4230d4fae60190d7bff3836f691615b57b9f085797477acc69560a57ce SHA512 3e0a0a808fb78493930ce8832731eba4ab3cc440387c3b5226ff6e4ac2faf5fd70eff1560d840d34f14a8acfd7e60fc8b7f638f3dbe0c0ed4569dc4271a9c3f2
26 DIST apache-tomcat-9.0.65-src.tar.gz 6195265 BLAKE2B 13ca956b58e9f1831700f67d1fa8883f6471ab6b700b2af169bf284552658a4e9ad4130451b36976af4dd366cc987e228e0b0f98e688cccf577c626dfc78aae7 SHA512 3ff344370cc36f5bed389ed198054783a4f5bc86476a751cda280618457a06bae38c1e764b0c110c2f68efe2d34243a4e24596e8b90e8fbd171bf584a22fd3bc
27
28 diff --git a/www-servers/tomcat/files/tomcat-10.0.26-build.xml.patch b/www-servers/tomcat/files/tomcat-10.0.26-build.xml.patch
29 new file mode 100644
30 index 000000000000..aff5333f0833
31 --- /dev/null
32 +++ b/www-servers/tomcat/files/tomcat-10.0.26-build.xml.patch
33 @@ -0,0 +1,347 @@
34 +diff --git a/build.xml b/build.xml
35 +index 774e25e..2684b10 100644
36 +--- a/build.xml
37 ++++ b/build.xml
38 +@@ -1041,6 +1041,7 @@
39 + addOSGi="true" />
40 +
41 + <!-- Servlet Implementation JAR File -->
42 ++<!--
43 + <jarIt jarfile="${servlet-api.jar}"
44 + filesDir="${tomcat.classes}"
45 + filesId="files.servlet-api"
46 +@@ -1048,21 +1049,23 @@
47 + notice="${tomcat.manifests}/servlet-api.jar.notice"
48 + license="${tomcat.manifests}/servlet-api.jar.license"
49 + addOSGi="true" />
50 +-
51 ++-->
52 + <!-- EL Implementation JAR File -->
53 ++<!--
54 + <jarIt jarfile="${el-api.jar}"
55 + filesDir="${tomcat.classes}"
56 + filesId="files.el-api"
57 + manifest="${tomcat.manifests}/el-api.jar.manifest"
58 + addOSGi="true" />
59 +-
60 ++-->
61 + <!-- JSP Implementation JAR File -->
62 ++<!--
63 + <jarIt jarfile="${jsp-api.jar}"
64 + filesDir="${tomcat.classes}"
65 + filesId="files.jsp-api"
66 + manifest="${tomcat.manifests}/jsp-api.jar.manifest"
67 + addOSGi="true" />
68 +-
69 ++-->
70 + <!-- WebSocket API JAR File -->
71 + <jarIt jarfile="${websocket-api.jar}"
72 + filesDir="${tomcat.classes}"
73 +@@ -1175,10 +1178,10 @@
74 + addOSGi="true" />
75 +
76 + <!-- Re-packaged Apache Commons DBCP 2-->
77 +- <jarIt jarfile="${tomcat-dbcp.jar}"
78 ++<!-- <jarIt jarfile="${tomcat-dbcp.jar}"
79 + filesDir="${tomcat.classes}"
80 + filesId="files.tomcat-dbcp"
81 +- addOSGi="true" />
82 ++ addOSGi="true" /> -->
83 +
84 + <!-- i18n JARs -->
85 + <jar jarfile="${tomcat.build}/lib/tomcat-i18n-cs.jar"
86 +@@ -1415,9 +1418,9 @@
87 +
88 + <target name="deploy" depends="package,build-docs,build-tomcat-jdbc,compile-webapp-examples"
89 + description="Default. Builds a working Tomcat instance">
90 +-
91 ++<!--
92 + <copy tofile="${tomcat.build}/bin/commons-daemon.jar" file="${commons-daemon.jar}" />
93 +-
94 ++-->
95 + <!-- Copy scripts -->
96 + <copy todir="${tomcat.build}/bin">
97 + <fileset dir="bin">
98 +@@ -1477,7 +1480,7 @@
99 + <exclude name="${jdt.jar.filename}"/>
100 + </fileset>
101 + </delete>
102 +- <copy file="${jdt.jar}" todir="${tomcat.build}/lib"/>
103 ++<!-- <copy file="${jdt.jar}" todir="${tomcat.build}/lib"/> -->
104 +
105 + <!-- Delete all other versions of Tomcat Migration Tool for Jakarta EE and copy the current one -->
106 + <local name="migration.jar.filename" />
107 +@@ -1488,7 +1491,7 @@
108 + <exclude name="${migration-lib.jar.filename}"/>
109 + </fileset>
110 + </delete>
111 +- <copy file="${migration-lib.jar}" todir="${tomcat.build}/lib"/>
112 ++<!-- <copy file="${migration-lib.jar}" todir="${tomcat.build}/lib"/> -->
113 +
114 + <!-- Add sources for examples -->
115 + <antcall target="examples-sources" />
116 +@@ -1517,7 +1520,7 @@
117 +
118 + </target>
119 +
120 +- <target name="build-tomcat-jdbc" depends="package">
121 ++ <target name="build-tomcat-jdbc" depends="package" unless="noget">
122 + <!-- build the jdbc-pool jar and source jar-->
123 + <echo message="Building Tomcat JDBC pool libraries"/>
124 + <ant antfile="${tomcat.jdbc.dir}/build.xml" dir="${tomcat.jdbc.dir}"
125 +@@ -1534,7 +1537,7 @@
126 + <copy file="${tomcat-jdbc.jar}" todir="${tomcat.build}/lib"/>
127 + </target>
128 +
129 +- <target name="build-tomcat-jdbc-src">
130 ++ <target name="build-tomcat-jdbc-src" unless="noget">
131 + <!-- build the jdbc-pool source jar-->
132 + <echo message="Building Tomcat JDBC pool src JAR"/>
133 + <ant antfile="${tomcat.jdbc.dir}/build.xml" dir="${tomcat.jdbc.dir}"
134 +@@ -1637,9 +1640,11 @@
135 +
136 + <copy file="${basedir}/LICENSE" todir="${tomcat.embed}" />
137 + <copy file="${basedir}/NOTICE" todir="${tomcat.embed}" />
138 ++<!--
139 + <copy file="${tomcat-dbcp.jar}" todir="${tomcat.embed}"
140 + failonerror="false"/>
141 + <copy file="${jdt.jar}" todir="${tomcat.embed}" />
142 ++-->
143 + <copy file="${annotations-api.jar}" todir="${tomcat.embed}" />
144 +
145 + <!-- Note the meta-inf below will work as long as there is only one JAR
146 +@@ -2144,11 +2149,12 @@
147 + </copy>
148 +
149 + <!-- Source bundles for native components -->
150 ++<!--
151 + <copy tofile="${tomcat.dist}/bin/tomcat-native.tar.gz"
152 + file="${tomcat-native.tar.gz}" />
153 + <copy tofile="${tomcat.dist}/bin/commons-daemon-native.tar.gz"
154 + file="${commons-daemon.native.src.tgz}" />
155 +-
156 ++-->
157 + <!-- platform README files -->
158 + <echo append="false" file="${tomcat.dist}/bin/x64/README">
159 + Apache Tomcat ${version} native binaries for Win64 AMD64/EMT64 platform.
160 +@@ -2172,13 +2178,13 @@ Apache Tomcat ${version} native binaries for Win64 AMD64/EMT64 platform.
161 + additionalparam="-breakiterator -notimestamp -html5"
162 + source="${compile.release}"
163 + maxmemory="512m"
164 +- failonerror="true"
165 +- failonwarning="true">
166 ++ failonerror="true">
167 + <classpath>
168 + <path refid="compile.classpath"/>
169 + <path location="${ant.core.lib}"/>
170 + </classpath>
171 + </javadoc>
172 ++<!--
173 + <javadoc packagenames="jakarta.servlet.*"
174 + excludepackagenames="jakarta.servlet.jsp.*"
175 + sourcepath="${tomcat.dist}/src/java"
176 +@@ -2194,8 +2200,7 @@ Apache Tomcat ${version} native binaries for Win64 AMD64/EMT64 platform.
177 + additionalparam="-breakiterator -notimestamp -html5"
178 + source="${compile.release}"
179 + maxmemory="512m"
180 +- failonerror="true"
181 +- failonwarning="true">
182 ++ failonerror="true">
183 + <classpath>
184 + <path refid="compile.classpath"/>
185 + <path location="${ant.core.lib}"/>
186 +@@ -2215,8 +2220,7 @@ Apache Tomcat ${version} native binaries for Win64 AMD64/EMT64 platform.
187 + additionalparam="-breakiterator -notimestamp -html5"
188 + source="${compile.release}"
189 + maxmemory="512m"
190 +- failonerror="true"
191 +- failonwarning="true">
192 ++ failonerror="true">
193 + <classpath>
194 + <path refid="compile.classpath"/>
195 + <path location="${ant.core.lib}"/>
196 +@@ -2236,13 +2240,13 @@ Apache Tomcat ${version} native binaries for Win64 AMD64/EMT64 platform.
197 + additionalparam="-breakiterator -notimestamp -html5"
198 + source="${compile.release}"
199 + maxmemory="512m"
200 +- failonerror="true"
201 +- failonwarning="true">
202 ++ failonerror="true">
203 + <classpath>
204 + <path refid="compile.classpath"/>
205 + <path location="${ant.core.lib}"/>
206 + </classpath>
207 + </javadoc>
208 ++-->
209 + <javadoc packagenames="jakarta.websocket.*"
210 + sourcepath="${tomcat.dist}/src/java"
211 + destdir="${tomcat.dist}/webapps/docs/websocketapi"
212 +@@ -2257,8 +2261,7 @@ Apache Tomcat ${version} native binaries for Win64 AMD64/EMT64 platform.
213 + additionalparam="-breakiterator -notimestamp -html5"
214 + source="${compile.release}"
215 + maxmemory="512m"
216 +- failonerror="true"
217 +- failonwarning="true">
218 ++ failonerror="true">
219 + <classpath>
220 + <path refid="compile.classpath"/>
221 + <path location="${ant.core.lib}"/>
222 +@@ -2277,8 +2280,7 @@ Apache Tomcat ${version} native binaries for Win64 AMD64/EMT64 platform.
223 + charset="UTF-8"
224 + additionalparam="-breakiterator -notimestamp -html5"
225 + maxmemory="512m"
226 +- failonerror="true"
227 +- failonwarning="true">
228 ++ failonerror="true">
229 + <classpath>
230 + <path refid="compile.classpath"/>
231 + <path location="${ant.core.lib}"/>
232 +@@ -2297,20 +2299,23 @@ Apache Tomcat ${version} native binaries for Win64 AMD64/EMT64 platform.
233 + additionalparam="-breakiterator -notimestamp -html5"
234 + source="${compile.release}"
235 + maxmemory="512m"
236 +- failonerror="true"
237 + failonwarning="true">
238 + <classpath>
239 + <path refid="compile.classpath"/>
240 + <path location="${ant.core.lib}"/>
241 + </classpath>
242 + <link href="../annotationapi"/>
243 ++<!--
244 + <link href="../servletapi"/>
245 + <link href="../jspapi"/>
246 + <link href="../elapi"/>
247 ++-->
248 + <link href="../websocketapi"/>
249 + <link href="../jaspicapi"/>
250 ++<!--
251 + <link href="https://docs.oracle.com/javase/8/docs/api/"/>
252 + <link href="https://jakarta.ee/specifications/platform/9/apidocs/"/>
253 ++-->
254 + <packageset dir="${tomcat.dist}/src/java/">
255 + <include name="org/**"/>
256 + <exclude name="org/apache/el/parser/**"/>
257 +@@ -3275,7 +3280,7 @@ asf.ldap.username=${release.asfusername}
258 + </target>
259 +
260 + <target name="download-test-compile"
261 +- description="Download additional components for the tests" >
262 ++ description="Download additional components for the tests">
263 +
264 + <antcall target="downloadfile">
265 + <param name="sourcefile" value="${junit.loc}"/>
266 +@@ -3403,7 +3408,7 @@ asf.ldap.username=${release.asfusername}
267 + </target>
268 +
269 + <target name="download-dist"
270 +- description="Download additional components for a distribution" >
271 ++ description="Download additional components for a distribution">
272 +
273 + <antcall target="downloadfile-2">
274 + <param name="sourcefile.1" value="${tomcat-native.loc.1}"/>
275 +@@ -3458,13 +3463,13 @@ asf.ldap.username=${release.asfusername}
276 +
277 + <!-- =============== Utility Targets to support downloads ================ -->
278 +
279 +- <target name="setproxy" if="${proxy.use}">
280 ++ <target name="setproxy" if="${proxy.use}" unless="noget">
281 + <setproxy proxyhost="${proxy.host}" proxyport="${proxy.port}"
282 + proxyuser="${proxy.user}" proxypassword="${proxy.password}" />
283 + <echo message="Using ${proxy.host}:${proxy.port} to download ${sourcefile}"/>
284 + </target>
285 +
286 +- <target name="testexist">
287 ++ <target name="testexist" unless="noget">
288 + <echo message="Testing for ${destfile}"/>
289 + <available file="${destfile}" property="exist"/>
290 + </target>
291 +@@ -3586,7 +3591,7 @@ asf.ldap.username=${release.asfusername}
292 + </sequential>
293 + </macrodef>
294 +
295 +- <target name="downloadgz" unless="exist" if="${execute.download}" depends="testexist,setproxy">
296 ++ <target name="downloadgz" unless="noget" if="${execute.download}" depends="testexist,setproxy">
297 + <!-- Download and extract the package -->
298 + <local name="temp.file"/>
299 + <mkdir dir="${base.path}"/>
300 +@@ -3603,7 +3608,7 @@ asf.ldap.username=${release.asfusername}
301 + <delete file="${temp.file}.tar.gz"/>
302 + </target>
303 +
304 +- <target name="downloadgz-2" unless="exist" if="${execute.download}" depends="testexist">
305 ++ <target name="downloadgz-2" unless="noget" if="${execute.download}" depends="testexist">
306 + <!-- Download and extract the package from the two alternative locations -->
307 + <local name="temp.file"/>
308 + <mkdir dir="${base.path}"/>
309 +@@ -3628,7 +3633,7 @@ asf.ldap.username=${release.asfusername}
310 + <delete file="${temp.file}.tar.gz"/>
311 + </target>
312 +
313 +- <target name="downloadzip" unless="exist" if="${execute.download}" depends="testexist,setproxy">
314 ++ <target name="downloadzip" unless="noget" if="${execute.download}" depends="testexist,setproxy">
315 + <!-- Download and extract the package -->
316 + <local name="temp.file"/>
317 + <mkdir dir="${base.path}"/>
318 +@@ -3644,7 +3649,7 @@ asf.ldap.username=${release.asfusername}
319 + <delete file="${temp.file}"/>
320 + </target>
321 +
322 +- <target name="downloadzip-2" unless="exist" if="${execute.download}" depends="testexist">
323 ++ <target name="downloadzip-2" unless="noget" if="${execute.download}" depends="testexist">
324 + <!-- Download and extract the package from the two alternative locations -->
325 + <local name="temp.file"/>
326 + <mkdir dir="${base.path}"/>
327 +@@ -3668,7 +3673,7 @@ asf.ldap.username=${release.asfusername}
328 + <delete file="${temp.file}"/>
329 + </target>
330 +
331 +- <target name="downloadfile" unless="exist" if="${execute.download}" depends="testexist,setproxy">
332 ++ <target name="downloadfile" unless="noget" if="${execute.download}" depends="testexist,setproxy">
333 + <!-- Download the file -->
334 + <local name="temp.file"/>
335 + <mkdir dir="${base.path}"/>
336 +@@ -3683,7 +3688,7 @@ asf.ldap.username=${release.asfusername}
337 + <move file="${temp.file}" tofile="${destfile}"/>
338 + </target>
339 +
340 +- <target name="downloadfile-2" unless="exist" if="${execute.download}" depends="testexist">
341 ++ <target name="downloadfile-2" unless="noget" if="${execute.download}" depends="testexist">
342 + <!-- Download the file from the two alternative locations -->
343 + <local name="temp.file"/>
344 + <mkdir dir="${base.path}"/>
345 +@@ -3711,7 +3716,7 @@ asf.ldap.username=${release.asfusername}
346 + <move file="${temp.file}" tofile="${destfile}"/>
347 + </target>
348 +
349 +- <target name="trydownload.check" depends="setproxy">
350 ++ <target name="trydownload.check" depends="setproxy" unless="noget">
351 + <condition property="trydownload.run">
352 + <and>
353 + <not>
354 +@@ -3722,7 +3727,7 @@ asf.ldap.username=${release.asfusername}
355 + </condition>
356 + </target>
357 +
358 +- <target name="trydownload" if="trydownload.run" depends="trydownload.check">
359 ++ <target name="trydownload" if="trydownload.run" depends="trydownload.check" unless="noget">
360 + <!-- Downloads a file if not yet downloaded and the source URL is available -->
361 + <get src="${sourcefile}" httpusecaches="${trydownload.httpusecaches}" dest="${destfile}" />
362 + </target>
363 +@@ -3733,7 +3738,7 @@ asf.ldap.username=${release.asfusername}
364 +
365 + <target name="ide-eclipse"
366 + depends="download-compile, download-test-compile"
367 +- description="Prepares the source tree to be built in Eclipse">
368 ++ description="Prepares the source tree to be built in Eclipse" unless="noget">
369 +
370 + <!-- Copy the sample project files into the root directory -->
371 + <copy file="${tomcat.home}/res/ide-support/eclipse/eclipse.project" tofile="${tomcat.home}/.project"/>
372 +@@ -3751,7 +3756,7 @@ Read the Building page on the Apache Tomcat documentation site for details on ho
373 +
374 + <target name="ide-intellij"
375 + depends="download-compile, download-test-compile"
376 +- description="Creates project directory .idea for IntelliJ IDEA">
377 ++ description="Creates project directory .idea for IntelliJ IDEA" unless="noget">
378 +
379 + <copy todir="${tomcat.home}/.idea">
380 + <fileset dir="${tomcat.home}/res/ide-support/idea"/>
381
382 diff --git a/www-servers/tomcat/tomcat-10.0.26.ebuild b/www-servers/tomcat/tomcat-10.0.26.ebuild
383 new file mode 100644
384 index 000000000000..efe394d3f70d
385 --- /dev/null
386 +++ b/www-servers/tomcat/tomcat-10.0.26.ebuild
387 @@ -0,0 +1,198 @@
388 +# Copyright 1999-2022 Gentoo Authors
389 +# Distributed under the terms of the GNU General Public License v2
390 +
391 +EAPI=8
392 +
393 +JAVA_PKG_IUSE="doc source test"
394 +
395 +inherit java-pkg-2 java-ant-2 prefix
396 +
397 +MY_P="apache-${PN}-${PV}-src"
398 +
399 +# Currently we bundle binary versions of bnd.jar and bndlib.jar
400 +# See bugs #203080 and #676116
401 +BND_VERSION="6.2.0"
402 +BND="biz.aQute.bnd-${BND_VERSION}.jar"
403 +BNDLIB="biz.aQute.bndlib-${BND_VERSION}.jar"
404 +
405 +DESCRIPTION="Tomcat Servlet-5.0/JSP-3.0/EL-4.0/WebSocket-2.0/JASIC-2.0 Container"
406 +HOMEPAGE="https://tomcat.apache.org/"
407 +SRC_URI="mirror://apache/${PN}/tomcat-10/v${PV}/src/${MY_P}.tar.gz
408 + https://repo.maven.apache.org/maven2/biz/aQute/bnd/biz.aQute.bnd/${BND_VERSION}/${BND}
409 + https://repo.maven.apache.org/maven2/biz/aQute/bnd/biz.aQute.bndlib/${BND_VERSION}/${BNDLIB}"
410 +
411 +LICENSE="Apache-2.0"
412 +SLOT="10"
413 +KEYWORDS="~amd64 ~amd64-linux"
414 +IUSE="extra-webapps"
415 +
416 +RESTRICT="test" # can we run them on a production system?
417 +
418 +# though it could work with 4.22 and upstream uses 4.20,
419 +# we still use 4.15 because 4.20+ is currently built with java 11
420 +# and it would force Tomcat to use at least java 11 too
421 +ECJ_SLOT="4.15"
422 +SAPI_SLOT="5.0"
423 +
424 +COMMON_DEP="dev-java/eclipse-ecj:${ECJ_SLOT}
425 + dev-java/glassfish-xmlrpc-api:0
426 + dev-java/jakartaee-migration:0
427 + ~dev-java/tomcat-servlet-api-${PV}:${SAPI_SLOT}
428 + dev-java/wsdl4j:0"
429 +RDEPEND="${COMMON_DEP}
430 + acct-group/tomcat
431 + acct-user/tomcat
432 + virtual/jre"
433 +DEPEND="${COMMON_DEP}
434 + app-admin/pwgen
435 + dev-java/ant-core
436 + >=virtual/jdk-1.8:*
437 + test? (
438 + dev-java/ant-junit:0
439 + dev-java/easymock:3.2
440 + )"
441 +
442 +S=${WORKDIR}/${MY_P}
443 +
444 +PATCHES=(
445 + "${FILESDIR}/${PN}-9.0.50-insufficient-ecj.patch"
446 +)
447 +
448 +BND_HOME="${S}/tomcat-build-libs/bnd"
449 +BNDLIB_HOME="${S}/tomcat-build-libs/bndlib"
450 +BND_JAR="${BND_HOME}/${BND}"
451 +BNDLIB_JAR="${BNDLIB_HOME}/${BND_LIB}"
452 +
453 +src_unpack() {
454 + unpack ${MY_P}.tar.gz
455 +
456 + mkdir -p "${BND_HOME}" "${BNDLIB_HOME}" || die "Failed to create dir"
457 + ln -s "${DISTDIR}/${BND}" "${BND_HOME}/" || die "Failed to symlink bnd-*.jar"
458 + ln -s "${DISTDIR}/${BND}" "${BNDLIB_HOME}/" || die "Failed to symlink bndlib-*.jar"
459 +}
460 +
461 +src_prepare() {
462 + default
463 +
464 + find -name '*.jar' -type f -delete -print || die
465 +
466 + # Remove bundled servlet-api
467 + rm -rv java/jakarta/{el,servlet} || die
468 +
469 + eapply "${FILESDIR}/${PN}-10.0.26-build.xml.patch"
470 +
471 + local vm_version="$(java-config -g PROVIDES_VERSION)"
472 + [[ "${vm_version}" == "1.8" ]] && eapply "${FILESDIR}/${PN}-10.0.16-build.xml-strip-html5.patch"
473 +
474 + # For use of catalina.sh in netbeans
475 + sed -i -e "/^# ----- Execute The Requested Command/ a\
476 + CLASSPATH=\`java-config --with-dependencies --classpath ${PN}-${SLOT}\`" \
477 + bin/catalina.sh || die
478 +
479 + java-pkg-2_src_prepare
480 +}
481 +
482 +JAVA_ANT_REWRITE_CLASSPATH="true"
483 +
484 +EANT_BUILD_TARGET="deploy"
485 +EANT_GENTOO_CLASSPATH="eclipse-ecj-${ECJ_SLOT},jakartaee-migration,tomcat-servlet-api-${SAPI_SLOT},wsdl4j"
486 +EANT_TEST_GENTOO_CLASSPATH="easymock-3.2"
487 +EANT_GENTOO_CLASSPATH_EXTRA="${S}/output/classes"
488 +EANT_NEEDS_TOOLS="true"
489 +EANT_EXTRA_ARGS="-Dversion=${PV}-gentoo -Dversion.number=${PV} -Dcompile.debug=false -Dbnd.jar=${BND_JAR} -Dbndlib.jar=${BNDLIB_JAR}"
490 +
491 +# revisions of the scripts
492 +IM_REV="-r2"
493 +INIT_REV="-r1"
494 +
495 +src_configure() {
496 + java-ant-2_src_configure
497 +
498 + eapply "${FILESDIR}/${PN}-9.0.37-fix-build-rewrite.patch"
499 +}
500 +
501 +src_compile() {
502 + EANT_GENTOO_CLASSPATH_EXTRA+=":$(java-pkg_getjar --build-only ant-core ant.jar):$(java-pkg_getjars --build-only glassfish-xmlrpc-api)"
503 + LC_ALL=C java-pkg-2_src_compile
504 +}
505 +
506 +src_test() {
507 + java-pkg-2_src_test
508 +}
509 +
510 +src_install() {
511 + local dest="/usr/share/${PN}-${SLOT}"
512 +
513 + java-pkg_jarinto "${dest}"/bin
514 + java-pkg_dojar output/build/bin/*.jar
515 + exeinto "${dest}"/bin
516 + doexe output/build/bin/*.sh
517 +
518 + java-pkg_jarinto "${dest}"/lib
519 + java-pkg_dojar output/build/lib/*.jar
520 +
521 + dodoc RELEASE-NOTES RUNNING.txt
522 + use doc && java-pkg_dojavadoc output/dist/webapps/docs/api
523 + use source && java-pkg_dosrc java/*
524 +
525 + ### Webapps ###
526 +
527 + # add missing docBase
528 + local apps="host-manager manager"
529 + for app in ${apps}; do
530 + sed -i -e "s|=\"true\" >|=\"true\" docBase=\"\$\{catalina.home\}/webapps/${app}\" >|" \
531 + output/build/webapps/${app}/META-INF/context.xml || die
532 + done
533 +
534 + insinto "${dest}"/webapps
535 + doins -r output/build/webapps/{host-manager,manager,ROOT}
536 + use extra-webapps && doins -r output/build/webapps/{docs,examples}
537 +
538 + ### Config ###
539 +
540 + # create "logs" directory in $CATALINA_BASE
541 + # and set correct perms, see #458890
542 + dodir "${dest}"/logs
543 + fperms 0750 "${dest}"/logs
544 +
545 + # replace the default pw with a random one, see #92281
546 + local randpw="$(pwgen -s -B 15 1)"
547 + sed -i -e "s|SHUTDOWN|${randpw}|" output/build/conf/server.xml || die
548 +
549 + # prepend gentoo.classpath to common.loader, see #453212
550 + sed -i -e 's/^common\.loader=/\0${gentoo.classpath},/' output/build/conf/catalina.properties || die
551 +
552 + insinto "${dest}"
553 + doins -r output/build/conf
554 +
555 + ### rc ###
556 +
557 + cp "${FILESDIR}"/tomcat{.conf,${INIT_REV}.init,-instance-manager${IM_REV}.bash} "${T}" || die
558 + eprefixify "${T}"/tomcat{.conf,${INIT_REV}.init,-instance-manager${IM_REV}.bash}
559 + sed -i -e "s|@SLOT@|${SLOT}|g" "${T}"/tomcat{.conf,${INIT_REV}.init,-instance-manager${IM_REV}.bash} || die
560 +
561 + insinto "${dest}"/gentoo
562 + doins "${T}"/tomcat.conf
563 + exeinto "${dest}"/gentoo
564 + newexe "${T}"/tomcat${INIT_REV}.init tomcat.init
565 + newexe "${T}"/tomcat-instance-manager${IM_REV}.bash tomcat-instance-manager.bash
566 +}
567 +
568 +pkg_postinst() {
569 + elog "New ebuilds of Tomcat support running multiple instances. If you used prior version"
570 + elog "of Tomcat (<7.0.32), you have to migrate your existing instance to work with new Tomcat."
571 + elog "You can find more information at https://wiki.gentoo.org/wiki/Apache_Tomcat"
572 +
573 + elog "To manage Tomcat instances, run:"
574 + elog " ${EPREFIX}/usr/share/${PN}-${SLOT}/gentoo/tomcat-instance-manager.bash --help"
575 +
576 + ewarn "Please note that since version 10 the primary package for all implemented APIs"
577 + ewarn "has changed from javax.* to jakarta.*. This will almost certainly require code"
578 + ewarn "changes to enable applications to migrate from Tomcat 9 and earlier to Tomcat 10 and later."
579 +
580 + ewarn "tomcat-dbcp.jar is not built at this time. Please fetch jar"
581 + ewarn "from upstream binary if you need it. Gentoo Bug # 144276"
582 +
583 + einfo "Please read https://wiki.gentoo.org/wiki/Apache_Tomcat and"
584 + einfo "https://wiki.gentoo.org/wiki/Project:Java/Tomcat_6_Guide for more information."
585 +}