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/
Date: Sun, 01 May 2022 15:58:46
Message-Id: 1651420711.c596939e5f0c3d99116a904c957b88285e46c915.fordfrog@gentoo
1 commit: c596939e5f0c3d99116a904c957b88285e46c915
2 Author: Volkmar W. Pogatzki <gentoo <AT> pogatzki <DOT> net>
3 AuthorDate: Wed Mar 16 11:09:24 2022 +0000
4 Commit: Miroslav Šulc <fordfrog <AT> gentoo <DOT> org>
5 CommitDate: Sun May 1 15:58:31 2022 +0000
6 URL: https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=c596939e
7
8 www-servers/tomcat: Switch to ECJ_SLOT="4.15"
9
10 Package-Manager: Portage-3.0.30, Repoman-3.0.3
11 Signed-off-by: Volkmar W. Pogatzki <gentoo <AT> pogatzki.net>
12 Closes: https://github.com/gentoo/gentoo/pull/24603
13 Signed-off-by: Miroslav Šulc <fordfrog <AT> gentoo.org>
14
15 www-servers/tomcat/tomcat-7.0.109-r1.ebuild | 142 +++++++++++++++++++++++++
16 www-servers/tomcat/tomcat-8.5.78-r1.ebuild | 159 ++++++++++++++++++++++++++++
17 2 files changed, 301 insertions(+)
18
19 diff --git a/www-servers/tomcat/tomcat-7.0.109-r1.ebuild b/www-servers/tomcat/tomcat-7.0.109-r1.ebuild
20 new file mode 100644
21 index 000000000000..c04750470fc6
22 --- /dev/null
23 +++ b/www-servers/tomcat/tomcat-7.0.109-r1.ebuild
24 @@ -0,0 +1,142 @@
25 +# Copyright 1999-2022 Gentoo Authors
26 +# Distributed under the terms of the GNU General Public License v2
27 +
28 +EAPI=8
29 +
30 +JAVA_PKG_IUSE="doc source test"
31 +
32 +inherit java-pkg-2 java-ant-2 prefix
33 +
34 +MY_P="apache-${P}-src"
35 +
36 +DESCRIPTION="Tomcat Servlet-3.0/JSP-2.2 Container"
37 +HOMEPAGE="https://tomcat.apache.org/"
38 +SRC_URI="https://archive.apache.org/dist/${PN}/tomcat-7/v${PV}/src/${MY_P}.tar.gz"
39 +
40 +LICENSE="Apache-2.0"
41 +SLOT="7"
42 +KEYWORDS="~amd64 ~x86 ~amd64-linux ~x86-linux"
43 +IUSE="extra-webapps websockets"
44 +
45 +RESTRICT="test" # can we run them on a production system?
46 +
47 +ECJ_SLOT="4.15"
48 +SAPI_SLOT="3.0"
49 +
50 +COMMON_DEP="dev-java/eclipse-ecj:${ECJ_SLOT}
51 + ~dev-java/tomcat-servlet-api-${PV}:${SAPI_SLOT}"
52 +RDEPEND="${COMMON_DEP}
53 + acct-group/tomcat
54 + acct-user/tomcat
55 + virtual/jre"
56 +DEPEND="${COMMON_DEP}
57 + virtual/jdk:1.8
58 + test? ( dev-java/ant-junit:0 )"
59 +
60 +S=${WORKDIR}/${MY_P}
61 +
62 +src_prepare() {
63 + default
64 +
65 + # Remove bundled servlet-api
66 + rm -rv java/javax/{el,servlet} || die
67 +
68 + java-pkg_clean
69 +
70 + eapply "${FILESDIR}/${PN}-7.0.99-build.xml.patch"
71 +
72 + # For use of catalina.sh in netbeans
73 + sed -i -e "/^# ----- Execute The Requested Command/ a\
74 + CLASSPATH=\`java-config --with-dependencies --classpath ${PN}-${SLOT}\`" \
75 + bin/catalina.sh || die
76 +
77 + java-pkg-2_src_prepare
78 +}
79 +
80 +JAVA_ANT_REWRITE_CLASSPATH="true"
81 +
82 +EANT_BUILD_TARGET="deploy"
83 +EANT_GENTOO_CLASSPATH="eclipse-ecj-${ECJ_SLOT},tomcat-servlet-api-${SAPI_SLOT}"
84 +EANT_GENTOO_CLASSPATH_EXTRA="${S}/output/classes"
85 +EANT_NEEDS_TOOLS="true"
86 +EANT_EXTRA_ARGS="-Dversion=${PV}-gentoo -Dversion.number=${PV} -Dcompile.debug=false"
87 +
88 +# revisions of the scripts
89 +IM_REV="-r1"
90 +INIT_REV="-r1"
91 +
92 +src_compile() {
93 + use websockets && EANT_EXTRA_ARGS+=" -Djava.7.home=${JAVA_HOME}"
94 + EANT_GENTOO_CLASSPATH_EXTRA+=":$(java-pkg_getjar --build-only ant-core ant.jar)"
95 + java-pkg-2_src_compile
96 +}
97 +
98 +src_test() {
99 + java-pkg-2_src_test
100 +}
101 +
102 +src_install() {
103 + local dest="/usr/share/${PN}-${SLOT}"
104 +
105 + java-pkg_jarinto "${dest}"/bin
106 + java-pkg_dojar output/build/bin/*.jar
107 + exeinto "${dest}"/bin
108 + doexe output/build/bin/*.sh
109 +
110 + java-pkg_jarinto "${dest}"/lib
111 + java-pkg_dojar output/build/lib/*.jar
112 +
113 + dodoc RELEASE-NOTES RUNNING.txt
114 + use doc && java-pkg_dojavadoc output/dist/webapps/docs/api
115 + use source && java-pkg_dosrc java/*
116 +
117 + ### Webapps ###
118 +
119 + insinto "${dest}"/webapps
120 + doins -r output/build/webapps/{host-manager,manager,ROOT}
121 + use extra-webapps && doins -r output/build/webapps/{docs,examples}
122 +
123 + ### Config ###
124 +
125 + # create "logs" directory in $CATALINA_BASE
126 + # and set correct perms, see #458890
127 + dodir "${dest}"/logs
128 + fperms 0750 "${dest}"/logs
129 +
130 + # replace the default pw with a random one, see #92281
131 + local randpw=$(echo ${RANDOM}|md5sum|cut -c 1-15)
132 + sed -i -e "s|SHUTDOWN|${randpw}|" output/build/conf/server.xml || die
133 +
134 + # prepend gentoo.classpath to common.loader, see #453212
135 + sed -i -e 's/^common\.loader=/\0${gentoo.classpath},/' output/build/conf/catalina.properties || die
136 +
137 + insinto "${dest}"
138 + doins -r output/build/conf
139 +
140 + ### rc ###
141 +
142 + cp "${FILESDIR}"/tomcat{.conf,${INIT_REV}.init,-instance-manager${IM_REV}.bash} "${T}" || die
143 + eprefixify "${T}"/tomcat{.conf,${INIT_REV}.init,-instance-manager${IM_REV}.bash}
144 + sed -i -e "s|@SLOT@|${SLOT}|g" "${T}"/tomcat{.conf,${INIT_REV}.init,-instance-manager${IM_REV}.bash} || die
145 +
146 + insinto "${dest}"/gentoo
147 + doins "${T}"/tomcat.conf
148 + exeinto "${dest}"/gentoo
149 + newexe "${T}"/tomcat${INIT_REV}.init tomcat.init
150 + newexe "${T}"/tomcat-instance-manager${IM_REV}.bash tomcat-instance-manager.bash
151 +}
152 +
153 +pkg_postinst() {
154 + elog "New ebuilds of Tomcat support running multiple instances. If you used prior version"
155 + elog "of Tomcat (<7.0.32), you have to migrate your existing instance to work with new Tomcat."
156 + elog "You can find more information at https://wiki.gentoo.org/wiki/Apache_Tomcat"
157 +
158 + elog "To manage Tomcat instances, run:"
159 + elog " ${EPREFIX}/usr/share/${PN}-${SLOT}/gentoo/tomcat-instance-manager.bash --help"
160 +
161 + ewarn "tomcat-dbcp.jar is not built at this time. Please fetch jar"
162 + ewarn "from upstream binary if you need it. Gentoo Bug # 144276"
163 +
164 + einfo "Please read https://wiki.gentoo.org/wiki/Apache_Tomcat and"
165 + einfo "https://wiki.gentoo.org/wiki/Project:Java/Tomcat_6_Guide for more information."
166 +}
167
168 diff --git a/www-servers/tomcat/tomcat-8.5.78-r1.ebuild b/www-servers/tomcat/tomcat-8.5.78-r1.ebuild
169 new file mode 100644
170 index 000000000000..d0fb542639ea
171 --- /dev/null
172 +++ b/www-servers/tomcat/tomcat-8.5.78-r1.ebuild
173 @@ -0,0 +1,159 @@
174 +# Copyright 1999-2022 Gentoo Authors
175 +# Distributed under the terms of the GNU General Public License v2
176 +
177 +EAPI=8
178 +
179 +JAVA_PKG_IUSE="doc source test"
180 +
181 +inherit java-pkg-2 java-ant-2 prefix
182 +
183 +MY_P="apache-${P}-src"
184 +
185 +DESCRIPTION="Tomcat Servlet-3.1/JSP-2.3/EL-3.0/WebSocket-1.1/JASPIC-1.1 Container"
186 +HOMEPAGE="https://tomcat.apache.org/"
187 +SRC_URI="mirror://apache/${PN}/tomcat-8/v${PV}/src/${MY_P}.tar.gz"
188 +
189 +LICENSE="Apache-2.0"
190 +SLOT="8.5"
191 +KEYWORDS="~amd64 ~x86 ~amd64-linux ~x86-linux ~x86-solaris"
192 +IUSE="extra-webapps"
193 +
194 +RESTRICT="test" # can we run them on a production system?
195 +
196 +ECJ_SLOT="4.15"
197 +SAPI_SLOT="3.1"
198 +
199 +COMMON_DEP="dev-java/eclipse-ecj:${ECJ_SLOT}
200 + ~dev-java/tomcat-servlet-api-${PV}:${SAPI_SLOT}"
201 +RDEPEND="${COMMON_DEP}
202 + acct-group/tomcat
203 + acct-user/tomcat
204 + >=virtual/jre-1.8:*"
205 +DEPEND="${COMMON_DEP}
206 + app-admin/pwgen
207 + dev-java/ant-core
208 + >=virtual/jdk-1.8:*
209 + doc? (
210 + dev-java/glassfish-xmlrpc-api:0
211 + dev-java/wsdl4j:0
212 + )
213 + test? (
214 + >=dev-java/ant-junit-1.9:0
215 + dev-java/easymock:3.2
216 + )"
217 +
218 +S=${WORKDIR}/${MY_P}
219 +
220 +src_prepare() {
221 + default
222 +
223 + find -name '*.jar' -type f -delete -print || die
224 +
225 + # Remove bundled servlet-api
226 + rm -rv java/javax/{el,servlet} || die
227 +
228 + eapply "${FILESDIR}/${PN}-8.5.66-build.xml.patch"
229 +
230 + # For use of catalina.sh in netbeans
231 + sed -i -e "/^# ----- Execute The Requested Command/ a\
232 + CLASSPATH=\`java-config --with-dependencies --classpath ${PN}-${SLOT}\`" \
233 + bin/catalina.sh || die
234 +
235 + java-pkg-2_src_prepare
236 +}
237 +
238 +JAVA_ANT_REWRITE_CLASSPATH="true"
239 +
240 +EANT_BUILD_TARGET="deploy"
241 +EANT_GENTOO_CLASSPATH="eclipse-ecj-${ECJ_SLOT},tomcat-servlet-api-${SAPI_SLOT}"
242 +EANT_TEST_GENTOO_CLASSPATH="easymock-3.2"
243 +EANT_GENTOO_CLASSPATH_EXTRA="${S}/output/classes"
244 +EANT_NEEDS_TOOLS="true"
245 +EANT_EXTRA_ARGS="-Dversion=${PV}-gentoo -Dversion.number=${PV} -Dcompile.debug=false -Dexecute.validate=false"
246 +
247 +# revisions of the scripts
248 +IM_REV="-r2"
249 +INIT_REV="-r1"
250 +
251 +src_compile() {
252 + EANT_GENTOO_CLASSPATH_EXTRA+=":$(java-pkg_getjar --build-only ant-core ant.jar)"
253 + use doc && EANT_GENTOO_CLASSPATH_EXTRA+=":$(java-pkg_getjar --build-only glassfish-xmlrpc-api glassfish-xmlrpc-api.jar):$(java-pkg_getjar --build-only wsdl4j wsdl4j.jar)"
254 + LC_ALL=C java-pkg-2_src_compile
255 +}
256 +
257 +src_test() {
258 + java-pkg-2_src_test
259 +}
260 +
261 +src_install() {
262 + local dest="/usr/share/${PN}-${SLOT}"
263 +
264 + java-pkg_jarinto "${dest}"/bin
265 + java-pkg_dojar output/build/bin/*.jar
266 + exeinto "${dest}"/bin
267 + doexe output/build/bin/*.sh
268 +
269 + java-pkg_jarinto "${dest}"/lib
270 + java-pkg_dojar output/build/lib/*.jar
271 +
272 + dodoc RELEASE-NOTES RUNNING.txt
273 + use doc && java-pkg_dojavadoc output/dist/webapps/docs/api
274 + use source && java-pkg_dosrc java/*
275 +
276 + ### Webapps ###
277 +
278 + # add missing docBase
279 + local apps="host-manager manager"
280 + for app in ${apps}; do
281 + sed -i -e "s|=\"true\" >|=\"true\" docBase=\"\$\{catalina.home\}/webapps/${app}\" >|" \
282 + output/build/webapps/${app}/META-INF/context.xml || die
283 + done
284 +
285 + insinto "${dest}"/webapps
286 + doins -r output/build/webapps/{host-manager,manager,ROOT}
287 + use extra-webapps && doins -r output/build/webapps/{docs,examples}
288 +
289 + ### Config ###
290 +
291 + # create "logs" directory in $CATALINA_BASE
292 + # and set correct perms, see #458890
293 + dodir "${dest}"/logs
294 + fperms 0750 "${dest}"/logs
295 +
296 + # replace the default pw with a random one, see #92281
297 + local randpw="$(pwgen -s -B 15 1)"
298 + sed -i -e "s|SHUTDOWN|${randpw}|" output/build/conf/server.xml || die
299 +
300 + # prepend gentoo.classpath to common.loader, see #453212
301 + sed -i -e 's/^common\.loader=/\0${gentoo.classpath},/' output/build/conf/catalina.properties || die
302 +
303 + insinto "${dest}"
304 + doins -r output/build/conf
305 +
306 + ### rc ###
307 +
308 + cp "${FILESDIR}"/tomcat{.conf,${INIT_REV}.init,-instance-manager${IM_REV}.bash} "${T}" || die
309 + eprefixify "${T}"/tomcat{.conf,${INIT_REV}.init,-instance-manager${IM_REV}.bash}
310 + sed -i -e "s|@SLOT@|${SLOT}|g" "${T}"/tomcat{.conf,${INIT_REV}.init,-instance-manager${IM_REV}.bash} || die
311 +
312 + insinto "${dest}"/gentoo
313 + doins "${T}"/tomcat.conf
314 + exeinto "${dest}"/gentoo
315 + newexe "${T}"/tomcat${INIT_REV}.init tomcat.init
316 + newexe "${T}"/tomcat-instance-manager${IM_REV}.bash tomcat-instance-manager.bash
317 +}
318 +
319 +pkg_postinst() {
320 + elog "New ebuilds of Tomcat support running multiple instances. If you used prior version"
321 + elog "of Tomcat (<7.0.32), you have to migrate your existing instance to work with new Tomcat."
322 + elog "You can find more information at https://wiki.gentoo.org/wiki/Apache_Tomcat"
323 +
324 + elog "To manage Tomcat instances, run:"
325 + elog " ${EPREFIX}/usr/share/${PN}-${SLOT}/gentoo/tomcat-instance-manager.bash --help"
326 +
327 + ewarn "tomcat-dbcp.jar is not built at this time. Please fetch jar"
328 + ewarn "from upstream binary if you need it. Gentoo Bug # 144276"
329 +
330 + einfo "Please read https://wiki.gentoo.org/wiki/Apache_Tomcat and"
331 + einfo "https://wiki.gentoo.org/wiki/Project:Java/Tomcat_6_Guide for more information."
332 +}