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