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: Sun, 09 Feb 2020 23:34:14
Message-Id: 1581291226.91e6fa30f4bcd1278c5423b370f42d0b3700df4e.fordfrog@gentoo
1 commit: 91e6fa30f4bcd1278c5423b370f42d0b3700df4e
2 Author: Miroslav Šulc <fordfrog <AT> gentoo <DOT> org>
3 AuthorDate: Sun Feb 9 23:33:46 2020 +0000
4 Commit: Miroslav Šulc <fordfrog <AT> gentoo <DOT> org>
5 CommitDate: Sun Feb 9 23:33:46 2020 +0000
6 URL: https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=91e6fa30
7
8 www-servers/tomcat: bump to 7.0.99 + eapi7
9
10 Package-Manager: Portage-2.3.88, Repoman-2.3.20
11 Signed-off-by: Miroslav Šulc <fordfrog <AT> gentoo.org>
12
13 www-servers/tomcat/Manifest | 1 +
14 .../tomcat/files/tomcat-7.0.99-build.xml.patch | 163 +++++++++++++++++++++
15 www-servers/tomcat/tomcat-7.0.99.ebuild | 146 ++++++++++++++++++
16 3 files changed, 310 insertions(+)
17
18 diff --git a/www-servers/tomcat/Manifest b/www-servers/tomcat/Manifest
19 index 939f324b27c..07d17aa1390 100644
20 --- a/www-servers/tomcat/Manifest
21 +++ b/www-servers/tomcat/Manifest
22 @@ -1,4 +1,5 @@
23 DIST apache-tomcat-7.0.96-src.tar.gz 4983881 BLAKE2B d5b828b7a4e8a7a5ce793a15421fbd6b12b55918aa7c15bc8209b4c762d7f422a7315e4cbe9b4ae2da754b6d8493bc11ae6a5c99f11a1ac3b23473e05fa26c83 SHA512 5797e66fb9ce558340e08d3a4ccd372d912707aabd6177318781925dd35055902a0ecc3e50e677d76b0feea547cc8fc038bb83ae5de65d28680cb4c9582f60c0
24 +DIST apache-tomcat-7.0.99-src.tar.gz 5242549 BLAKE2B e24933364bae6ddd2b7aeec342f3bfe0293533e2513a34ec6e9b5b6da7ecc3c2fb1d88c1b49f470532d8db821a0b8f0821698d8ec52a6d88a7769cd86912a8bc SHA512 3148879d4a893167b9e60fd1ee6972fc9be8a5be97016ad1d86117c0cb681ac40702680bd21562a284f78aac327f0388e99af458cf1868a3b0ad5e31899b23c0
25 DIST apache-tomcat-8.5.47-src.tar.gz 5607118 BLAKE2B 3c326056f674032424d298c7581243a24dd01fae39b1ce7069b60e1bcf3d825de954164f643e887618c43c87d691bc41f942e73bf86b254b4c7dca9c68ce7cce SHA512 1513fdaf7751ee263d878cdfc05329bc4ee50e2f3aeea68e1d173a5f4d555ec59a43050222f013758f704967730dd25a64337cf1ba4365ab53b8730af87b4051
26 DIST apache-tomcat-9.0.27-src.tar.gz 5761278 BLAKE2B 7d4a65dfa43e0956a5dbb1dad3bf1aa475e7c503d3192ac24921d7cee9bd85379cd820ce693e8c583a7cab23263b0abfa960968d04d766764e222ba8c5bd97d4 SHA512 3f63cbd49f93e6a9d44ea63b4f787cf498930b82d19eaf60603c126b8800d2894d306c27e42ab73b042f3bba9cfb75b6c939b91b8b9141e4903eb1b88c2a4ec8
27 DIST apache-tomcat-9.0.7-src.tar.gz 5106551 BLAKE2B b4552146a40c2e7cbb2e454fb5ec9169425db5c08cf269c391ec3144425ad388a2b6f003a7c05f59a9fd724fb5c848102890a24fcfd43d5fea3d881141aa7798 SHA512 cb7dc5547671d94f7c7fb0b58eeb94d05128349cdabf576fc8ad837a4bf3ea655a8eab3342245dfa84a9db23f1cbee2918846eedd48e3ca372eecebfef13c5b2
28
29 diff --git a/www-servers/tomcat/files/tomcat-7.0.99-build.xml.patch b/www-servers/tomcat/files/tomcat-7.0.99-build.xml.patch
30 new file mode 100644
31 index 00000000000..29cf6c2e403
32 --- /dev/null
33 +++ b/www-servers/tomcat/files/tomcat-7.0.99-build.xml.patch
34 @@ -0,0 +1,163 @@
35 +diff --git a/build.xml b/build.xml
36 +index dbad7cb..101bc57 100644
37 +--- a/build.xml
38 ++++ b/build.xml
39 +@@ -715,12 +715,14 @@
40 + </fileset>
41 + </copy>
42 + <!-- Copy JSP Schemas and DTDs to be packed into servlet-api.jar -->
43 ++<!--
44 + <copy todir="${tomcat.classes}/javax/servlet/resources" encoding="ISO-8859-1">
45 + <fileset dir="${tomcat.classes}/javax/servlet/jsp/resources">
46 + <include name="*" />
47 + <exclude name="jspxml*" />
48 + </fileset>
49 + </copy>
50 ++-->
51 +
52 + <!-- Convert the message files from UTF-8 to ASCII. This can be removed
53 + after upgrading to Java 9+ as the minimum JRE and specifying the encoding
54 +@@ -776,26 +778,32 @@
55 + manifest="${tomcat.manifests}/annotations-api.jar.manifest" />
56 +
57 + <!-- Servlet 3.0 Implementation JAR File -->
58 ++<!--
59 + <jarIt jarfile="${servlet-api.jar}"
60 + filesDir="${tomcat.classes}"
61 + filesId="files.servlet-api"
62 + manifest="${tomcat.manifests}/servlet-api.jar.manifest"
63 + notice="${tomcat.manifests}/servlet-api.jar.notice"
64 + license="${tomcat.manifests}/servlet-api.jar.license" />
65 ++-->
66 +
67 + <!-- JSP 2.2 Implementation JAR File -->
68 ++<!--
69 + <jarIt jarfile="${jsp-api.jar}"
70 + filesDir="${tomcat.classes}"
71 + filesId="files.jsp-api"
72 + manifest="${tomcat.manifests}/jsp-api.jar.manifest"
73 + notice="${tomcat.manifests}/jsp-api.jar.notice"
74 + license="${tomcat.manifests}/jsp-api.jar.license" />
75 ++-->
76 +
77 + <!-- JSP 2.2 EL Implementation JAR File -->
78 ++<!--
79 + <jarIt jarfile="${el-api.jar}"
80 + filesDir="${tomcat.classes}"
81 + filesId="files.el-api"
82 + manifest="${tomcat.manifests}/el-api.jar.manifest" />
83 ++-->
84 +
85 + <!-- Bootstrap JAR File -->
86 + <jarIt jarfile="${bootstrap.jar}"
87 +@@ -854,9 +862,9 @@
88 + filesId="files.jasper-el" />
89 +
90 + <!-- Re-packaged Apache Commons DBCP 1-->
91 +- <jarIt jarfile="${tomcat-dbcp.jar}"
92 ++<!-- <jarIt jarfile="${tomcat-dbcp.jar}"
93 + filesDir="${tomcat.classes}"
94 +- filesId="files.tomcat-dbcp" />
95 ++ filesId="files.tomcat-dbcp" /> -->
96 +
97 + <!-- i18n JARs -->
98 + <jar jarfile="${tomcat.build}/lib/tomcat-i18n-de.jar"
99 +@@ -1087,9 +1095,9 @@
100 +
101 + <target name="deploy" depends="package,build-docs,compile-webapp-examples"
102 + description="Default. Builds a working Tomcat instance">
103 +-
104 ++<!--
105 + <copy tofile="${tomcat.build}/bin/commons-daemon.jar" file="${commons-daemon.jar}" />
106 +-
107 ++-->
108 + <!-- Copy scripts -->
109 + <copy todir="${tomcat.build}/bin">
110 + <fileset dir="bin">
111 +@@ -1149,7 +1157,7 @@
112 + <exclude name="${jdt.jar.filename}"/>
113 + </fileset>
114 + </delete>
115 +- <copy file="${jdt.jar}" todir="${tomcat.build}/lib"/>
116 ++<!-- <copy file="${jdt.jar}" todir="${tomcat.build}/lib"/> -->
117 +
118 + <!-- Add sources for examples -->
119 + <antcall target="examples-sources" />
120 +@@ -1839,7 +1847,7 @@
121 +
122 + <target name="extras-webservices-prepare"
123 + depends="extras-prepare"
124 +- description="Prepare to build web services extras package">
125 ++ description="Prepare to build web services extras package" unless="noget">
126 +
127 + <antcall target="downloadfile">
128 + <param name="sourcefile" value="${jaxrpc-lib.loc}"/>
129 +@@ -2034,11 +2042,12 @@
130 + </copy>
131 +
132 + <!-- Source bundles for native components -->
133 ++<!--
134 + <copy tofile="${tomcat.dist}/bin/tomcat-native.tar.gz"
135 + file="${tomcat-native.tar.gz}" />
136 + <copy tofile="${tomcat.dist}/bin/commons-daemon-native.tar.gz"
137 + file="${commons-daemon.native.src.tgz}" />
138 +-
139 ++-->
140 + <!-- platform README files -->
141 + <echo append="false" file="${tomcat.dist}/bin/x64/README">
142 + Apache Tomcat ${version} native binaries for Win64 AMD64/EMT64 platform.
143 +@@ -2070,6 +2079,7 @@ Apache Tomcat ${version} native binaries for Win64 AMD64/EMT64 platform.
144 + <path location="${ant.core.lib}"/>
145 + </classpath>
146 + </javadoc>
147 ++<!--
148 + <javadoc packagenames="javax.servlet.*"
149 + excludepackagenames="javax.servlet.jsp.*"
150 + sourcepath="${tomcat.dist}/src/java"
151 +@@ -2137,6 +2147,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="javax.websocket.*"
157 + sourcepath="${tomcat.dist}/src/java"
158 + destdir="${tomcat.dist}/webapps/docs/websocketapi"
159 +@@ -2181,9 +2192,11 @@ Apache Tomcat ${version} native binaries for Win64 AMD64/EMT64 platform.
160 + <path location="${ant.core.lib}"/>
161 + </classpath>
162 + <link href="../annotationapi"/>
163 ++<!--
164 + <link href="../servletapi"/>
165 + <link href="../jspapi"/>
166 + <link href="../elapi"/>
167 ++-->
168 + <link href="../websocketapi"/>
169 + <link href="https://docs.oracle.com/javase/7/docs/api/"/>
170 + <link href="https://docs.oracle.com/javaee/6/api/"/>
171 +@@ -2889,7 +2902,7 @@ skip.installer property in build.properties" />
172 + </target>
173 +
174 + <target name="download-compile"
175 +- description="Download components necessary to compile" >
176 ++ description="Download components necessary to compile" unless="noget" >
177 +
178 + <!-- Download Commons Daemon -->
179 + <antcall target="downloadgz-2">
180 +@@ -2925,7 +2938,7 @@ skip.installer property in build.properties" />
181 + </target>
182 +
183 + <target name="download-test-compile"
184 +- description="Download additional components for the tests" >
185 ++ description="Download additional components for the tests" unless="noget">
186 +
187 + <antcall target="downloadfile">
188 + <param name="sourcefile" value="${junit.loc}"/>
189 +@@ -2989,7 +3002,7 @@ skip.installer property in build.properties" />
190 + </target>
191 +
192 + <target name="download-dist"
193 +- description="Download additional components for a distribution" >
194 ++ description="Download additional components for a distribution" unless="noget">
195 +
196 + <antcall target="downloadfile-2">
197 + <param name="sourcefile.1" value="${tomcat-native.loc.1}"/>
198
199 diff --git a/www-servers/tomcat/tomcat-7.0.99.ebuild b/www-servers/tomcat/tomcat-7.0.99.ebuild
200 new file mode 100644
201 index 00000000000..7fa74915d25
202 --- /dev/null
203 +++ b/www-servers/tomcat/tomcat-7.0.99.ebuild
204 @@ -0,0 +1,146 @@
205 +# Copyright 1999-2020 Gentoo Authors
206 +# Distributed under the terms of the GNU General Public License v2
207 +
208 +EAPI=7
209 +
210 +JAVA_PKG_IUSE="doc source test"
211 +
212 +inherit eutils java-pkg-2 java-ant-2 prefix user
213 +
214 +MY_P="apache-${P}-src"
215 +
216 +DESCRIPTION="Tomcat Servlet-3.0/JSP-2.2 Container"
217 +HOMEPAGE="https://tomcat.apache.org/"
218 +SRC_URI="mirror://apache/${PN}/tomcat-7/v${PV}/src/${MY_P}.tar.gz"
219 +
220 +LICENSE="Apache-2.0"
221 +SLOT="7"
222 +KEYWORDS="~amd64 ~ppc64 ~x86 ~amd64-linux ~x86-linux ~x86-solaris"
223 +IUSE="extra-webapps websockets"
224 +
225 +RESTRICT="test" # can we run them on a production system?
226 +
227 +ECJ_SLOT="4.5"
228 +SAPI_SLOT="3.0"
229 +
230 +COMMON_DEP="dev-java/eclipse-ecj:${ECJ_SLOT}
231 + dev-java/tomcat-servlet-api:${SAPI_SLOT}"
232 +RDEPEND="${COMMON_DEP}
233 + virtual/jre"
234 +DEPEND="${COMMON_DEP}
235 + virtual/jdk:1.8
236 + test? ( dev-java/ant-junit:0 )"
237 +
238 +S=${WORKDIR}/${MY_P}
239 +
240 +pkg_setup() {
241 + java-pkg-2_pkg_setup
242 + enewgroup tomcat 265
243 + enewuser tomcat 265 -1 /dev/null tomcat
244 +}
245 +
246 +src_prepare() {
247 + default
248 +
249 + # Remove bundled servlet-api
250 + rm -rv java/javax/{el,servlet} || die
251 +
252 + java-pkg_clean
253 +
254 + eapply "${FILESDIR}/${P}-build.xml.patch"
255 +
256 + # For use of catalina.sh in netbeans
257 + sed -i -e "/^# ----- Execute The Requested Command/ a\
258 + CLASSPATH=\`java-config --classpath ${PN}-${SLOT}\`" \
259 + bin/catalina.sh || die
260 +
261 + java-pkg-2_src_prepare
262 +}
263 +
264 +JAVA_ANT_REWRITE_CLASSPATH="true"
265 +
266 +EANT_BUILD_TARGET="deploy"
267 +EANT_GENTOO_CLASSPATH="eclipse-ecj-${ECJ_SLOT},tomcat-servlet-api-${SAPI_SLOT}"
268 +EANT_GENTOO_CLASSPATH_EXTRA="${S}/output/classes"
269 +EANT_NEEDS_TOOLS="true"
270 +EANT_EXTRA_ARGS="-Dversion=${PV}-gentoo -Dversion.number=${PV} -Dcompile.debug=false"
271 +
272 +# revisions of the scripts
273 +IM_REV="-r1"
274 +INIT_REV="-r1"
275 +
276 +src_compile() {
277 + use websockets && EANT_EXTRA_ARGS+=" -Djava.7.home=${JAVA_HOME}"
278 + EANT_GENTOO_CLASSPATH_EXTRA+=":$(java-pkg_getjar --build-only ant-core ant.jar)"
279 + java-pkg-2_src_compile
280 +}
281 +
282 +src_test() {
283 + java-pkg-2_src_test
284 +}
285 +
286 +src_install() {
287 + local dest="/usr/share/${PN}-${SLOT}"
288 +
289 + java-pkg_jarinto "${dest}"/bin
290 + java-pkg_dojar output/build/bin/*.jar
291 + exeinto "${dest}"/bin
292 + doexe output/build/bin/*.sh
293 +
294 + java-pkg_jarinto "${dest}"/lib
295 + java-pkg_dojar output/build/lib/*.jar
296 +
297 + dodoc RELEASE-NOTES RUNNING.txt
298 + use doc && java-pkg_dojavadoc output/dist/webapps/docs/api
299 + use source && java-pkg_dosrc java/*
300 +
301 + ### Webapps ###
302 +
303 + insinto "${dest}"/webapps
304 + doins -r output/build/webapps/{host-manager,manager,ROOT}
305 + use extra-webapps && doins -r output/build/webapps/{docs,examples}
306 +
307 + ### Config ###
308 +
309 + # create "logs" directory in $CATALINA_BASE
310 + # and set correct perms, see #458890
311 + dodir "${dest}"/logs
312 + fperms 0750 "${dest}"/logs
313 +
314 + # replace the default pw with a random one, see #92281
315 + local randpw=$(echo ${RANDOM}|md5sum|cut -c 1-15)
316 + sed -i -e "s|SHUTDOWN|${randpw}|" output/build/conf/server.xml || die
317 +
318 + # prepend gentoo.classpath to common.loader, see #453212
319 + sed -i -e 's/^common\.loader=/\0${gentoo.classpath},/' output/build/conf/catalina.properties || die
320 +
321 + insinto "${dest}"
322 + doins -r output/build/conf
323 +
324 + ### rc ###
325 +
326 + cp "${FILESDIR}"/tomcat{.conf,${INIT_REV}.init,-instance-manager${IM_REV}.bash} "${T}" || die
327 + eprefixify "${T}"/tomcat{.conf,${INIT_REV}.init,-instance-manager${IM_REV}.bash}
328 + sed -i -e "s|@SLOT@|${SLOT}|g" "${T}"/tomcat{.conf,${INIT_REV}.init,-instance-manager${IM_REV}.bash} || die
329 +
330 + insinto "${dest}"/gentoo
331 + doins "${T}"/tomcat.conf
332 + exeinto "${dest}"/gentoo
333 + newexe "${T}"/tomcat${INIT_REV}.init tomcat.init
334 + newexe "${T}"/tomcat-instance-manager${IM_REV}.bash tomcat-instance-manager.bash
335 +}
336 +
337 +pkg_postinst() {
338 + elog "New ebuilds of Tomcat support running multiple instances. If you used prior version"
339 + elog "of Tomcat (<7.0.32), you have to migrate your existing instance to work with new Tomcat."
340 + elog "You can find more information at https://wiki.gentoo.org/wiki/Apache_Tomcat"
341 +
342 + elog "To manage Tomcat instances, run:"
343 + elog " ${EPREFIX}/usr/share/${PN}-${SLOT}/gentoo/tomcat-instance-manager.bash --help"
344 +
345 + ewarn "tomcat-dbcp.jar is not built at this time. Please fetch jar"
346 + ewarn "from upstream binary if you need it. Gentoo Bug # 144276"
347 +
348 + einfo "Please read https://wiki.gentoo.org/wiki/Apache_Tomcat and"
349 + einfo "https://wiki.gentoo.org/wiki/Project:Java/Tomcat_6_Guide for more information."
350 +}