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: Thu, 04 Feb 2021 10:50:30
Message-Id: 1612435823.377ab10b47d2e4b8842b36e2e2679009f35cbd6e.fordfrog@gentoo
1 commit: 377ab10b47d2e4b8842b36e2e2679009f35cbd6e
2 Author: Miroslav Šulc <fordfrog <AT> gentoo <DOT> org>
3 AuthorDate: Thu Feb 4 10:48:54 2021 +0000
4 Commit: Miroslav Šulc <fordfrog <AT> gentoo <DOT> org>
5 CommitDate: Thu Feb 4 10:50:23 2021 +0000
6 URL: https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=377ab10b
7
8 www-servers/tomcat: introduced slot 10 with version 10.0.2
9
10 Package-Manager: Portage-3.0.14, Repoman-3.0.2
11 Signed-off-by: Miroslav Šulc <fordfrog <AT> gentoo.org>
12
13 www-servers/tomcat/Manifest | 1 +
14 .../tomcat/files/tomcat-10.0.2-build.xml.patch | 284 +++++++++++++++++++++
15 www-servers/tomcat/tomcat-10.0.2.ebuild | 191 ++++++++++++++
16 3 files changed, 476 insertions(+)
17
18 diff --git a/www-servers/tomcat/Manifest b/www-servers/tomcat/Manifest
19 index 445c595920a..ce288762f41 100644
20 --- a/www-servers/tomcat/Manifest
21 +++ b/www-servers/tomcat/Manifest
22 @@ -1,3 +1,4 @@
23 +DIST apache-tomcat-10.0.2-src.tar.gz 5954905 BLAKE2B fa7ca630b287c96538955848ab0ef109beb22a381e884eae96fa5246c134164b543003669c65d716f453ffa7a0e72f119354d1f023b529a948befb11c5e375a1 SHA512 402e942b9a1006535fd0e1416a4606d880ca1af473d7c394d54aa3dff60ecfe80823a0bb14f354049e008fdf29ea67a1490d0828fbc50eaf39ea159ef36cbc53
24 DIST apache-tomcat-7.0.107-src.tar.gz 5312698 BLAKE2B 1f2712ddce6aa604692aaf6a6c706469d3dbcb2266a99e62346c15b8347fff573608440473be8e20b8632a431f8838dd29f24f6bf630a13d262c444be68e0d2c SHA512 820923697c487367786c595d3aeaa58981d25b56529c6739b9388ad771f3264e6995f7659805cc5b2ef9456dbd42bad92ad2cfa3c7f741920a5b7bff2cc1bb1b
25 DIST apache-tomcat-8.5.61-src.tar.gz 5840559 BLAKE2B 18e1505b6b7d8e1a024d9f834d33ef105a16e6fc1f9e80abd3e6e88b2326597b9973e13c2ebc030a1db4a2d4dc5572d195b9f61db6cb7bf51e97cbfaa121678a SHA512 fd6bb5926b5e7cf44f359c93dadc4edd87fa5f2e26fb0fb3a9bc0a5c89ae4d844d66872055e1b441392cf03d7690aca3429b66afd8334319784f089f821d8c22
26 DIST apache-tomcat-8.5.63-src.tar.gz 5853051 BLAKE2B d007d9922d54578bdebcbbaec3e7c0ffcafdce913e52fdd93d5c174c9d1304980b5eb7f126e957c5975a59dfb126857dcc87ef3ca5e479e44cd7910b6183e469 SHA512 d78a140117844675239e834a0890641c0ef0d6fc3c89eb4512536fece2c128f088edfdea15f79ba7a31e0478431f155230f8f60a57bfea0aed191298a95310c4
27
28 diff --git a/www-servers/tomcat/files/tomcat-10.0.2-build.xml.patch b/www-servers/tomcat/files/tomcat-10.0.2-build.xml.patch
29 new file mode 100644
30 index 00000000000..0ed24682291
31 --- /dev/null
32 +++ b/www-servers/tomcat/files/tomcat-10.0.2-build.xml.patch
33 @@ -0,0 +1,284 @@
34 +diff --git a/build.xml b/build.xml
35 +index 455edf9..457c0a9 100644
36 +--- a/build.xml
37 ++++ b/build.xml
38 +@@ -1032,6 +1032,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 +@@ -1039,21 +1040,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 +@@ -1166,10 +1169,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 +@@ -1397,9 +1400,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 +@@ -1459,7 +1462,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 + <!-- Add sources for examples -->
106 + <antcall target="examples-sources" />
107 +@@ -1502,7 +1505,7 @@
108 +
109 + </target>
110 +
111 +- <target name="build-tomcat-jdbc" depends="package">
112 ++ <target name="build-tomcat-jdbc" depends="package" unless="noget">
113 + <!-- build the jdbc-pool jar and source jar-->
114 + <echo message="Building Tomcat JDBC pool libraries"/>
115 + <ant antfile="${tomcat.jdbc.dir}/build.xml" dir="${tomcat.jdbc.dir}"
116 +@@ -1517,7 +1520,7 @@
117 + <copy file="${tomcat-jdbc.jar}" todir="${tomcat.build}/lib"/>
118 + </target>
119 +
120 +- <target name="build-tomcat-jdbc-src">
121 ++ <target name="build-tomcat-jdbc-src" unless="noget">
122 + <!-- build the jdbc-pool source jar-->
123 + <echo message="Building Tomcat JDBC pool src JAR"/>
124 + <ant antfile="${tomcat.jdbc.dir}/build.xml" dir="${tomcat.jdbc.dir}"
125 +@@ -1620,9 +1623,11 @@
126 +
127 + <copy file="${basedir}/LICENSE" todir="${tomcat.embed}" />
128 + <copy file="${basedir}/NOTICE" todir="${tomcat.embed}" />
129 ++<!--
130 + <copy file="${tomcat-dbcp.jar}" todir="${tomcat.embed}"
131 + failonerror="false"/>
132 + <copy file="${jdt.jar}" todir="${tomcat.embed}" />
133 ++-->
134 + <copy file="${annotations-api.jar}" todir="${tomcat.embed}" />
135 +
136 + <!-- Note the meta-inf below will work as long as there is only one JAR
137 +@@ -2196,11 +2201,12 @@
138 + </copy>
139 +
140 + <!-- Source bundles for native components -->
141 ++<!--
142 + <copy tofile="${tomcat.dist}/bin/tomcat-native.tar.gz"
143 + file="${tomcat-native.tar.gz}" />
144 + <copy tofile="${tomcat.dist}/bin/commons-daemon-native.tar.gz"
145 + file="${commons-daemon.native.src.tgz}" />
146 +-
147 ++-->
148 + <!-- platform README files -->
149 + <echo append="false" file="${tomcat.dist}/bin/x64/README">
150 + Apache Tomcat ${version} native binaries for Win64 AMD64/EMT64 platform.
151 +@@ -2231,6 +2237,7 @@ Apache Tomcat ${version} native binaries for Win64 AMD64/EMT64 platform.
152 + <path location="${ant.core.lib}"/>
153 + </classpath>
154 + </javadoc>
155 ++<!--
156 + <javadoc packagenames="jakarta.servlet.*"
157 + excludepackagenames="jakarta.servlet.jsp.*"
158 + sourcepath="${tomcat.dist}/src/java"
159 +@@ -2295,6 +2302,7 @@ Apache Tomcat ${version} native binaries for Win64 AMD64/EMT64 platform.
160 + <path location="${ant.core.lib}"/>
161 + </classpath>
162 + </javadoc>
163 ++-->
164 + <javadoc packagenames="jakarta.websocket.*"
165 + sourcepath="${tomcat.dist}/src/java"
166 + destdir="${tomcat.dist}/webapps/docs/websocketapi"
167 +@@ -2357,13 +2365,17 @@ Apache Tomcat ${version} native binaries for Win64 AMD64/EMT64 platform.
168 + <path location="${osgi-annotations.jar}"/>
169 + </classpath>
170 + <link href="../annotationapi"/>
171 ++<!--
172 + <link href="../servletapi"/>
173 + <link href="../jspapi"/>
174 + <link href="../elapi"/>
175 ++-->
176 + <link href="../websocketapi"/>
177 + <link href="../jaspicapi"/>
178 ++<!--
179 + <link href="https://docs.oracle.com/javase/8/docs/api/"/>
180 + <link href="https://javaee.github.io/javaee-spec/javadocs/"/>
181 ++-->
182 + <packageset dir="${tomcat.dist}/src/java/">
183 + <include name="org/**"/>
184 + <exclude name="org/apache/el/parser/**"/>
185 +@@ -3083,7 +3095,7 @@ skip.installer property in build.properties" />
186 +
187 + <target name="download-compile"
188 + description="Download components necessary to compile"
189 +- depends="setup-bnd">
190 ++ depends="setup-bnd" unless="noget">
191 +
192 + <!-- Download Commons Daemon -->
193 + <antcall target="downloadgz-2">
194 +@@ -3127,7 +3139,7 @@ skip.installer property in build.properties" />
195 + </target>
196 +
197 + <target name="download-test-compile"
198 +- description="Download additional components for the tests" >
199 ++ description="Download additional components for the tests" unless="noget">
200 +
201 + <antcall target="downloadfile">
202 + <param name="sourcefile" value="${junit.loc}"/>
203 +@@ -3205,7 +3217,7 @@ skip.installer property in build.properties" />
204 + </target>
205 +
206 + <target name="download-dist"
207 +- description="Download additional components for a distribution" >
208 ++ description="Download additional components for a distribution" unless="noget">
209 +
210 + <antcall target="downloadfile-2">
211 + <param name="sourcefile.1" value="${tomcat-native.loc.1}"/>
212 +@@ -3260,13 +3272,13 @@ skip.installer property in build.properties" />
213 +
214 + <!-- =============== Utility Targets to support downloads ================ -->
215 +
216 +- <target name="setproxy" if="${proxy.use}">
217 ++ <target name="setproxy" if="${proxy.use}" unless="noget">
218 + <setproxy proxyhost="${proxy.host}" proxyport="${proxy.port}"
219 + proxyuser="${proxy.user}" proxypassword="${proxy.password}" />
220 + <echo message="Using ${proxy.host}:${proxy.port} to download ${sourcefile}"/>
221 + </target>
222 +
223 +- <target name="testexist">
224 ++ <target name="testexist" unless="noget">
225 + <echo message="Testing for ${destfile}"/>
226 + <available file="${destfile}" property="exist"/>
227 + </target>
228 +@@ -3388,7 +3400,7 @@ skip.installer property in build.properties" />
229 + </sequential>
230 + </macrodef>
231 +
232 +- <target name="downloadgz" unless="exist" depends="testexist,setproxy">
233 ++ <target name="downloadgz" unless="noget" depends="testexist,setproxy">
234 + <!-- Download and extract the package -->
235 + <local name="temp.file"/>
236 + <mkdir dir="${base.path}"/>
237 +@@ -3405,7 +3417,7 @@ skip.installer property in build.properties" />
238 + <delete file="${temp.file}.tar.gz"/>
239 + </target>
240 +
241 +- <target name="downloadgz-2" unless="exist" depends="testexist">
242 ++ <target name="downloadgz-2" unless="noget" depends="testexist">
243 + <!-- Download and extract the package from the two alternative locations -->
244 + <local name="temp.file"/>
245 + <mkdir dir="${base.path}"/>
246 +@@ -3430,7 +3442,7 @@ skip.installer property in build.properties" />
247 + <delete file="${temp.file}.tar.gz"/>
248 + </target>
249 +
250 +- <target name="downloadzip" unless="exist" depends="testexist,setproxy">
251 ++ <target name="downloadzip" unless="noget" depends="testexist,setproxy">
252 + <!-- Download and extract the package -->
253 + <local name="temp.file"/>
254 + <mkdir dir="${base.path}"/>
255 +@@ -3446,7 +3458,7 @@ skip.installer property in build.properties" />
256 + <delete file="${temp.file}"/>
257 + </target>
258 +
259 +- <target name="downloadzip-2" unless="exist" depends="testexist">
260 ++ <target name="downloadzip-2" unless="noget" depends="testexist">
261 + <!-- Download and extract the package from the two alternative locations -->
262 + <local name="temp.file"/>
263 + <mkdir dir="${base.path}"/>
264 +@@ -3470,7 +3482,7 @@ skip.installer property in build.properties" />
265 + <delete file="${temp.file}"/>
266 + </target>
267 +
268 +- <target name="downloadfile" unless="exist" depends="testexist,setproxy">
269 ++ <target name="downloadfile" unless="noget" depends="testexist,setproxy">
270 + <!-- Download the file -->
271 + <local name="temp.file"/>
272 + <mkdir dir="${base.path}"/>
273 +@@ -3485,7 +3497,7 @@ skip.installer property in build.properties" />
274 + <move file="${temp.file}" tofile="${destfile}"/>
275 + </target>
276 +
277 +- <target name="downloadfile-2" unless="exist" depends="testexist">
278 ++ <target name="downloadfile-2" unless="noget" depends="testexist">
279 + <!-- Download the file from the two alternative locations -->
280 + <local name="temp.file"/>
281 + <mkdir dir="${base.path}"/>
282 +@@ -3513,7 +3525,7 @@ skip.installer property in build.properties" />
283 + <move file="${temp.file}" tofile="${destfile}"/>
284 + </target>
285 +
286 +- <target name="trydownload.check" depends="setproxy">
287 ++ <target name="trydownload.check" depends="setproxy" unless="noget">
288 + <condition property="trydownload.run">
289 + <and>
290 + <not>
291 +@@ -3524,7 +3536,7 @@ skip.installer property in build.properties" />
292 + </condition>
293 + </target>
294 +
295 +- <target name="trydownload" if="trydownload.run" depends="trydownload.check">
296 ++ <target name="trydownload" if="trydownload.run" depends="trydownload.check" unless="noget">
297 + <!-- Downloads a file if not yet downloaded and the source URL is available -->
298 + <get src="${sourcefile}" httpusecaches="${trydownload.httpusecaches}" dest="${destfile}" />
299 + </target>
300 +@@ -3535,7 +3547,7 @@ skip.installer property in build.properties" />
301 +
302 + <target name="ide-eclipse"
303 + depends="download-compile, download-test-compile"
304 +- description="Prepares the source tree to be built in Eclipse">
305 ++ description="Prepares the source tree to be built in Eclipse" unless="noget">
306 +
307 + <!-- Copy the sample project files into the root directory -->
308 + <copy file="${tomcat.home}/res/ide-support/eclipse/eclipse.project" tofile="${tomcat.home}/.project"/>
309 +@@ -3553,7 +3565,7 @@ Read the Building page on the Apache Tomcat documentation site for details on ho
310 +
311 + <target name="ide-intellij"
312 + depends="download-compile, download-test-compile"
313 +- description="Creates project directory .idea for IntelliJ IDEA">
314 ++ description="Creates project directory .idea for IntelliJ IDEA" unless="noget">
315 +
316 + <copy todir="${tomcat.home}/.idea">
317 + <fileset dir="${tomcat.home}/res/ide-support/idea"/>
318
319 diff --git a/www-servers/tomcat/tomcat-10.0.2.ebuild b/www-servers/tomcat/tomcat-10.0.2.ebuild
320 new file mode 100644
321 index 00000000000..7e618f92e88
322 --- /dev/null
323 +++ b/www-servers/tomcat/tomcat-10.0.2.ebuild
324 @@ -0,0 +1,191 @@
325 +# Copyright 1999-2021 Gentoo Authors
326 +# Distributed under the terms of the GNU General Public License v2
327 +
328 +EAPI=7
329 +
330 +JAVA_PKG_IUSE="doc source test"
331 +
332 +inherit eutils java-pkg-2 java-ant-2 prefix
333 +
334 +MY_P="apache-${PN}-${PV}-src"
335 +
336 +# Currently we bundle binary versions of bnd.jar and bndlib.jar
337 +# See bugs #203080 and #676116
338 +BND_VERSION="5.1.1"
339 +BND="biz.aQute.bnd-${BND_VERSION}.jar"
340 +BNDLIB="biz.aQute.bndlib-${BND_VERSION}.jar"
341 +
342 +DESCRIPTION="Tomcat Servlet-5.0/JSP-3.0/EL-4.0/WebSocket-2.0/JASIC-2.0 Container"
343 +HOMEPAGE="https://tomcat.apache.org/"
344 +SRC_URI="mirror://apache/${PN}/tomcat-9/v${PV}/src/${MY_P}.tar.gz
345 + https://repo.maven.apache.org/maven2/biz/aQute/bnd/biz.aQute.bnd/${BND_VERSION}/${BND}
346 + https://repo.maven.apache.org/maven2/biz/aQute/bnd/biz.aQute.bndlib/${BND_VERSION}/${BNDLIB}"
347 +
348 +LICENSE="Apache-2.0"
349 +SLOT="10"
350 +KEYWORDS="~amd64 ~x86 ~amd64-linux ~x86-linux ~x86-solaris"
351 +IUSE="extra-webapps"
352 +
353 +RESTRICT="test" # can we run them on a production system?
354 +
355 +ECJ_SLOT="4.15"
356 +SAPI_SLOT="5.0"
357 +
358 +COMMON_DEP="dev-java/eclipse-ecj:${ECJ_SLOT}
359 + dev-java/glassfish-xmlrpc-api:0
360 + ~dev-java/tomcat-servlet-api-${PV}:${SAPI_SLOT}
361 + dev-java/wsdl4j:0"
362 +RDEPEND="${COMMON_DEP}
363 + acct-group/tomcat
364 + acct-user/tomcat
365 + virtual/jre"
366 +DEPEND="${COMMON_DEP}
367 + app-admin/pwgen
368 + >=dev-java/ant-core-1.9.13
369 + virtual/jdk:1.8
370 + test? (
371 + >=dev-java/ant-junit-1.9:0
372 + dev-java/easymock:3.2
373 + )"
374 +
375 +S=${WORKDIR}/${MY_P}
376 +
377 +PATCHES=(
378 + "${FILESDIR}/${PN}-9.0.43-insufficient-ecj.patch"
379 +)
380 +
381 +BND_HOME="${S}/tomcat-build-libs/bnd"
382 +BNDLIB_HOME="${S}/tomcat-build-libs/bndlib"
383 +BND_JAR="${BND_HOME}/${BND}"
384 +BNDLIB_JAR="${BNDLIB_HOME}/${BND_LIB}"
385 +
386 +src_unpack() {
387 + unpack ${MY_P}.tar.gz
388 +
389 + mkdir -p "${BND_HOME}" "${BNDLIB_HOME}" || die "Failed to create dir"
390 + ln -s "${DISTDIR}/${BND}" "${BND_HOME}/" || die "Failed to symlink bnd-*.jar"
391 + ln -s "${DISTDIR}/${BND}" "${BNDLIB_HOME}/" || die "Failed to symlink bndlib-*.jar"
392 +}
393 +
394 +src_prepare() {
395 + default
396 +
397 + find -name '*.jar' -type f -delete -print || die
398 +
399 + # Remove bundled servlet-api
400 + rm -rv java/jakarta/{el,servlet} || die
401 +
402 + eapply "${FILESDIR}/${P}-build.xml.patch"
403 +
404 + # For use of catalina.sh in netbeans
405 + sed -i -e "/^# ----- Execute The Requested Command/ a\
406 + CLASSPATH=\`java-config --with-dependencies --classpath ${PN}-${SLOT}\`" \
407 + bin/catalina.sh || die
408 +
409 + java-pkg-2_src_prepare
410 +}
411 +
412 +JAVA_ANT_REWRITE_CLASSPATH="true"
413 +
414 +EANT_BUILD_TARGET="deploy"
415 +EANT_GENTOO_CLASSPATH="eclipse-ecj-${ECJ_SLOT},tomcat-servlet-api-${SAPI_SLOT},wsdl4j"
416 +EANT_TEST_GENTOO_CLASSPATH="easymock-3.2"
417 +EANT_GENTOO_CLASSPATH_EXTRA="${S}/output/classes"
418 +EANT_NEEDS_TOOLS="true"
419 +EANT_EXTRA_ARGS="-Dversion=${PV}-gentoo -Dversion.number=${PV} -Dcompile.debug=false -Dbnd.jar=${BND_JAR} -Dbndlib.jar=${BNDLIB_JAR}"
420 +
421 +# revisions of the scripts
422 +IM_REV="-r2"
423 +INIT_REV="-r1"
424 +
425 +src_configure() {
426 + java-ant-2_src_configure
427 +
428 + eapply "${FILESDIR}/${PN}-9.0.37-fix-build-rewrite.patch"
429 +}
430 +
431 +src_compile() {
432 + EANT_GENTOO_CLASSPATH_EXTRA+=":$(java-pkg_getjar --build-only ant-core ant.jar):$(java-pkg_getjars --build-only glassfish-xmlrpc-api)"
433 + java-pkg-2_src_compile
434 +}
435 +
436 +src_test() {
437 + java-pkg-2_src_test
438 +}
439 +
440 +src_install() {
441 + local dest="/usr/share/${PN}-${SLOT}"
442 +
443 + java-pkg_jarinto "${dest}"/bin
444 + java-pkg_dojar output/build/bin/*.jar
445 + exeinto "${dest}"/bin
446 + doexe output/build/bin/*.sh
447 +
448 + java-pkg_jarinto "${dest}"/lib
449 + java-pkg_dojar output/build/lib/*.jar
450 +
451 + dodoc RELEASE-NOTES RUNNING.txt
452 + use doc && java-pkg_dojavadoc output/dist/webapps/docs/api
453 + use source && java-pkg_dosrc java/*
454 +
455 + ### Webapps ###
456 +
457 + # add missing docBase
458 + local apps="host-manager manager"
459 + for app in ${apps}; do
460 + sed -i -e "s|=\"true\" >|=\"true\" docBase=\"\$\{catalina.home\}/webapps/${app}\" >|" \
461 + output/build/webapps/${app}/META-INF/context.xml || die
462 + done
463 +
464 + insinto "${dest}"/webapps
465 + doins -r output/build/webapps/{host-manager,manager,ROOT}
466 + use extra-webapps && doins -r output/build/webapps/{docs,examples}
467 +
468 + ### Config ###
469 +
470 + # create "logs" directory in $CATALINA_BASE
471 + # and set correct perms, see #458890
472 + dodir "${dest}"/logs
473 + fperms 0750 "${dest}"/logs
474 +
475 + # replace the default pw with a random one, see #92281
476 + local randpw="$(pwgen -s -B 15 1)"
477 + sed -i -e "s|SHUTDOWN|${randpw}|" output/build/conf/server.xml || die
478 +
479 + # prepend gentoo.classpath to common.loader, see #453212
480 + sed -i -e 's/^common\.loader=/\0${gentoo.classpath},/' output/build/conf/catalina.properties || die
481 +
482 + insinto "${dest}"
483 + doins -r output/build/conf
484 +
485 + ### rc ###
486 +
487 + cp "${FILESDIR}"/tomcat{.conf,${INIT_REV}.init,-instance-manager${IM_REV}.bash} "${T}" || die
488 + eprefixify "${T}"/tomcat{.conf,${INIT_REV}.init,-instance-manager${IM_REV}.bash}
489 + sed -i -e "s|@SLOT@|${SLOT}|g" "${T}"/tomcat{.conf,${INIT_REV}.init,-instance-manager${IM_REV}.bash} || die
490 +
491 + insinto "${dest}"/gentoo
492 + doins "${T}"/tomcat.conf
493 + exeinto "${dest}"/gentoo
494 + newexe "${T}"/tomcat${INIT_REV}.init tomcat.init
495 + newexe "${T}"/tomcat-instance-manager${IM_REV}.bash tomcat-instance-manager.bash
496 +}
497 +
498 +pkg_postinst() {
499 + elog "New ebuilds of Tomcat support running multiple instances. If you used prior version"
500 + elog "of Tomcat (<7.0.32), you have to migrate your existing instance to work with new Tomcat."
501 + elog "You can find more information at https://wiki.gentoo.org/wiki/Apache_Tomcat"
502 +
503 + elog "To manage Tomcat instances, run:"
504 + elog " ${EPREFIX}/usr/share/${PN}-${SLOT}/gentoo/tomcat-instance-manager.bash --help"
505 +
506 + ewarn "Please note that since version 10 the primary package for all implemented APIs"
507 + ewarn "has changed from javax.* to jakarta.*. This will almost certainly require code"
508 + ewarn "changes to enable applications to migrate from Tomcat 9 and earlier to Tomcat 10 and later."
509 +
510 + ewarn "tomcat-dbcp.jar is not built at this time. Please fetch jar"
511 + ewarn "from upstream binary if you need it. Gentoo Bug # 144276"
512 +
513 + einfo "Please read https://wiki.gentoo.org/wiki/Apache_Tomcat and"
514 + einfo "https://wiki.gentoo.org/wiki/Project:Java/Tomcat_6_Guide for more information."
515 +}