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: Fri, 21 Jan 2022 10:02:29
Message-Id: 1642759341.6c1af53328a8c5d104409eb6fa0bb441148c0caa.fordfrog@gentoo
1 commit: 6c1af53328a8c5d104409eb6fa0bb441148c0caa
2 Author: Miroslav Šulc <fordfrog <AT> gentoo <DOT> org>
3 AuthorDate: Fri Jan 21 09:57:03 2022 +0000
4 Commit: Miroslav Šulc <fordfrog <AT> gentoo <DOT> org>
5 CommitDate: Fri Jan 21 10:02:21 2022 +0000
6 URL: https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=6c1af533
7
8 www-servers/tomcat: bump to 9.0.58
9
10 Closes: https://bugs.gentoo.org/831383
11 Package-Manager: Portage-3.0.30, Repoman-3.0.3
12 Signed-off-by: Miroslav Šulc <fordfrog <AT> gentoo.org>
13
14 www-servers/tomcat/Manifest | 1 +
15 .../tomcat/files/tomcat-9.0.58-build.xml.patch | 321 +++++++++++++++++++++
16 www-servers/tomcat/tomcat-9.0.58.ebuild | 187 ++++++++++++
17 3 files changed, 509 insertions(+)
18
19 diff --git a/www-servers/tomcat/Manifest b/www-servers/tomcat/Manifest
20 index 8e4b7c3e894f..edb93e7da4e3 100644
21 --- a/www-servers/tomcat/Manifest
22 +++ b/www-servers/tomcat/Manifest
23 @@ -3,5 +3,6 @@ DIST apache-tomcat-10.0.16-src.tar.gz 6088262 BLAKE2B f02a5b08e4502d4e7be2fa14f8
24 DIST apache-tomcat-7.0.109-src.tar.gz 5314401 BLAKE2B 56583caea6879bf8ca5cc02a886de3d7af413032f88d367653e709dc1c8f590e78620c788317bbff4b6e65dd3e242cc26863164ac8e7c87334a22636f3ed0703 SHA512 ecf9c0bee0e3e1aa24f299fe633705c5a2f6aa264d9e4968cfc96aa5d0a425c2b0ff07765a8b6c67221766733bdfaed6e6c6377a8d0870d889e7063ce90a46ce
25 DIST apache-tomcat-8.5.73-src.tar.gz 5973026 BLAKE2B d3d275b7462a3bd2ce9ce03869e09e42ec0da064eb764cf8168b8d003431d075952f15c083b5486e006629ec1f9dade154b0fceb20f2584168b36599c3c5485b SHA512 6190d78e2dd5d478131443807e464821a337c5c6c24ee91953fece377ad1c758339ce1588a7a5e90443ababac239b45e4aaa0422d68cba988d7c3da5fe95d1c6
26 DIST apache-tomcat-9.0.56-src.tar.gz 6138381 BLAKE2B 5e49287531fcb9bcb80ba124ed83fc3acbf3406b53424c3be5c2b3fb04da86785ba9e3ef89283c3ebb88bc8aadf8211328608edf068f0d7733c2f0ec0401d7ce SHA512 43332241fda149f9da107496cc6b812e38544c9043c567e3fe11ee01b5abfbd02b6a377c3f6090902048bd9dc67746cdc65d59f03bd0de68c05e0955bfe018c5
27 +DIST apache-tomcat-9.0.58-src.tar.gz 6142037 BLAKE2B 0515273882468958f5bc2ef95e3085c22975e0ec9f8153a20773266a43710645c2262da8cb10736f0f0b255716fa05a12252194e1f32851704364ef89a62e5e9 SHA512 b2b572dcad2efadf3e5e5a6ae6e108f5699af23b7751ca3c9c00e6ba896f5179745108fa602d8bd87a9611fd8bebe8817fad53c38fc75b0063835b953c67d74a
28 DIST biz.aQute.bnd-5.1.1.jar 16088761 BLAKE2B 59906cc39ea27ef20cbf82de1ba78096f34dc417da6dc5c28e21f6e92c0625efecf14cec6c5faf0ab17551c31a6c87a24614c2ac75ac902cfea30199ecc0d39f SHA512 8092b083e7b86e75bf27233964763b88bee74d8ae141c85e387c1cc8bd0cbf3a54be27afea29931fb3ae950700a515fd4a28cfe8e7f26cbaaec506aa06357a37
29 DIST biz.aQute.bndlib-5.1.1.jar 3652944 BLAKE2B dad9f9835fb407a36e0eae4b65fa2fda147e06ab3f3211a2ed2f1631aeccd6d14d198c325793cb1ce9a57b719a836db230d0452715744ba5a4a6c2983c17916b SHA512 d7da056ba541ae0862159bf5e38e1a5351b2ab5388c88733b46601c2d7dab8970f16af00df186a6cb67fbe81ef53f2c8402db9d28a8c6819dadf60a1df40879b
30
31 diff --git a/www-servers/tomcat/files/tomcat-9.0.58-build.xml.patch b/www-servers/tomcat/files/tomcat-9.0.58-build.xml.patch
32 new file mode 100644
33 index 000000000000..51f97e72e0b2
34 --- /dev/null
35 +++ b/www-servers/tomcat/files/tomcat-9.0.58-build.xml.patch
36 @@ -0,0 +1,321 @@
37 +diff --git a/build.xml b/build.xml
38 +index a51cbfb..43596ac 100644
39 +--- a/build.xml
40 ++++ b/build.xml
41 +@@ -1036,6 +1036,7 @@
42 + addOSGi="true" />
43 +
44 + <!-- Servlet Implementation JAR File -->
45 ++<!--
46 + <jarIt jarfile="${servlet-api.jar}"
47 + filesDir="${tomcat.classes}"
48 + filesId="files.servlet-api"
49 +@@ -1043,21 +1044,23 @@
50 + notice="${tomcat.manifests}/servlet-api.jar.notice"
51 + license="${tomcat.manifests}/servlet-api.jar.license"
52 + addOSGi="true" />
53 +-
54 ++-->
55 + <!-- EL Implementation JAR File -->
56 ++<!--
57 + <jarIt jarfile="${el-api.jar}"
58 + filesDir="${tomcat.classes}"
59 + filesId="files.el-api"
60 + manifest="${tomcat.manifests}/el-api.jar.manifest"
61 + addOSGi="true" />
62 +-
63 ++-->
64 + <!-- JSP Implementation JAR File -->
65 ++<!--
66 + <jarIt jarfile="${jsp-api.jar}"
67 + filesDir="${tomcat.classes}"
68 + filesId="files.jsp-api"
69 + manifest="${tomcat.manifests}/jsp-api.jar.manifest"
70 + addOSGi="true" />
71 +-
72 ++-->
73 + <!-- WebSocket API JAR File -->
74 + <jarIt jarfile="${websocket-api.jar}"
75 + filesDir="${tomcat.classes}"
76 +@@ -1170,10 +1173,10 @@
77 + addOSGi="true" />
78 +
79 + <!-- Re-packaged Apache Commons DBCP 2-->
80 +- <jarIt jarfile="${tomcat-dbcp.jar}"
81 ++<!-- <jarIt jarfile="${tomcat-dbcp.jar}"
82 + filesDir="${tomcat.classes}"
83 + filesId="files.tomcat-dbcp"
84 +- addOSGi="true" />
85 ++ addOSGi="true" /> -->
86 +
87 + <!-- i18n JARs -->
88 + <jar jarfile="${tomcat.build}/lib/tomcat-i18n-cs.jar"
89 +@@ -1410,9 +1413,9 @@
90 +
91 + <target name="deploy" depends="package,build-docs,build-tomcat-jdbc,compile-webapp-examples"
92 + description="Default. Builds a working Tomcat instance">
93 +-
94 ++<!--
95 + <copy tofile="${tomcat.build}/bin/commons-daemon.jar" file="${commons-daemon.jar}" />
96 +-
97 ++-->
98 + <!-- Copy scripts -->
99 + <copy todir="${tomcat.build}/bin">
100 + <fileset dir="bin">
101 +@@ -1472,7 +1475,7 @@
102 + <exclude name="${jdt.jar.filename}"/>
103 + </fileset>
104 + </delete>
105 +- <copy file="${jdt.jar}" todir="${tomcat.build}/lib"/>
106 ++<!-- <copy file="${jdt.jar}" todir="${tomcat.build}/lib"/> -->
107 +
108 + <!-- Add sources for examples -->
109 + <antcall target="examples-sources" />
110 +@@ -1515,7 +1518,7 @@
111 +
112 + </target>
113 +
114 +- <target name="build-tomcat-jdbc" depends="package">
115 ++ <target name="build-tomcat-jdbc" depends="package" unless="noget">
116 + <!-- build the jdbc-pool jar and source jar-->
117 + <echo message="Building Tomcat JDBC pool libraries"/>
118 + <ant antfile="${tomcat.jdbc.dir}/build.xml" dir="${tomcat.jdbc.dir}"
119 +@@ -1531,7 +1534,7 @@
120 + <copy file="${tomcat-jdbc.jar}" todir="${tomcat.build}/lib"/>
121 + </target>
122 +
123 +- <target name="build-tomcat-jdbc-src">
124 ++ <target name="build-tomcat-jdbc-src" unless="noget">
125 + <!-- build the jdbc-pool source jar-->
126 + <echo message="Building Tomcat JDBC pool src JAR"/>
127 + <ant antfile="${tomcat.jdbc.dir}/build.xml" dir="${tomcat.jdbc.dir}"
128 +@@ -1634,9 +1637,11 @@
129 +
130 + <copy file="${basedir}/LICENSE" todir="${tomcat.embed}" />
131 + <copy file="${basedir}/NOTICE" todir="${tomcat.embed}" />
132 ++<!--
133 + <copy file="${tomcat-dbcp.jar}" todir="${tomcat.embed}"
134 + failonerror="false"/>
135 + <copy file="${jdt.jar}" todir="${tomcat.embed}" />
136 ++-->
137 + <copy file="${annotations-api.jar}" todir="${tomcat.embed}" />
138 +
139 + <!-- Note the meta-inf below will work as long as there is only one JAR
140 +@@ -2139,11 +2144,12 @@
141 + </copy>
142 +
143 + <!-- Source bundles for native components -->
144 ++<!--
145 + <copy tofile="${tomcat.dist}/bin/tomcat-native.tar.gz"
146 + file="${tomcat-native.tar.gz}" />
147 + <copy tofile="${tomcat.dist}/bin/commons-daemon-native.tar.gz"
148 + file="${commons-daemon.native.src.tgz}" />
149 +-
150 ++-->
151 + <!-- platform README files -->
152 + <echo append="false" file="${tomcat.dist}/bin/x64/README">
153 + Apache Tomcat ${version} native binaries for Win64 AMD64/EMT64 platform.
154 +@@ -2167,13 +2173,13 @@ Apache Tomcat ${version} native binaries for Win64 AMD64/EMT64 platform.
155 + additionalparam="-breakiterator -notimestamp ${java9.javadoc.options}"
156 + source="${compile.source}"
157 + maxmemory="512m"
158 +- failonerror="true"
159 +- failonwarning="true">
160 ++ failonerror="true">
161 + <classpath>
162 + <path refid="compile.classpath"/>
163 + <path location="${ant.core.lib}"/>
164 + </classpath>
165 + </javadoc>
166 ++<!--
167 + <javadoc packagenames="javax.servlet.*"
168 + excludepackagenames="javax.servlet.jsp.*"
169 + sourcepath="${tomcat.dist}/src/java"
170 +@@ -2238,6 +2244,7 @@ Apache Tomcat ${version} native binaries for Win64 AMD64/EMT64 platform.
171 + <path location="${ant.core.lib}"/>
172 + </classpath>
173 + </javadoc>
174 ++-->
175 + <javadoc packagenames="javax.websocket.*"
176 + sourcepath="${tomcat.dist}/src/java"
177 + destdir="${tomcat.dist}/webapps/docs/websocketapi"
178 +@@ -2252,8 +2259,7 @@ Apache Tomcat ${version} native binaries for Win64 AMD64/EMT64 platform.
179 + additionalparam="-breakiterator -notimestamp ${java9.javadoc.options}"
180 + source="${compile.source}"
181 + maxmemory="512m"
182 +- failonerror="true"
183 +- failonwarning="true">
184 ++ failonerror="true">
185 + <classpath>
186 + <path refid="compile.classpath"/>
187 + <path location="${ant.core.lib}"/>
188 +@@ -2272,8 +2278,7 @@ Apache Tomcat ${version} native binaries for Win64 AMD64/EMT64 platform.
189 + charset="UTF-8"
190 + additionalparam="-breakiterator -notimestamp"
191 + maxmemory="512m"
192 +- failonerror="true"
193 +- failonwarning="true">
194 ++ failonerror="true">
195 + <classpath>
196 + <path refid="compile.classpath"/>
197 + <path location="${ant.core.lib}"/>
198 +@@ -2292,21 +2297,24 @@ Apache Tomcat ${version} native binaries for Win64 AMD64/EMT64 platform.
199 + additionalparam="-breakiterator -notimestamp ${java9.javadoc.options}"
200 + source="${compile.source}"
201 + maxmemory="512m"
202 +- failonerror="true"
203 +- failonwarning="true">
204 ++ failonerror="true">
205 + <classpath>
206 + <path refid="compile.classpath"/>
207 + <path location="${ant.core.lib}"/>
208 + <path location="${osgi-annotations.jar}"/>
209 + </classpath>
210 + <link href="../annotationapi"/>
211 ++<!--
212 + <link href="../servletapi"/>
213 + <link href="../jspapi"/>
214 + <link href="../elapi"/>
215 ++-->
216 + <link href="../websocketapi"/>
217 + <link href="../jaspicapi"/>
218 ++<!--
219 + <link href="https://docs.oracle.com/javase/8/docs/api/"/>
220 + <link href="https://javaee.github.io/javaee-spec/javadocs/"/>
221 ++-->
222 + <packageset dir="${tomcat.dist}/src/java/">
223 + <include name="org/**"/>
224 + <exclude name="org/apache/el/parser/**"/>
225 +@@ -3071,7 +3079,7 @@ skip.installer property in build.properties" />
226 +
227 + <target name="download-compile"
228 + description="Download components necessary to compile"
229 +- depends="setup-bnd">
230 ++ depends="setup-bnd" unless="noget">
231 +
232 + <!-- Download Commons Daemon -->
233 + <antcall target="downloadgz-2">
234 +@@ -3115,7 +3123,7 @@ skip.installer property in build.properties" />
235 + </target>
236 +
237 + <target name="download-test-compile"
238 +- description="Download additional components for the tests" >
239 ++ description="Download additional components for the tests" unless="noget">
240 +
241 + <antcall target="downloadfile">
242 + <param name="sourcefile" value="${junit.loc}"/>
243 +@@ -3234,7 +3242,7 @@ skip.installer property in build.properties" />
244 + </target>
245 +
246 + <target name="download-dist"
247 +- description="Download additional components for a distribution" >
248 ++ description="Download additional components for a distribution" unless="noget">
249 +
250 + <antcall target="downloadfile-2">
251 + <param name="sourcefile.1" value="${tomcat-native.loc.1}"/>
252 +@@ -3289,13 +3297,13 @@ skip.installer property in build.properties" />
253 +
254 + <!-- =============== Utility Targets to support downloads ================ -->
255 +
256 +- <target name="setproxy" if="${proxy.use}">
257 ++ <target name="setproxy" if="${proxy.use}" unless="noget">
258 + <setproxy proxyhost="${proxy.host}" proxyport="${proxy.port}"
259 + proxyuser="${proxy.user}" proxypassword="${proxy.password}" />
260 + <echo message="Using ${proxy.host}:${proxy.port} to download ${sourcefile}"/>
261 + </target>
262 +
263 +- <target name="testexist">
264 ++ <target name="testexist" unless="noget">
265 + <echo message="Testing for ${destfile}"/>
266 + <available file="${destfile}" property="exist"/>
267 + </target>
268 +@@ -3417,7 +3425,7 @@ skip.installer property in build.properties" />
269 + </sequential>
270 + </macrodef>
271 +
272 +- <target name="downloadgz" unless="exist" if="${execute.download}" depends="testexist,setproxy">
273 ++ <target name="downloadgz" unless="noget" if="${execute.download}" depends="testexist,setproxy">
274 + <!-- Download and extract the package -->
275 + <local name="temp.file"/>
276 + <mkdir dir="${base.path}"/>
277 +@@ -3434,7 +3442,7 @@ skip.installer property in build.properties" />
278 + <delete file="${temp.file}.tar.gz"/>
279 + </target>
280 +
281 +- <target name="downloadgz-2" unless="exist" if="${execute.download}" depends="testexist">
282 ++ <target name="downloadgz-2" unless="noget" if="${execute.download}" depends="testexist">
283 + <!-- Download and extract the package from the two alternative locations -->
284 + <local name="temp.file"/>
285 + <mkdir dir="${base.path}"/>
286 +@@ -3459,7 +3467,7 @@ skip.installer property in build.properties" />
287 + <delete file="${temp.file}.tar.gz"/>
288 + </target>
289 +
290 +- <target name="downloadzip" unless="exist" if="${execute.download}" depends="testexist,setproxy">
291 ++ <target name="downloadzip" unless="noget" if="${execute.download}" depends="testexist,setproxy">
292 + <!-- Download and extract the package -->
293 + <local name="temp.file"/>
294 + <mkdir dir="${base.path}"/>
295 +@@ -3475,7 +3483,7 @@ skip.installer property in build.properties" />
296 + <delete file="${temp.file}"/>
297 + </target>
298 +
299 +- <target name="downloadzip-2" unless="exist" if="${execute.download}" depends="testexist">
300 ++ <target name="downloadzip-2" unless="noget" if="${execute.download}" depends="testexist">
301 + <!-- Download and extract the package from the two alternative locations -->
302 + <local name="temp.file"/>
303 + <mkdir dir="${base.path}"/>
304 +@@ -3499,7 +3507,7 @@ skip.installer property in build.properties" />
305 + <delete file="${temp.file}"/>
306 + </target>
307 +
308 +- <target name="downloadfile" unless="exist" if="${execute.download}" depends="testexist,setproxy">
309 ++ <target name="downloadfile" unless="noget" if="${execute.download}" depends="testexist,setproxy">
310 + <!-- Download the file -->
311 + <local name="temp.file"/>
312 + <mkdir dir="${base.path}"/>
313 +@@ -3514,7 +3522,7 @@ skip.installer property in build.properties" />
314 + <move file="${temp.file}" tofile="${destfile}"/>
315 + </target>
316 +
317 +- <target name="downloadfile-2" unless="exist" if="${execute.download}" depends="testexist">
318 ++ <target name="downloadfile-2" unless="noget" if="${execute.download}" depends="testexist">
319 + <!-- Download the file from the two alternative locations -->
320 + <local name="temp.file"/>
321 + <mkdir dir="${base.path}"/>
322 +@@ -3542,7 +3550,7 @@ skip.installer property in build.properties" />
323 + <move file="${temp.file}" tofile="${destfile}"/>
324 + </target>
325 +
326 +- <target name="trydownload.check" depends="setproxy">
327 ++ <target name="trydownload.check" depends="setproxy" unless="noget">
328 + <condition property="trydownload.run">
329 + <and>
330 + <not>
331 +@@ -3553,7 +3561,7 @@ skip.installer property in build.properties" />
332 + </condition>
333 + </target>
334 +
335 +- <target name="trydownload" if="trydownload.run" depends="trydownload.check">
336 ++ <target name="trydownload" if="trydownload.run" depends="trydownload.check" unless="noget">
337 + <!-- Downloads a file if not yet downloaded and the source URL is available -->
338 + <get src="${sourcefile}" httpusecaches="${trydownload.httpusecaches}" dest="${destfile}" />
339 + </target>
340 +@@ -3564,7 +3572,7 @@ skip.installer property in build.properties" />
341 +
342 + <target name="ide-eclipse"
343 + depends="download-compile, download-test-compile"
344 +- description="Prepares the source tree to be built in Eclipse">
345 ++ description="Prepares the source tree to be built in Eclipse" unless="noget">
346 +
347 + <!-- Copy the sample project files into the root directory -->
348 + <copy file="${tomcat.home}/res/ide-support/eclipse/eclipse.project" tofile="${tomcat.home}/.project"/>
349 +@@ -3582,7 +3590,7 @@ Read the Building page on the Apache Tomcat documentation site for details on ho
350 +
351 + <target name="ide-intellij"
352 + depends="download-compile, download-test-compile"
353 +- description="Creates project directory .idea for IntelliJ IDEA">
354 ++ description="Creates project directory .idea for IntelliJ IDEA" unless="noget">
355 +
356 + <copy todir="${tomcat.home}/.idea">
357 + <fileset dir="${tomcat.home}/res/ide-support/idea"/>
358
359 diff --git a/www-servers/tomcat/tomcat-9.0.58.ebuild b/www-servers/tomcat/tomcat-9.0.58.ebuild
360 new file mode 100644
361 index 000000000000..f022f3e7ea9c
362 --- /dev/null
363 +++ b/www-servers/tomcat/tomcat-9.0.58.ebuild
364 @@ -0,0 +1,187 @@
365 +# Copyright 1999-2022 Gentoo Authors
366 +# Distributed under the terms of the GNU General Public License v2
367 +
368 +EAPI=8
369 +
370 +JAVA_PKG_IUSE="doc source test"
371 +
372 +inherit java-pkg-2 java-ant-2 prefix
373 +
374 +MY_P="apache-${PN}-${PV}-src"
375 +
376 +# Currently we bundle binary versions of bnd.jar and bndlib.jar
377 +# See bugs #203080 and #676116
378 +BND_VERSION="5.1.1"
379 +BND="biz.aQute.bnd-${BND_VERSION}.jar"
380 +BNDLIB="biz.aQute.bndlib-${BND_VERSION}.jar"
381 +
382 +DESCRIPTION="Tomcat Servlet-4.0/JSP-2.3/EL-3.0/WebSocket-1.1/JASPIC-1.1 Container"
383 +HOMEPAGE="https://tomcat.apache.org/"
384 +SRC_URI="mirror://apache/${PN}/tomcat-9/v${PV}/src/${MY_P}.tar.gz
385 + https://repo.maven.apache.org/maven2/biz/aQute/bnd/biz.aQute.bnd/${BND_VERSION}/${BND}
386 + https://repo.maven.apache.org/maven2/biz/aQute/bnd/biz.aQute.bndlib/${BND_VERSION}/${BNDLIB}"
387 +
388 +LICENSE="Apache-2.0"
389 +SLOT="9"
390 +KEYWORDS="~amd64 ~x86 ~amd64-linux ~x86-linux ~x86-solaris"
391 +IUSE="extra-webapps"
392 +
393 +RESTRICT="test" # can we run them on a production system?
394 +
395 +ECJ_SLOT="4.15"
396 +SAPI_SLOT="4.0"
397 +
398 +COMMON_DEP="dev-java/eclipse-ecj:${ECJ_SLOT}
399 + dev-java/glassfish-xmlrpc-api:0
400 + ~dev-java/tomcat-servlet-api-${PV}:${SAPI_SLOT}
401 + dev-java/wsdl4j:0"
402 +RDEPEND="${COMMON_DEP}
403 + acct-group/tomcat
404 + acct-user/tomcat
405 + virtual/jre"
406 +DEPEND="${COMMON_DEP}
407 + app-admin/pwgen
408 + >=dev-java/ant-core-1.9.13
409 + virtual/jdk:1.8
410 + test? (
411 + >=dev-java/ant-junit-1.9:0
412 + dev-java/easymock:3.2
413 + )"
414 +
415 +S=${WORKDIR}/${MY_P}
416 +
417 +PATCHES=(
418 + "${FILESDIR}/${PN}-9.0.50-insufficient-ecj.patch"
419 +)
420 +
421 +BND_HOME="${S}/tomcat-build-libs/bnd"
422 +BNDLIB_HOME="${S}/tomcat-build-libs/bndlib"
423 +BND_JAR="${BND_HOME}/${BND}"
424 +BNDLIB_JAR="${BNDLIB_HOME}/${BND_LIB}"
425 +
426 +src_unpack() {
427 + unpack ${MY_P}.tar.gz
428 +
429 + mkdir -p "${BND_HOME}" "${BNDLIB_HOME}" || die "Failed to create dir"
430 + ln -s "${DISTDIR}/${BND}" "${BND_HOME}/" || die "Failed to symlink bnd-*.jar"
431 + ln -s "${DISTDIR}/${BND}" "${BNDLIB_HOME}/" || die "Failed to symlink bndlib-*.jar"
432 +}
433 +
434 +src_prepare() {
435 + default
436 +
437 + find -name '*.jar' -type f -delete -print || die
438 +
439 + # Remove bundled servlet-api
440 + rm -rv java/javax/{el,servlet} || die
441 +
442 + eapply "${FILESDIR}/${PN}-9.0.58-build.xml.patch"
443 +
444 + # For use of catalina.sh in netbeans
445 + sed -i -e "/^# ----- Execute The Requested Command/ a\
446 + CLASSPATH=\`java-config --with-dependencies --classpath ${PN}-${SLOT}\`" \
447 + bin/catalina.sh || die
448 +
449 + java-pkg-2_src_prepare
450 +}
451 +
452 +JAVA_ANT_REWRITE_CLASSPATH="true"
453 +
454 +EANT_BUILD_TARGET="deploy"
455 +EANT_GENTOO_CLASSPATH="eclipse-ecj-${ECJ_SLOT},tomcat-servlet-api-${SAPI_SLOT},wsdl4j"
456 +EANT_TEST_GENTOO_CLASSPATH="easymock-3.2"
457 +EANT_GENTOO_CLASSPATH_EXTRA="${S}/output/classes"
458 +EANT_NEEDS_TOOLS="true"
459 +EANT_EXTRA_ARGS="-Dversion=${PV}-gentoo -Dversion.number=${PV} -Dcompile.debug=false -Dbnd.jar=${BND_JAR} -Dbndlib.jar=${BNDLIB_JAR}"
460 +
461 +# revisions of the scripts
462 +IM_REV="-r2"
463 +INIT_REV="-r1"
464 +
465 +src_configure() {
466 + java-ant-2_src_configure
467 +
468 + eapply "${FILESDIR}/${PN}-9.0.37-fix-build-rewrite.patch"
469 +}
470 +
471 +src_compile() {
472 + EANT_GENTOO_CLASSPATH_EXTRA+=":$(java-pkg_getjar --build-only ant-core ant.jar):$(java-pkg_getjars --build-only glassfish-xmlrpc-api)"
473 + LC_ALL=C java-pkg-2_src_compile
474 +}
475 +
476 +src_test() {
477 + java-pkg-2_src_test
478 +}
479 +
480 +src_install() {
481 + local dest="/usr/share/${PN}-${SLOT}"
482 +
483 + java-pkg_jarinto "${dest}"/bin
484 + java-pkg_dojar output/build/bin/*.jar
485 + exeinto "${dest}"/bin
486 + doexe output/build/bin/*.sh
487 +
488 + java-pkg_jarinto "${dest}"/lib
489 + java-pkg_dojar output/build/lib/*.jar
490 +
491 + dodoc RELEASE-NOTES RUNNING.txt
492 + use doc && java-pkg_dojavadoc output/dist/webapps/docs/api
493 + use source && java-pkg_dosrc java/*
494 +
495 + ### Webapps ###
496 +
497 + # add missing docBase
498 + local apps="host-manager manager"
499 + for app in ${apps}; do
500 + sed -i -e "s|=\"true\" >|=\"true\" docBase=\"\$\{catalina.home\}/webapps/${app}\" >|" \
501 + output/build/webapps/${app}/META-INF/context.xml || die
502 + done
503 +
504 + insinto "${dest}"/webapps
505 + doins -r output/build/webapps/{host-manager,manager,ROOT}
506 + use extra-webapps && doins -r output/build/webapps/{docs,examples}
507 +
508 + ### Config ###
509 +
510 + # create "logs" directory in $CATALINA_BASE
511 + # and set correct perms, see #458890
512 + dodir "${dest}"/logs
513 + fperms 0750 "${dest}"/logs
514 +
515 + # replace the default pw with a random one, see #92281
516 + local randpw="$(pwgen -s -B 15 1)"
517 + sed -i -e "s|SHUTDOWN|${randpw}|" output/build/conf/server.xml || die
518 +
519 + # prepend gentoo.classpath to common.loader, see #453212
520 + sed -i -e 's/^common\.loader=/\0${gentoo.classpath},/' output/build/conf/catalina.properties || die
521 +
522 + insinto "${dest}"
523 + doins -r output/build/conf
524 +
525 + ### rc ###
526 +
527 + cp "${FILESDIR}"/tomcat{.conf,${INIT_REV}.init,-instance-manager${IM_REV}.bash} "${T}" || die
528 + eprefixify "${T}"/tomcat{.conf,${INIT_REV}.init,-instance-manager${IM_REV}.bash}
529 + sed -i -e "s|@SLOT@|${SLOT}|g" "${T}"/tomcat{.conf,${INIT_REV}.init,-instance-manager${IM_REV}.bash} || die
530 +
531 + insinto "${dest}"/gentoo
532 + doins "${T}"/tomcat.conf
533 + exeinto "${dest}"/gentoo
534 + newexe "${T}"/tomcat${INIT_REV}.init tomcat.init
535 + newexe "${T}"/tomcat-instance-manager${IM_REV}.bash tomcat-instance-manager.bash
536 +}
537 +
538 +pkg_postinst() {
539 + elog "New ebuilds of Tomcat support running multiple instances. If you used prior version"
540 + elog "of Tomcat (<7.0.32), you have to migrate your existing instance to work with new Tomcat."
541 + elog "You can find more information at https://wiki.gentoo.org/wiki/Apache_Tomcat"
542 +
543 + elog "To manage Tomcat instances, run:"
544 + elog " ${EPREFIX}/usr/share/${PN}-${SLOT}/gentoo/tomcat-instance-manager.bash --help"
545 +
546 + ewarn "tomcat-dbcp.jar is not built at this time. Please fetch jar"
547 + ewarn "from upstream binary if you need it. Gentoo Bug # 144276"
548 +
549 + einfo "Please read https://wiki.gentoo.org/wiki/Apache_Tomcat and"
550 + einfo "https://wiki.gentoo.org/wiki/Project:Java/Tomcat_6_Guide for more information."
551 +}