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: Mon, 05 Jul 2021 15:09:15
Message-Id: 1625497749.dd00e9d391e2ecd6b8bc4dd1e9d72211c784de48.fordfrog@gentoo
1 commit: dd00e9d391e2ecd6b8bc4dd1e9d72211c784de48
2 Author: Miroslav Šulc <fordfrog <AT> gentoo <DOT> org>
3 AuthorDate: Mon Jul 5 15:09:01 2021 +0000
4 Commit: Miroslav Šulc <fordfrog <AT> gentoo <DOT> org>
5 CommitDate: Mon Jul 5 15:09:09 2021 +0000
6 URL: https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=dd00e9d3
7
8 www-servers/tomcat: bump to 10.0.8
9
10 Package-Manager: Portage-3.0.20, Repoman-3.0.3
11 Signed-off-by: Miroslav Šulc <fordfrog <AT> gentoo.org>
12
13 www-servers/tomcat/Manifest | 1 +
14 www-servers/tomcat/tomcat-10.0.8.ebuild | 192 ++++++++++++++++++++++++++++++++
15 2 files changed, 193 insertions(+)
16
17 diff --git a/www-servers/tomcat/Manifest b/www-servers/tomcat/Manifest
18 index 9d9b9d3ebd5..81d78c28d0f 100644
19 --- a/www-servers/tomcat/Manifest
20 +++ b/www-servers/tomcat/Manifest
21 @@ -1,5 +1,6 @@
22 DIST apache-tomcat-10.0.6-src.tar.gz 5987333 BLAKE2B b955d3708555c5530ebccaf9c6e8c344a679666bdd45361980d722d2cb48b618a03dc2514f973c182c2c1eaf96852e5a5eadad89575ee1bf524213211191a6a4 SHA512 229e8767b8f53f6b5c0e28f13a1daffd6fb8307a5239ae28ee1522087d881e4c9e3f1a0d39bfc852d5e54166dbb8a0a1577210a325845815c7281c4babc0b100
23 DIST apache-tomcat-10.0.7-src.tar.gz 6001147 BLAKE2B f1aee4748d404d02188369603824dcc97765e907cfc3872f54b1859ae950a9475d72862caa2179ac39e4cbdb8c23424f89c4cbbfff8a2e079a842b0054257009 SHA512 395b0280666c6779f6378cb87e9abdb637a823e7f89452b7324329f4c0a1fe0b315275dca5df2f80a38c6f1ef98541bd1ea762df7af9cb15e4466c3b89e4e7a8
24 +DIST apache-tomcat-10.0.8-src.tar.gz 6010420 BLAKE2B 86390f04147d3082fbc9f15704121cbd6aa8ba756b4bc03e64a49aae3dca96c6b503949da0096f8ddf143bdeb1320b7601008683ce94bdad9ef235e1f73ad948 SHA512 c264be4cb29d87c95918d2723ab20bc7e2cb5149cb366cca348c6cd311b0f38ac500ed6b4756b20245a446ead50e7208f77093d6081563ed76d6691abfcbe14c
25 DIST apache-tomcat-7.0.109-src.tar.gz 5314401 BLAKE2B 56583caea6879bf8ca5cc02a886de3d7af413032f88d367653e709dc1c8f590e78620c788317bbff4b6e65dd3e242cc26863164ac8e7c87334a22636f3ed0703 SHA512 ecf9c0bee0e3e1aa24f299fe633705c5a2f6aa264d9e4968cfc96aa5d0a425c2b0ff07765a8b6c67221766733bdfaed6e6c6377a8d0870d889e7063ce90a46ce
26 DIST apache-tomcat-8.5.66-src.tar.gz 5879748 BLAKE2B bfef20872bd19ffa2bb34b98a1da875fdd5f232e681458f0aef093b7eecd63a95c1cd26130f54251f149249e639d0da2577770e43314d2a86b8ee9b48b675f0d SHA512 322fda683197898f873feb375791092d33c90aac08a54889fabab0f59ecbc7b27784f027b37008c6893fdbf8ca7973b73268f42673d7e8df762419b5a536593b
27 DIST apache-tomcat-8.5.68-src.tar.gz 5907026 BLAKE2B 2312edb94f98ee98b594325fbc32521776e9cadc4422a3a46f3651f1fee072a99c5f6874378ac06215396504d34ad750edd6ec3399a3931554068195a8ee15ef SHA512 579a35f944ead756995d288b66ea8a4ab30289a90c32aa01119abcea85a8524f6594ce5cb7ac9df6d352c1e3b54a18c814b5d3a6409dce6a43614e3a89284066
28
29 diff --git a/www-servers/tomcat/tomcat-10.0.8.ebuild b/www-servers/tomcat/tomcat-10.0.8.ebuild
30 new file mode 100644
31 index 00000000000..0b16b403fb0
32 --- /dev/null
33 +++ b/www-servers/tomcat/tomcat-10.0.8.ebuild
34 @@ -0,0 +1,192 @@
35 +# Copyright 1999-2021 Gentoo Authors
36 +# Distributed under the terms of the GNU General Public License v2
37 +
38 +EAPI=7
39 +
40 +JAVA_PKG_IUSE="doc source test"
41 +
42 +inherit java-pkg-2 java-ant-2 prefix
43 +
44 +MY_P="apache-${PN}-${PV}-src"
45 +
46 +# Currently we bundle binary versions of bnd.jar and bndlib.jar
47 +# See bugs #203080 and #676116
48 +BND_VERSION="5.1.1"
49 +BND="biz.aQute.bnd-${BND_VERSION}.jar"
50 +BNDLIB="biz.aQute.bndlib-${BND_VERSION}.jar"
51 +
52 +DESCRIPTION="Tomcat Servlet-5.0/JSP-3.0/EL-4.0/WebSocket-2.0/JASIC-2.0 Container"
53 +HOMEPAGE="https://tomcat.apache.org/"
54 +SRC_URI="mirror://apache/${PN}/tomcat-9/v${PV}/src/${MY_P}.tar.gz
55 + https://repo.maven.apache.org/maven2/biz/aQute/bnd/biz.aQute.bnd/${BND_VERSION}/${BND}
56 + https://repo.maven.apache.org/maven2/biz/aQute/bnd/biz.aQute.bndlib/${BND_VERSION}/${BNDLIB}"
57 +
58 +LICENSE="Apache-2.0"
59 +SLOT="10"
60 +KEYWORDS="~amd64 ~amd64-linux"
61 +IUSE="extra-webapps"
62 +
63 +RESTRICT="test" # can we run them on a production system?
64 +
65 +ECJ_SLOT="4.15"
66 +SAPI_SLOT="5.0"
67 +
68 +COMMON_DEP="dev-java/eclipse-ecj:${ECJ_SLOT}
69 + dev-java/glassfish-xmlrpc-api:0
70 + dev-java/jakartaee-migration:0
71 + ~dev-java/tomcat-servlet-api-${PV}:${SAPI_SLOT}
72 + dev-java/wsdl4j:0"
73 +RDEPEND="${COMMON_DEP}
74 + acct-group/tomcat
75 + acct-user/tomcat
76 + virtual/jre"
77 +DEPEND="${COMMON_DEP}
78 + app-admin/pwgen
79 + dev-java/ant-core
80 + virtual/jdk:1.8
81 + test? (
82 + dev-java/ant-junit:0
83 + dev-java/easymock:3.2
84 + )"
85 +
86 +S=${WORKDIR}/${MY_P}
87 +
88 +PATCHES=(
89 + "${FILESDIR}/${PN}-9.0.50-insufficient-ecj.patch"
90 +)
91 +
92 +BND_HOME="${S}/tomcat-build-libs/bnd"
93 +BNDLIB_HOME="${S}/tomcat-build-libs/bndlib"
94 +BND_JAR="${BND_HOME}/${BND}"
95 +BNDLIB_JAR="${BNDLIB_HOME}/${BND_LIB}"
96 +
97 +src_unpack() {
98 + unpack ${MY_P}.tar.gz
99 +
100 + mkdir -p "${BND_HOME}" "${BNDLIB_HOME}" || die "Failed to create dir"
101 + ln -s "${DISTDIR}/${BND}" "${BND_HOME}/" || die "Failed to symlink bnd-*.jar"
102 + ln -s "${DISTDIR}/${BND}" "${BNDLIB_HOME}/" || die "Failed to symlink bndlib-*.jar"
103 +}
104 +
105 +src_prepare() {
106 + default
107 +
108 + find -name '*.jar' -type f -delete -print || die
109 +
110 + # Remove bundled servlet-api
111 + rm -rv java/jakarta/{el,servlet} || die
112 +
113 + eapply "${FILESDIR}/${PN}-10.0.4-build.xml.patch"
114 +
115 + # For use of catalina.sh in netbeans
116 + sed -i -e "/^# ----- Execute The Requested Command/ a\
117 + CLASSPATH=\`java-config --with-dependencies --classpath ${PN}-${SLOT}\`" \
118 + bin/catalina.sh || die
119 +
120 + java-pkg-2_src_prepare
121 +}
122 +
123 +JAVA_ANT_REWRITE_CLASSPATH="true"
124 +
125 +EANT_BUILD_TARGET="deploy"
126 +EANT_GENTOO_CLASSPATH="eclipse-ecj-${ECJ_SLOT},jakartaee-migration,tomcat-servlet-api-${SAPI_SLOT},wsdl4j"
127 +EANT_TEST_GENTOO_CLASSPATH="easymock-3.2"
128 +EANT_GENTOO_CLASSPATH_EXTRA="${S}/output/classes"
129 +EANT_NEEDS_TOOLS="true"
130 +EANT_EXTRA_ARGS="-Dversion=${PV}-gentoo -Dversion.number=${PV} -Dcompile.debug=false -Dbnd.jar=${BND_JAR} -Dbndlib.jar=${BNDLIB_JAR}"
131 +
132 +# revisions of the scripts
133 +IM_REV="-r2"
134 +INIT_REV="-r1"
135 +
136 +src_configure() {
137 + java-ant-2_src_configure
138 +
139 + eapply "${FILESDIR}/${PN}-9.0.37-fix-build-rewrite.patch"
140 +}
141 +
142 +src_compile() {
143 + EANT_GENTOO_CLASSPATH_EXTRA+=":$(java-pkg_getjar --build-only ant-core ant.jar):$(java-pkg_getjars --build-only glassfish-xmlrpc-api)"
144 + LC_ALL=C java-pkg-2_src_compile
145 +}
146 +
147 +src_test() {
148 + java-pkg-2_src_test
149 +}
150 +
151 +src_install() {
152 + local dest="/usr/share/${PN}-${SLOT}"
153 +
154 + java-pkg_jarinto "${dest}"/bin
155 + java-pkg_dojar output/build/bin/*.jar
156 + exeinto "${dest}"/bin
157 + doexe output/build/bin/*.sh
158 +
159 + java-pkg_jarinto "${dest}"/lib
160 + java-pkg_dojar output/build/lib/*.jar
161 +
162 + dodoc RELEASE-NOTES RUNNING.txt
163 + use doc && java-pkg_dojavadoc output/dist/webapps/docs/api
164 + use source && java-pkg_dosrc java/*
165 +
166 + ### Webapps ###
167 +
168 + # add missing docBase
169 + local apps="host-manager manager"
170 + for app in ${apps}; do
171 + sed -i -e "s|=\"true\" >|=\"true\" docBase=\"\$\{catalina.home\}/webapps/${app}\" >|" \
172 + output/build/webapps/${app}/META-INF/context.xml || die
173 + done
174 +
175 + insinto "${dest}"/webapps
176 + doins -r output/build/webapps/{host-manager,manager,ROOT}
177 + use extra-webapps && doins -r output/build/webapps/{docs,examples}
178 +
179 + ### Config ###
180 +
181 + # create "logs" directory in $CATALINA_BASE
182 + # and set correct perms, see #458890
183 + dodir "${dest}"/logs
184 + fperms 0750 "${dest}"/logs
185 +
186 + # replace the default pw with a random one, see #92281
187 + local randpw="$(pwgen -s -B 15 1)"
188 + sed -i -e "s|SHUTDOWN|${randpw}|" output/build/conf/server.xml || die
189 +
190 + # prepend gentoo.classpath to common.loader, see #453212
191 + sed -i -e 's/^common\.loader=/\0${gentoo.classpath},/' output/build/conf/catalina.properties || die
192 +
193 + insinto "${dest}"
194 + doins -r output/build/conf
195 +
196 + ### rc ###
197 +
198 + cp "${FILESDIR}"/tomcat{.conf,${INIT_REV}.init,-instance-manager${IM_REV}.bash} "${T}" || die
199 + eprefixify "${T}"/tomcat{.conf,${INIT_REV}.init,-instance-manager${IM_REV}.bash}
200 + sed -i -e "s|@SLOT@|${SLOT}|g" "${T}"/tomcat{.conf,${INIT_REV}.init,-instance-manager${IM_REV}.bash} || die
201 +
202 + insinto "${dest}"/gentoo
203 + doins "${T}"/tomcat.conf
204 + exeinto "${dest}"/gentoo
205 + newexe "${T}"/tomcat${INIT_REV}.init tomcat.init
206 + newexe "${T}"/tomcat-instance-manager${IM_REV}.bash tomcat-instance-manager.bash
207 +}
208 +
209 +pkg_postinst() {
210 + elog "New ebuilds of Tomcat support running multiple instances. If you used prior version"
211 + elog "of Tomcat (<7.0.32), you have to migrate your existing instance to work with new Tomcat."
212 + elog "You can find more information at https://wiki.gentoo.org/wiki/Apache_Tomcat"
213 +
214 + elog "To manage Tomcat instances, run:"
215 + elog " ${EPREFIX}/usr/share/${PN}-${SLOT}/gentoo/tomcat-instance-manager.bash --help"
216 +
217 + ewarn "Please note that since version 10 the primary package for all implemented APIs"
218 + ewarn "has changed from javax.* to jakarta.*. This will almost certainly require code"
219 + ewarn "changes to enable applications to migrate from Tomcat 9 and earlier to Tomcat 10 and later."
220 +
221 + ewarn "tomcat-dbcp.jar is not built at this time. Please fetch jar"
222 + ewarn "from upstream binary if you need it. Gentoo Bug # 144276"
223 +
224 + einfo "Please read https://wiki.gentoo.org/wiki/Apache_Tomcat and"
225 + einfo "https://wiki.gentoo.org/wiki/Project:Java/Tomcat_6_Guide for more information."
226 +}