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, 01 Apr 2022 10:04:18
Message-Id: 1648807451.60374ea6269933139877c648824f938a8afa8925.fordfrog@gentoo
1 commit: 60374ea6269933139877c648824f938a8afa8925
2 Author: Miroslav Šulc <fordfrog <AT> gentoo <DOT> org>
3 AuthorDate: Fri Apr 1 10:04:08 2022 +0000
4 Commit: Miroslav Šulc <fordfrog <AT> gentoo <DOT> org>
5 CommitDate: Fri Apr 1 10:04:11 2022 +0000
6 URL: https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=60374ea6
7
8 www-servers/tomcat: bump to 9.0.62
9
10 Signed-off-by: Miroslav Šulc <fordfrog <AT> gentoo.org>
11
12 www-servers/tomcat/Manifest | 1 +
13 .../tomcat/files/tomcat-9.0.62-build.xml.patch | 319 +++++++++++++++++++++
14 www-servers/tomcat/tomcat-9.0.62.ebuild | 190 ++++++++++++
15 3 files changed, 510 insertions(+)
16
17 diff --git a/www-servers/tomcat/Manifest b/www-servers/tomcat/Manifest
18 index 3f615beef674..01d590f0b07f 100644
19 --- a/www-servers/tomcat/Manifest
20 +++ b/www-servers/tomcat/Manifest
21 @@ -9,6 +9,7 @@ DIST apache-tomcat-8.5.77-src.tar.gz 5963037 BLAKE2B 63192409b148cf0691e6ad22180
22 DIST apache-tomcat-9.0.58-src.tar.gz 6142037 BLAKE2B 0515273882468958f5bc2ef95e3085c22975e0ec9f8153a20773266a43710645c2262da8cb10736f0f0b255716fa05a12252194e1f32851704364ef89a62e5e9 SHA512 b2b572dcad2efadf3e5e5a6ae6e108f5699af23b7751ca3c9c00e6ba896f5179745108fa602d8bd87a9611fd8bebe8817fad53c38fc75b0063835b953c67d74a
23 DIST apache-tomcat-9.0.59-src.tar.gz 6142359 BLAKE2B 26dee501a374e54280237dbe392924ac89e3e4b331a11b30c2e0923ac38fa16bb52c02dfc8a9f3597fb0ee169ae2835ac254eab745d1e2ab1e64cfed6395d0c3 SHA512 cea0125ca9b90b247ed114fa7b2e9c63da38b1ef97b3a373a43ed0d775764178534a4014b254219c8c5a26575eaf0ddc25ebc1e276b2ad5086ef3406627f1c80
24 DIST apache-tomcat-9.0.60-src.tar.gz 6143845 BLAKE2B af7061854659de06afa6a7cf6380c4be4375e18bec896049bf468ddb9139794170271454af4712ade5099b8d46ed7c8d642e9c5f37ea168f0e31394a5128beeb SHA512 e5cb12fb134ff0a59e01a30fbcabc350ddbef6959494176848c2858c3c68444bc520153e00fdcdecb0eefbe7f69876c2965fedbffeeb0aeda7931dc1c11b0de5
25 +DIST apache-tomcat-9.0.62-src.tar.gz 6156545 BLAKE2B 414f4f7193a8db2bb3d0abcbd2d8c30ede5783e83ba01229ffb322e9bf6b08d2fb10d83ce4742d9e6a4ebc50c9b047679ae798fbd3db8ae165f76d2782034d71 SHA512 7e9cad2703473d9f096009c464b28d54d3765259fab1923ef8c9b1cbfa231fa51cedadfe771a3a95abffd258759a71023e036bda78b949440a5e826fbd4e9e09
26 DIST biz.aQute.bnd-5.1.1.jar 16088761 BLAKE2B 59906cc39ea27ef20cbf82de1ba78096f34dc417da6dc5c28e21f6e92c0625efecf14cec6c5faf0ab17551c31a6c87a24614c2ac75ac902cfea30199ecc0d39f SHA512 8092b083e7b86e75bf27233964763b88bee74d8ae141c85e387c1cc8bd0cbf3a54be27afea29931fb3ae950700a515fd4a28cfe8e7f26cbaaec506aa06357a37
27 DIST biz.aQute.bnd-6.2.0.jar 16669843 BLAKE2B 290aec26cb4e2248488038e6cb0919728ca0cc802b16de3f390d549d135bc1177053b75e500b9f74e47c996d20b231404d57965a3f412662730cc4c938d90a4f SHA512 ad51dc9a04fc117cd01b604559989dd7c7db776761ef6000eccdcfdab825dedc615297af60c778044e46867972a74840d90eebea9b0ff826bdbd10f4d2ec5d6f
28 DIST biz.aQute.bndlib-5.1.1.jar 3652944 BLAKE2B dad9f9835fb407a36e0eae4b65fa2fda147e06ab3f3211a2ed2f1631aeccd6d14d198c325793cb1ce9a57b719a836db230d0452715744ba5a4a6c2983c17916b SHA512 d7da056ba541ae0862159bf5e38e1a5351b2ab5388c88733b46601c2d7dab8970f16af00df186a6cb67fbe81ef53f2c8402db9d28a8c6819dadf60a1df40879b
29
30 diff --git a/www-servers/tomcat/files/tomcat-9.0.62-build.xml.patch b/www-servers/tomcat/files/tomcat-9.0.62-build.xml.patch
31 new file mode 100644
32 index 000000000000..fdf66cf7b63a
33 --- /dev/null
34 +++ b/www-servers/tomcat/files/tomcat-9.0.62-build.xml.patch
35 @@ -0,0 +1,319 @@
36 +diff --git a/build.xml b/build.xml
37 +index 5a0be1b..87bfb33 100644
38 +--- a/build.xml
39 ++++ b/build.xml
40 +@@ -1023,6 +1023,7 @@
41 + addOSGi="true" />
42 +
43 + <!-- Servlet Implementation JAR File -->
44 ++<!--
45 + <jarIt jarfile="${servlet-api.jar}"
46 + filesDir="${tomcat.classes}"
47 + filesId="files.servlet-api"
48 +@@ -1030,21 +1031,23 @@
49 + notice="${tomcat.manifests}/servlet-api.jar.notice"
50 + license="${tomcat.manifests}/servlet-api.jar.license"
51 + addOSGi="true" />
52 +-
53 ++-->
54 + <!-- EL Implementation JAR File -->
55 ++<!--
56 + <jarIt jarfile="${el-api.jar}"
57 + filesDir="${tomcat.classes}"
58 + filesId="files.el-api"
59 + manifest="${tomcat.manifests}/el-api.jar.manifest"
60 + addOSGi="true" />
61 +-
62 ++-->
63 + <!-- JSP Implementation JAR File -->
64 ++<!--
65 + <jarIt jarfile="${jsp-api.jar}"
66 + filesDir="${tomcat.classes}"
67 + filesId="files.jsp-api"
68 + manifest="${tomcat.manifests}/jsp-api.jar.manifest"
69 + addOSGi="true" />
70 +-
71 ++-->
72 + <!-- WebSocket API JAR File -->
73 + <jarIt jarfile="${websocket-api.jar}"
74 + filesDir="${tomcat.classes}"
75 +@@ -1157,10 +1160,10 @@
76 + addOSGi="true" />
77 +
78 + <!-- Re-packaged Apache Commons DBCP 2-->
79 +- <jarIt jarfile="${tomcat-dbcp.jar}"
80 ++<!-- <jarIt jarfile="${tomcat-dbcp.jar}"
81 + filesDir="${tomcat.classes}"
82 + filesId="files.tomcat-dbcp"
83 +- addOSGi="true" />
84 ++ addOSGi="true" /> -->
85 +
86 + <!-- i18n JARs -->
87 + <jar jarfile="${tomcat.build}/lib/tomcat-i18n-cs.jar"
88 +@@ -1397,9 +1400,9 @@
89 +
90 + <target name="deploy" depends="package,build-docs,build-tomcat-jdbc,compile-webapp-examples"
91 + description="Default. Builds a working Tomcat instance">
92 +-
93 ++<!--
94 + <copy tofile="${tomcat.build}/bin/commons-daemon.jar" file="${commons-daemon.jar}" />
95 +-
96 ++-->
97 + <!-- Copy scripts -->
98 + <copy todir="${tomcat.build}/bin">
99 + <fileset dir="bin">
100 +@@ -1459,7 +1462,7 @@
101 + <exclude name="${jdt.jar.filename}"/>
102 + </fileset>
103 + </delete>
104 +- <copy file="${jdt.jar}" todir="${tomcat.build}/lib"/>
105 ++<!-- <copy file="${jdt.jar}" todir="${tomcat.build}/lib"/> -->
106 +
107 + <!-- Add sources for examples -->
108 + <antcall target="examples-sources" />
109 +@@ -1488,7 +1491,7 @@
110 +
111 + </target>
112 +
113 +- <target name="build-tomcat-jdbc" depends="package">
114 ++ <target name="build-tomcat-jdbc" depends="package" unless="noget">
115 + <!-- build the jdbc-pool jar and source jar-->
116 + <echo message="Building Tomcat JDBC pool libraries"/>
117 + <ant antfile="${tomcat.jdbc.dir}/build.xml" dir="${tomcat.jdbc.dir}"
118 +@@ -1504,7 +1507,7 @@
119 + <copy file="${tomcat-jdbc.jar}" todir="${tomcat.build}/lib"/>
120 + </target>
121 +
122 +- <target name="build-tomcat-jdbc-src">
123 ++ <target name="build-tomcat-jdbc-src" unless="noget">
124 + <!-- build the jdbc-pool source jar-->
125 + <echo message="Building Tomcat JDBC pool src JAR"/>
126 + <ant antfile="${tomcat.jdbc.dir}/build.xml" dir="${tomcat.jdbc.dir}"
127 +@@ -1607,9 +1610,11 @@
128 +
129 + <copy file="${basedir}/LICENSE" todir="${tomcat.embed}" />
130 + <copy file="${basedir}/NOTICE" todir="${tomcat.embed}" />
131 ++<!--
132 + <copy file="${tomcat-dbcp.jar}" todir="${tomcat.embed}"
133 + failonerror="false"/>
134 + <copy file="${jdt.jar}" todir="${tomcat.embed}" />
135 ++-->
136 + <copy file="${annotations-api.jar}" todir="${tomcat.embed}" />
137 +
138 + <!-- Note the meta-inf below will work as long as there is only one JAR
139 +@@ -2113,11 +2118,12 @@
140 + </copy>
141 +
142 + <!-- Source bundles for native components -->
143 ++<!--
144 + <copy tofile="${tomcat.dist}/bin/tomcat-native.tar.gz"
145 + file="${tomcat-native.tar.gz}" />
146 + <copy tofile="${tomcat.dist}/bin/commons-daemon-native.tar.gz"
147 + file="${commons-daemon.native.src.tgz}" />
148 +-
149 ++-->
150 + <!-- platform README files -->
151 + <echo append="false" file="${tomcat.dist}/bin/x64/README">
152 + Apache Tomcat ${version} native binaries for Win64 AMD64/EMT64 platform.
153 +@@ -2141,13 +2147,13 @@ Apache Tomcat ${version} native binaries for Win64 AMD64/EMT64 platform.
154 + additionalparam="-breakiterator -notimestamp -html5"
155 + source="${compile.release}"
156 + maxmemory="512m"
157 +- failonerror="true"
158 +- failonwarning="true">
159 ++ failonerror="true">
160 + <classpath>
161 + <path refid="compile.classpath"/>
162 + <path location="${ant.core.lib}"/>
163 + </classpath>
164 + </javadoc>
165 ++<!--
166 + <javadoc packagenames="javax.servlet.*"
167 + excludepackagenames="javax.servlet.jsp.*"
168 + sourcepath="${tomcat.dist}/src/java"
169 +@@ -2212,6 +2218,7 @@ Apache Tomcat ${version} native binaries for Win64 AMD64/EMT64 platform.
170 + <path location="${ant.core.lib}"/>
171 + </classpath>
172 + </javadoc>
173 ++-->
174 + <javadoc packagenames="javax.websocket.*"
175 + sourcepath="${tomcat.dist}/src/java"
176 + destdir="${tomcat.dist}/webapps/docs/websocketapi"
177 +@@ -2226,8 +2233,7 @@ Apache Tomcat ${version} native binaries for Win64 AMD64/EMT64 platform.
178 + additionalparam="-breakiterator -notimestamp -html5"
179 + source="${compile.release}"
180 + maxmemory="512m"
181 +- failonerror="true"
182 +- failonwarning="true">
183 ++ failonerror="true">
184 + <classpath>
185 + <path refid="compile.classpath"/>
186 + <path location="${ant.core.lib}"/>
187 +@@ -2246,8 +2252,7 @@ Apache Tomcat ${version} native binaries for Win64 AMD64/EMT64 platform.
188 + charset="UTF-8"
189 + additionalparam="-breakiterator -notimestamp -html5"
190 + maxmemory="512m"
191 +- failonerror="true"
192 +- failonwarning="true">
193 ++ failonerror="true">
194 + <classpath>
195 + <path refid="compile.classpath"/>
196 + <path location="${ant.core.lib}"/>
197 +@@ -2266,20 +2271,23 @@ Apache Tomcat ${version} native binaries for Win64 AMD64/EMT64 platform.
198 + additionalparam="-breakiterator -notimestamp -html5"
199 + source="${compile.release}"
200 + maxmemory="512m"
201 +- failonerror="true"
202 + failonwarning="true">
203 + <classpath>
204 + <path refid="compile.classpath"/>
205 + <path location="${ant.core.lib}"/>
206 + </classpath>
207 + <link href="../annotationapi"/>
208 ++<!--
209 + <link href="../servletapi"/>
210 + <link href="../jspapi"/>
211 + <link href="../elapi"/>
212 ++-->
213 + <link href="../websocketapi"/>
214 + <link href="../jaspicapi"/>
215 ++<!--
216 + <link href="https://docs.oracle.com/javase/8/docs/api/"/>
217 + <link href="https://javaee.github.io/javaee-spec/javadocs/"/>
218 ++-->
219 + <packageset dir="${tomcat.dist}/src/java/">
220 + <include name="org/**"/>
221 + <exclude name="org/apache/el/parser/**"/>
222 +@@ -3062,7 +3070,7 @@ skip.installer property in build.properties" />
223 +
224 + <target name="download-compile"
225 + description="Download components necessary to compile"
226 +- depends="setup-bnd">
227 ++ depends="setup-bnd" unless="noget">
228 +
229 + <!-- Download Commons Daemon -->
230 + <antcall target="downloadgz-2">
231 +@@ -3106,7 +3114,7 @@ skip.installer property in build.properties" />
232 + </target>
233 +
234 + <target name="download-test-compile"
235 +- description="Download additional components for the tests" >
236 ++ description="Download additional components for the tests" unless="noget">
237 +
238 + <antcall target="downloadfile">
239 + <param name="sourcefile" value="${junit.loc}"/>
240 +@@ -3234,7 +3242,7 @@ skip.installer property in build.properties" />
241 + </target>
242 +
243 + <target name="download-dist"
244 +- description="Download additional components for a distribution" >
245 ++ description="Download additional components for a distribution" unless="noget">
246 +
247 + <antcall target="downloadfile-2">
248 + <param name="sourcefile.1" value="${tomcat-native.loc.1}"/>
249 +@@ -3289,13 +3297,13 @@ skip.installer property in build.properties" />
250 +
251 + <!-- =============== Utility Targets to support downloads ================ -->
252 +
253 +- <target name="setproxy" if="${proxy.use}">
254 ++ <target name="setproxy" if="${proxy.use}" unless="noget">
255 + <setproxy proxyhost="${proxy.host}" proxyport="${proxy.port}"
256 + proxyuser="${proxy.user}" proxypassword="${proxy.password}" />
257 + <echo message="Using ${proxy.host}:${proxy.port} to download ${sourcefile}"/>
258 + </target>
259 +
260 +- <target name="testexist">
261 ++ <target name="testexist" unless="noget">
262 + <echo message="Testing for ${destfile}"/>
263 + <available file="${destfile}" property="exist"/>
264 + </target>
265 +@@ -3417,7 +3425,7 @@ skip.installer property in build.properties" />
266 + </sequential>
267 + </macrodef>
268 +
269 +- <target name="downloadgz" unless="exist" if="${execute.download}" depends="testexist,setproxy">
270 ++ <target name="downloadgz" unless="noget" if="${execute.download}" depends="testexist,setproxy">
271 + <!-- Download and extract the package -->
272 + <local name="temp.file"/>
273 + <mkdir dir="${base.path}"/>
274 +@@ -3434,7 +3442,7 @@ skip.installer property in build.properties" />
275 + <delete file="${temp.file}.tar.gz"/>
276 + </target>
277 +
278 +- <target name="downloadgz-2" unless="exist" if="${execute.download}" depends="testexist">
279 ++ <target name="downloadgz-2" unless="noget" if="${execute.download}" depends="testexist">
280 + <!-- Download and extract the package from the two alternative locations -->
281 + <local name="temp.file"/>
282 + <mkdir dir="${base.path}"/>
283 +@@ -3459,7 +3467,7 @@ skip.installer property in build.properties" />
284 + <delete file="${temp.file}.tar.gz"/>
285 + </target>
286 +
287 +- <target name="downloadzip" unless="exist" if="${execute.download}" depends="testexist,setproxy">
288 ++ <target name="downloadzip" unless="noget" if="${execute.download}" depends="testexist,setproxy">
289 + <!-- Download and extract the package -->
290 + <local name="temp.file"/>
291 + <mkdir dir="${base.path}"/>
292 +@@ -3475,7 +3483,7 @@ skip.installer property in build.properties" />
293 + <delete file="${temp.file}"/>
294 + </target>
295 +
296 +- <target name="downloadzip-2" unless="exist" if="${execute.download}" depends="testexist">
297 ++ <target name="downloadzip-2" unless="noget" if="${execute.download}" depends="testexist">
298 + <!-- Download and extract the package from the two alternative locations -->
299 + <local name="temp.file"/>
300 + <mkdir dir="${base.path}"/>
301 +@@ -3499,7 +3507,7 @@ skip.installer property in build.properties" />
302 + <delete file="${temp.file}"/>
303 + </target>
304 +
305 +- <target name="downloadfile" unless="exist" if="${execute.download}" depends="testexist,setproxy">
306 ++ <target name="downloadfile" unless="noget" if="${execute.download}" depends="testexist,setproxy">
307 + <!-- Download the file -->
308 + <local name="temp.file"/>
309 + <mkdir dir="${base.path}"/>
310 +@@ -3514,7 +3522,7 @@ skip.installer property in build.properties" />
311 + <move file="${temp.file}" tofile="${destfile}"/>
312 + </target>
313 +
314 +- <target name="downloadfile-2" unless="exist" if="${execute.download}" depends="testexist">
315 ++ <target name="downloadfile-2" unless="noget" if="${execute.download}" depends="testexist">
316 + <!-- Download the file from the two alternative locations -->
317 + <local name="temp.file"/>
318 + <mkdir dir="${base.path}"/>
319 +@@ -3542,7 +3550,7 @@ skip.installer property in build.properties" />
320 + <move file="${temp.file}" tofile="${destfile}"/>
321 + </target>
322 +
323 +- <target name="trydownload.check" depends="setproxy">
324 ++ <target name="trydownload.check" depends="setproxy" unless="noget">
325 + <condition property="trydownload.run">
326 + <and>
327 + <not>
328 +@@ -3553,7 +3561,7 @@ skip.installer property in build.properties" />
329 + </condition>
330 + </target>
331 +
332 +- <target name="trydownload" if="trydownload.run" depends="trydownload.check">
333 ++ <target name="trydownload" if="trydownload.run" depends="trydownload.check" unless="noget">
334 + <!-- Downloads a file if not yet downloaded and the source URL is available -->
335 + <get src="${sourcefile}" httpusecaches="${trydownload.httpusecaches}" dest="${destfile}" />
336 + </target>
337 +@@ -3564,7 +3572,7 @@ skip.installer property in build.properties" />
338 +
339 + <target name="ide-eclipse"
340 + depends="download-compile, download-test-compile"
341 +- description="Prepares the source tree to be built in Eclipse">
342 ++ description="Prepares the source tree to be built in Eclipse" unless="noget">
343 +
344 + <!-- Copy the sample project files into the root directory -->
345 + <copy file="${tomcat.home}/res/ide-support/eclipse/eclipse.project" tofile="${tomcat.home}/.project"/>
346 +@@ -3582,7 +3590,7 @@ Read the Building page on the Apache Tomcat documentation site for details on ho
347 +
348 + <target name="ide-intellij"
349 + depends="download-compile, download-test-compile"
350 +- description="Creates project directory .idea for IntelliJ IDEA">
351 ++ description="Creates project directory .idea for IntelliJ IDEA" unless="noget">
352 +
353 + <copy todir="${tomcat.home}/.idea">
354 + <fileset dir="${tomcat.home}/res/ide-support/idea"/>
355
356 diff --git a/www-servers/tomcat/tomcat-9.0.62.ebuild b/www-servers/tomcat/tomcat-9.0.62.ebuild
357 new file mode 100644
358 index 000000000000..e151500fc704
359 --- /dev/null
360 +++ b/www-servers/tomcat/tomcat-9.0.62.ebuild
361 @@ -0,0 +1,190 @@
362 +# Copyright 1999-2022 Gentoo Authors
363 +# Distributed under the terms of the GNU General Public License v2
364 +
365 +EAPI=8
366 +
367 +JAVA_PKG_IUSE="doc source test"
368 +
369 +inherit java-pkg-2 java-ant-2 prefix
370 +
371 +MY_P="apache-${PN}-${PV}-src"
372 +
373 +# Currently we bundle binary versions of bnd.jar and bndlib.jar
374 +# See bugs #203080 and #676116
375 +BND_VERSION="6.2.0"
376 +BND="biz.aQute.bnd-${BND_VERSION}.jar"
377 +BNDLIB="biz.aQute.bndlib-${BND_VERSION}.jar"
378 +
379 +DESCRIPTION="Tomcat Servlet-4.0/JSP-2.3/EL-3.0/WebSocket-1.1/JASPIC-1.1 Container"
380 +HOMEPAGE="https://tomcat.apache.org/"
381 +SRC_URI="mirror://apache/${PN}/tomcat-9/v${PV}/src/${MY_P}.tar.gz
382 + https://repo.maven.apache.org/maven2/biz/aQute/bnd/biz.aQute.bnd/${BND_VERSION}/${BND}
383 + https://repo.maven.apache.org/maven2/biz/aQute/bnd/biz.aQute.bndlib/${BND_VERSION}/${BNDLIB}"
384 +
385 +LICENSE="Apache-2.0"
386 +SLOT="9"
387 +KEYWORDS="~amd64 ~x86 ~amd64-linux ~x86-linux ~x86-solaris"
388 +IUSE="extra-webapps"
389 +
390 +RESTRICT="test" # can we run them on a production system?
391 +
392 +# though it could work with 4.22 and upstream uses 4.20,
393 +# we still use 4.15 because 4.20+ is currently built with java 11
394 +# and it would force Tomcat to use at least java 11 too
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-1.8:*"
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.62-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 +}