Gentoo Archives: gentoo-commits

From: "Miroslav Sulc (fordfrog)" <fordfrog@g.o>
To: gentoo-commits@l.g.o
Subject: [gentoo-commits] gentoo-x86 commit in www-servers/tomcat: ChangeLog tomcat-6.0.26-r2.ebuild tomcat-6.0.28-r1.ebuild tomcat-6.0.29-r1.ebuild tomcat-7.0.5-r1.ebuild tomcat-6.0.26-r1.ebuild tomcat-6.0.29.ebuild tomcat-7.0.5.ebuild tomcat-6.0.28.ebuild
Date: Tue, 18 Jan 2011 18:02:32
Message-Id: 20110118180220.7034320054@flycatcher.gentoo.org
1 fordfrog 11/01/18 18:02:20
2
3 Modified: ChangeLog
4 Added: tomcat-6.0.26-r2.ebuild tomcat-6.0.28-r1.ebuild
5 tomcat-6.0.29-r1.ebuild tomcat-7.0.5-r1.ebuild
6 Removed: tomcat-6.0.26-r1.ebuild tomcat-6.0.29.ebuild
7 tomcat-7.0.5.ebuild tomcat-6.0.28.ebuild
8 Log:
9 www-servers/tomcat: fixed bug #350645
10
11 (Portage version: 2.1.9.33/cvs/Linux x86_64)
12
13 Revision Changes Path
14 1.235 www-servers/tomcat/ChangeLog
15
16 file : http://sources.gentoo.org/viewvc.cgi/gentoo-x86/www-servers/tomcat/ChangeLog?rev=1.235&view=markup
17 plain: http://sources.gentoo.org/viewvc.cgi/gentoo-x86/www-servers/tomcat/ChangeLog?rev=1.235&content-type=text/plain
18 diff : http://sources.gentoo.org/viewvc.cgi/gentoo-x86/www-servers/tomcat/ChangeLog?r1=1.234&r2=1.235
19
20 Index: ChangeLog
21 ===================================================================
22 RCS file: /var/cvsroot/gentoo-x86/www-servers/tomcat/ChangeLog,v
23 retrieving revision 1.234
24 retrieving revision 1.235
25 diff -u -r1.234 -r1.235
26 --- ChangeLog 21 Dec 2010 09:13:39 -0000 1.234
27 +++ ChangeLog 18 Jan 2011 18:02:20 -0000 1.235
28 @@ -1,6 +1,18 @@
29 # ChangeLog for www-servers/tomcat
30 -# Copyright 1999-2010 Gentoo Foundation; Distributed under the GPL v2
31 -# $Header: /var/cvsroot/gentoo-x86/www-servers/tomcat/ChangeLog,v 1.234 2010/12/21 09:13:39 ali_bush Exp $
32 +# Copyright 1999-2011 Gentoo Foundation; Distributed under the GPL v2
33 +# $Header: /var/cvsroot/gentoo-x86/www-servers/tomcat/ChangeLog,v 1.235 2011/01/18 18:02:20 fordfrog Exp $
34 +
35 +*tomcat-7.0.5-r1 (18 Jan 2011)
36 +*tomcat-6.0.29-r1 (18 Jan 2011)
37 +*tomcat-6.0.28-r1 (18 Jan 2011)
38 +*tomcat-6.0.26-r2 (18 Jan 2011)
39 +
40 + 18 Jan 2011; Miroslav Šulc <fordfrog@g.o> -tomcat-6.0.26-r1.ebuild,
41 + +tomcat-6.0.26-r2.ebuild, -tomcat-6.0.28.ebuild, +tomcat-6.0.28-r1.ebuild,
42 + -tomcat-6.0.29.ebuild, +tomcat-6.0.29-r1.ebuild, -tomcat-7.0.5.ebuild,
43 + +tomcat-7.0.5-r1.ebuild:
44 + Fixed bug #350645 in all versions except 5.5.27 where it does not seem to
45 + occur, thanks to gentoo@××××××××.cx pointing it out and for the fix
46
47 *tomcat-7.0.5 (21 Dec 2010)
48
49
50
51
52 1.1 www-servers/tomcat/tomcat-6.0.26-r2.ebuild
53
54 file : http://sources.gentoo.org/viewvc.cgi/gentoo-x86/www-servers/tomcat/tomcat-6.0.26-r2.ebuild?rev=1.1&view=markup
55 plain: http://sources.gentoo.org/viewvc.cgi/gentoo-x86/www-servers/tomcat/tomcat-6.0.26-r2.ebuild?rev=1.1&content-type=text/plain
56
57 Index: tomcat-6.0.26-r2.ebuild
58 ===================================================================
59 # Copyright 1999-2011 Gentoo Foundation
60 # Distributed under the terms of the GNU General Public License v2
61 # $Header: /var/cvsroot/gentoo-x86/www-servers/tomcat/tomcat-6.0.26-r2.ebuild,v 1.1 2011/01/18 18:02:20 fordfrog Exp $
62
63 EAPI=2
64 JAVA_PKG_IUSE="doc examples source test"
65 WANT_ANT_TASKS="ant-trax"
66
67 inherit eutils java-pkg-2 java-ant-2
68
69 DESCRIPTION="Tomcat Servlet-2.5/JSP-2.1 Container"
70
71 MY_P="apache-${P}-src"
72 SLOT="6"
73 SRC_URI="mirror://apache/${PN}/${PN}-6/v${PV/_/-}/src/${MY_P}.tar.gz"
74 HOMEPAGE="http://tomcat.apache.org/"
75 KEYWORDS="~amd64 ~ppc ~ppc64 ~x86 ~x86-fbsd"
76 LICENSE="Apache-2.0"
77
78 IUSE=""
79
80 COMMON_DEPEND="dev-java/eclipse-ecj:3.3
81 dev-java/ant-eclipse-ecj:3.3
82 >=dev-java/commons-dbcp-1.2.1
83 >=dev-java/commons-logging-1.1
84 >=dev-java/commons-pool-1.2
85 ~dev-java/tomcat-servlet-api-${PV}
86 examples? ( dev-java/jakarta-jstl )"
87
88 RDEPEND=">=virtual/jre-1.5
89 >=dev-java/commons-daemon-1.0.1
90 dev-java/ant-core
91 ${COMMON_DEPEND}"
92
93 DEPEND=">=virtual/jdk-1.5
94 ${COMMON_DEPEND}
95 test? ( =dev-java/junit-3.8* )"
96
97 S=${WORKDIR}/${MY_P}
98
99 TOMCAT_NAME="${PN}-${SLOT}"
100 TOMCAT_HOME="/usr/share/${TOMCAT_NAME}"
101 WEBAPPS_DIR="/var/lib/${TOMCAT_NAME}/webapps"
102
103 # TODO: Fails to find PrettyPrint in with python 2.6 and xml-rewriter-3
104 # Find out why so
105 JAVA_ANT_CELEMENT_REWRITER="true"
106 JAVA_ANT_REWRITE_CLASSPATH="true"
107
108 EANT_NEEDS_TOOLS="true"
109 EANT_GENTOO_CLASSPATH="tomcat-servlet-api-2.5,eclipse-ecj-3.3"
110
111 EANT_BUILD_TARGET="build-only build-jasper-jdt"
112 EANT_DOC_TARGET="build-docs"
113
114 EANT_EXTRA_ARGS="-Dbase.path=${T} -Dversion=${PV} -Dversion.number=${PV}
115 -Dcompile.debug=false -Djsp-api.jar=jsp-api.jar -Dservlet-api.jar=servlet-api.jar
116 -Dant.jar=ant.jar"
117
118 pkg_setup() {
119 java-pkg-2_pkg_setup
120 enewgroup tomcat 265
121 enewuser tomcat 265 -1 /dev/null tomcat
122 }
123
124 java_prepare() {
125 rm -v webapps/examples/WEB-INF/lib/*.jar || die
126
127 # bug # 178980 and #312293
128 if use amd64; then
129 java-pkg_force-compiler ecj-3.3
130 fi
131
132 if ! use doc; then
133 EANT_EXTRA_ARGS+=" -Dnobuild.docs=true"
134 fi
135
136 EANT_EXTRA_ARGS+=" -Djdt.jar=$(java-pkg_getjar eclipse-ecj-3.3 ecj.jar)"
137 java-pkg_jarfrom --build-only ant-core ant.jar
138 }
139
140 src_install() {
141 cd "${S}/bin"
142 rm -f *.bat
143 chmod 755 *.sh
144
145 # register jars per bug #171496
146 cd "${S}/output/build/lib/"
147 for jar in *.jar; do
148 java-pkg_dojar ${jar}
149 done
150
151 local CATALINA_BASE=/var/lib/${TOMCAT_NAME}/
152
153 # init.d, conf.d
154 newinitd "${FILESDIR}"/${SLOT}/tomcat.init.2 ${TOMCAT_NAME}
155 newconfd "${FILESDIR}"/${SLOT}/tomcat.conf ${TOMCAT_NAME}
156
157 # create dir structure
158 dodir /usr/share/${TOMCAT_NAME}
159
160 diropts -m750 -o tomcat -g tomcat
161 dodir /etc/${TOMCAT_NAME}
162 keepdir ${WEBAPPS_DIR}
163
164 diropts -m755 -o tomcat -g tomcat
165 dodir ${CATALINA_BASE}
166
167 diropts -m775 -o tomcat -g tomcat
168 dodir /etc/${TOMCAT_NAME}/Catalina/localhost
169 keepdir /var/log/${TOMCAT_NAME}/
170 keepdir /var/run/${TOMCAT_NAME}/
171 keepdir /var/tmp/${TOMCAT_NAME}/
172
173 cd "${S}"
174 # fix context's so webapps will be deployed
175 sed -i -e 's:Context a:Context docBase="${catalina.home}/webapps/host-manager" a:' "${S}"/webapps/host-manager/META-INF/context.xml
176 sed -i -e 's:Context a:Context docBase="${catalina.home}/webapps/manager" a:' "${S}"/webapps/manager/META-INF/context.xml
177
178 # replace the default pw with a random one, see #92281
179 local randpw=$(echo ${RANDOM}|md5sum|cut -c 1-15)
180 sed -e s:SHUTDOWN:${randpw}: -i conf/server.xml
181
182 # copy over the directories
183 chown -R tomcat:tomcat webapps/* conf/*
184 cp -pR conf/* "${D}"/etc/${TOMCAT_NAME} || die "failed to copy conf"
185 cp -pPR output/build/bin "${D}"/usr/share/${TOMCAT_NAME} \
186 || die "failed to copy"
187 # webapps get stored in /usr/share/${TOMCAT_NAME}/webapps
188 cd "${S}"/webapps || die
189 ebegin "Installing webapps to /usr/share/${TOMCAT_NAME}"
190
191 dodir /usr/share/${TOMCAT_NAME}/webapps
192 cp -pR ROOT "${D}"/usr/share/${TOMCAT_NAME}/webapps || die
193 cp -pR host-manager "${D}"/usr/share/${TOMCAT_NAME}/webapps || die
194 cp -pR manager "${D}"/usr/share/${TOMCAT_NAME}/webapps || die
195 if use doc; then
196 cp -pR docs "${D}"/usr/share/${TOMCAT_NAME}/webapps || die
197 fi
198 if use examples; then
199 cd "${S}"/webapps/examples/WEB-INF/lib
200 java-pkg_jar-from jakarta-jstl jstl.jar
201 java-pkg_jar-from jakarta-jstl standard.jar
202 cd "${S}"/webapps
203 cp -pR examples "${D}"/usr/share/${TOMCAT_NAME}/webapps || die
204 fi
205
206 # replace catalina.policy with gentoo specific one bug #176701
207 # cp ${FILESDIR}/${SLOT}/catalina.policy "${D}"/etc/${TOMCAT_NAME} \
208 # || die "failed to replace catalina.policy"
209
210 cp "${T}"/tomcat6-deps/jdt/jasper-jdt.jar "${D}"/usr/share/${TOMCAT_NAME}/lib \
211 || die "failed to copy"
212
213 cd "${D}/usr/share/${TOMCAT_NAME}/lib" || die
214 java-pkg_jar-from tomcat-servlet-api-2.5
215
216 # symlink the directories to make CATALINA_BASE possible
217 dosym /etc/${TOMCAT_NAME} ${CATALINA_BASE}/conf
218 dosym /var/log/${TOMCAT_NAME} ${CATALINA_BASE}/logs
219 dosym /var/tmp/${TOMCAT_NAME} ${CATALINA_BASE}/temp
220 dosym /var/run/${TOMCAT_NAME} ${CATALINA_BASE}/work
221
222 dodoc "${S}"/{RELEASE-NOTES,RUNNING.txt}
223 fperms 640 /etc/${TOMCAT_NAME}/tomcat-users.xml
224
225 #install *.sh scripts bug #278059
226 exeinto /usr/share/${TOMCAT_NAME}/bin
227 doexe "${S}"/bin/*.sh
228 }
229
230 pkg_postinst() {
231 ewarn "Changing ownership recursively on /etc/${TOMCAT_NAME}"
232 # temp fix for bug #176097
233 chown -fR tomcat:tomcat /etc/${TOMCAT_NAME}
234 ewarn "Owner ship changed to tomcat:tomcat. Temp hack/fix."
235
236 # bug #180519
237 if [[ -e "${ROOT}var/lib/${TOMCAT_NAME}/webapps/manager" ]] ; then
238 elog "The latest webapp has NOT been installed into"
239 elog "${ROOT}var/lib/${TOMCAT_NAME}/webapps/ because directory already exists"
240 elog "and we do not want to overwrite any files you have put there."
241 elog
242 elog "Installing latest webapp into"
243 elog "${ROOT}usr/share/${TOMCAT_NAME}/webapps instead"
244 elog
245 elog "Manager Symbolic Links NOT created."
246
247 else
248 einfo "Installing latest webroot to ${ROOT}/${WEBAPPS_DIR}"
249 cp -pR "${ROOT}"/usr/share/${TOMCAT_NAME}/webapps/* \
250 "${ROOT}""${WEBAPPS_DIR}"
251 # link the manager's context to the right position
252 dosym ${TOMCAT_HOME}/webapps/host-manager/META-INF/context.xml /etc/${TOMCAT_NAME}/Catalina/localhost/host-manager.xml
253 dosym ${TOMCAT_HOME}/webapps/manager/META-INF/context.xml /etc/${TOMCAT_NAME}/Catalina/localhost/manager.xml
254 fi
255
256 elog
257 elog " This ebuild implements a FHS compliant layout for tomcat"
258 elog " Please read http://www.gentoo.org/proj/en/java/tomcat6-guide.xml"
259 elog " for more information."
260 elog
261 ewarn "tomcat-dbcp.jar is not built at this time. Please fetch jar"
262 ewarn "from upstream binary if you need it. Gentoo Bug # 144276"
263 elog
264
265 ewarn "The manager webapps have known exploits, please refer to"
266 ewarn "http://cve.mitre.org/cgi-bin/cvename.cgi?name=2007-2450"
267
268 if use examples ; then
269 ewarn
270 ewarn "The examples webapp has a known exploit, please refer to"
271 ewarn "http://cve.mitre.org/cgi-bin/cvename.cgi?name=2007-2449"
272 ewarn
273 fi
274
275 elog
276 elog " Please report any bugs to http://bugs.gentoo.org/"
277 elog
278 }
279
280
281
282 1.1 www-servers/tomcat/tomcat-6.0.28-r1.ebuild
283
284 file : http://sources.gentoo.org/viewvc.cgi/gentoo-x86/www-servers/tomcat/tomcat-6.0.28-r1.ebuild?rev=1.1&view=markup
285 plain: http://sources.gentoo.org/viewvc.cgi/gentoo-x86/www-servers/tomcat/tomcat-6.0.28-r1.ebuild?rev=1.1&content-type=text/plain
286
287 Index: tomcat-6.0.28-r1.ebuild
288 ===================================================================
289 # Copyright 1999-2011 Gentoo Foundation
290 # Distributed under the terms of the GNU General Public License v2
291 # $Header: /var/cvsroot/gentoo-x86/www-servers/tomcat/tomcat-6.0.28-r1.ebuild,v 1.1 2011/01/18 18:02:20 fordfrog Exp $
292
293 EAPI=2
294 JAVA_PKG_IUSE="doc examples source test"
295 WANT_ANT_TASKS="ant-trax"
296
297 inherit eutils java-pkg-2 java-ant-2
298
299 DESCRIPTION="Tomcat Servlet-2.5/JSP-2.1 Container"
300
301 MY_P="apache-${P}-src"
302 SLOT="6"
303 SRC_URI="mirror://apache/${PN}/${PN}-6/v${PV/_/-}/src/${MY_P}.tar.gz"
304 HOMEPAGE="http://tomcat.apache.org/"
305 KEYWORDS="~amd64 ~ppc ~ppc64 ~x86 ~x86-fbsd"
306 LICENSE="Apache-2.0"
307
308 IUSE=""
309
310 COMMON_DEPEND="dev-java/eclipse-ecj:3.3
311 dev-java/ant-eclipse-ecj:3.3
312 >=dev-java/commons-dbcp-1.2.1
313 >=dev-java/commons-logging-1.1
314 >=dev-java/commons-pool-1.2
315 ~dev-java/tomcat-servlet-api-${PV}
316 examples? ( dev-java/jakarta-jstl )"
317
318 RDEPEND="
319 !<dev-java/tomcat-native-1.1.20
320 >=virtual/jre-1.5
321 >=dev-java/commons-daemon-1.0.1
322 dev-java/ant-core
323 ${COMMON_DEPEND}"
324
325 DEPEND=">=virtual/jdk-1.5
326 ${COMMON_DEPEND}
327 test? ( =dev-java/junit-3.8* )"
328
329 S=${WORKDIR}/${MY_P}
330
331 TOMCAT_NAME="${PN}-${SLOT}"
332 TOMCAT_HOME="/usr/share/${TOMCAT_NAME}"
333 WEBAPPS_DIR="/var/lib/${TOMCAT_NAME}/webapps"
334
335 # TODO: Fails to find PrettyPrint in with python 2.6 and xml-rewriter-3
336 # Find out why so
337 JAVA_ANT_CELEMENT_REWRITER="true"
338 JAVA_ANT_REWRITE_CLASSPATH="true"
339
340 EANT_NEEDS_TOOLS="true"
341 EANT_GENTOO_CLASSPATH="tomcat-servlet-api-2.5,eclipse-ecj-3.3"
342
343 EANT_BUILD_TARGET="build-only build-jasper-jdt"
344 EANT_DOC_TARGET="build-docs"
345
346 EANT_EXTRA_ARGS="-Dbase.path=${T} -Dversion=${PV} -Dversion.number=${PV}
347 -Dcompile.debug=false -Djsp-api.jar=jsp-api.jar -Dservlet-api.jar=servlet-api.jar
348 -Dant.jar=ant.jar"
349
350 pkg_setup() {
351 java-pkg-2_pkg_setup
352 enewgroup tomcat 265
353 enewuser tomcat 265 -1 /dev/null tomcat
354 }
355
356 java_prepare() {
357 rm -v webapps/examples/WEB-INF/lib/*.jar || die
358
359 # bug # 178980 and #312293
360 if use amd64; then
361 java-pkg_force-compiler ecj-3.3
362 fi
363
364 if ! use doc; then
365 EANT_EXTRA_ARGS+=" -Dnobuild.docs=true"
366 fi
367
368 EANT_EXTRA_ARGS+=" -Djdt.jar=$(java-pkg_getjar eclipse-ecj-3.3 ecj.jar)"
369 java-pkg_jarfrom --build-only ant-core ant.jar
370 }
371
372 src_install() {
373 cd "${S}/bin"
374 rm -f *.bat
375 chmod 755 *.sh
376
377 # register jars per bug #171496
378 cd "${S}/output/build/lib/"
379 for jar in *.jar; do
380 java-pkg_dojar ${jar}
381 done
382
383 local CATALINA_BASE=/var/lib/${TOMCAT_NAME}/
384
385 # init.d, conf.d
386 newinitd "${FILESDIR}"/${SLOT}/tomcat.init.2 ${TOMCAT_NAME}
387 newconfd "${FILESDIR}"/${SLOT}/tomcat.conf ${TOMCAT_NAME}
388
389 # create dir structure
390 dodir /usr/share/${TOMCAT_NAME}
391
392 diropts -m750 -o tomcat -g tomcat
393 dodir /etc/${TOMCAT_NAME}
394 keepdir ${WEBAPPS_DIR}
395
396 diropts -m755 -o tomcat -g tomcat
397 dodir ${CATALINA_BASE}
398
399 diropts -m775 -o tomcat -g tomcat
400 dodir /etc/${TOMCAT_NAME}/Catalina/localhost
401 keepdir /var/log/${TOMCAT_NAME}/
402 keepdir /var/run/${TOMCAT_NAME}/
403 keepdir /var/tmp/${TOMCAT_NAME}/
404
405 cd "${S}"
406 # fix context's so webapps will be deployed
407 sed -i -e 's:Context a:Context docBase="${catalina.home}/webapps/host-manager" a:' "${S}"/webapps/host-manager/META-INF/context.xml
408 sed -i -e 's:Context a:Context docBase="${catalina.home}/webapps/manager" a:' "${S}"/webapps/manager/META-INF/context.xml
409
410 # replace the default pw with a random one, see #92281
411 local randpw=$(echo ${RANDOM}|md5sum|cut -c 1-15)
412 sed -e s:SHUTDOWN:${randpw}: -i conf/server.xml
413
414 # copy over the directories
415 chown -R tomcat:tomcat webapps/* conf/*
416 cp -pR conf/* "${D}"/etc/${TOMCAT_NAME} || die "failed to copy conf"
417 cp -pPR output/build/bin "${D}"/usr/share/${TOMCAT_NAME} \
418 || die "failed to copy"
419 # webapps get stored in /usr/share/${TOMCAT_NAME}/webapps
420 cd "${S}"/webapps || die
421 ebegin "Installing webapps to /usr/share/${TOMCAT_NAME}"
422
423 dodir /usr/share/${TOMCAT_NAME}/webapps
424 cp -pR ROOT "${D}"/usr/share/${TOMCAT_NAME}/webapps || die
425 cp -pR host-manager "${D}"/usr/share/${TOMCAT_NAME}/webapps || die
426 cp -pR manager "${D}"/usr/share/${TOMCAT_NAME}/webapps || die
427 if use doc; then
428 cp -pR docs "${D}"/usr/share/${TOMCAT_NAME}/webapps || die
429 fi
430 if use examples; then
431 cd "${S}"/webapps/examples/WEB-INF/lib
432 java-pkg_jar-from jakarta-jstl jstl.jar
433 java-pkg_jar-from jakarta-jstl standard.jar
434 cd "${S}"/webapps
435 cp -pR examples "${D}"/usr/share/${TOMCAT_NAME}/webapps || die
436 fi
437
438 # replace catalina.policy with gentoo specific one bug #176701
439 # cp ${FILESDIR}/${SLOT}/catalina.policy "${D}"/etc/${TOMCAT_NAME} \
440 # || die "failed to replace catalina.policy"
441
442 cp "${T}"/tomcat6-deps/jdt/jasper-jdt.jar "${D}"/usr/share/${TOMCAT_NAME}/lib \
443 || die "failed to copy"
444
445 cd "${D}/usr/share/${TOMCAT_NAME}/lib" || die
446 java-pkg_jar-from tomcat-servlet-api-2.5
447
448 # symlink the directories to make CATALINA_BASE possible
449 dosym /etc/${TOMCAT_NAME} ${CATALINA_BASE}/conf
450 dosym /var/log/${TOMCAT_NAME} ${CATALINA_BASE}/logs
451 dosym /var/tmp/${TOMCAT_NAME} ${CATALINA_BASE}/temp
452 dosym /var/run/${TOMCAT_NAME} ${CATALINA_BASE}/work
453
454 dodoc "${S}"/{RELEASE-NOTES,RUNNING.txt}
455 fperms 640 /etc/${TOMCAT_NAME}/tomcat-users.xml
456
457 #install *.sh scripts bug #278059
458 exeinto /usr/share/${TOMCAT_NAME}/bin
459 doexe "${S}"/bin/*.sh
460 }
461
462 pkg_postinst() {
463 ewarn "Changing ownership recursively on /etc/${TOMCAT_NAME}"
464 # temp fix for bug #176097
465 chown -fR tomcat:tomcat /etc/${TOMCAT_NAME}
466 ewarn "Owner ship changed to tomcat:tomcat. Temp hack/fix."
467
468 # bug #180519
469 if [[ -e "${ROOT}var/lib/${TOMCAT_NAME}/webapps/manager" ]] ; then
470 elog "The latest webapp has NOT been installed into"
471 elog "${ROOT}var/lib/${TOMCAT_NAME}/webapps/ because directory already exists"
472 elog "and we do not want to overwrite any files you have put there."
473 elog
474 elog "Installing latest webapp into"
475 elog "${ROOT}usr/share/${TOMCAT_NAME}/webapps instead"
476 elog
477 elog "Manager Symbolic Links NOT created."
478
479 else
480 einfo "Installing latest webroot to ${ROOT}/${WEBAPPS_DIR}"
481 cp -pR "${ROOT}"/usr/share/${TOMCAT_NAME}/webapps/* \
482 "${ROOT}""${WEBAPPS_DIR}"
483 # link the manager's context to the right position
484 dosym ${TOMCAT_HOME}/webapps/host-manager/META-INF/context.xml /etc/${TOMCAT_NAME}/Catalina/localhost/host-manager.xml
485 dosym ${TOMCAT_HOME}/webapps/manager/META-INF/context.xml /etc/${TOMCAT_NAME}/Catalina/localhost/manager.xml
486 fi
487
488 elog
489 elog " This ebuild implements a FHS compliant layout for tomcat"
490 elog " Please read http://www.gentoo.org/proj/en/java/tomcat6-guide.xml"
491 elog " for more information."
492 elog
493 ewarn "tomcat-dbcp.jar is not built at this time. Please fetch jar"
494 ewarn "from upstream binary if you need it. Gentoo Bug # 144276"
495 elog
496
497 ewarn "The manager webapps have known exploits, please refer to"
498 ewarn "http://cve.mitre.org/cgi-bin/cvename.cgi?name=2007-2450"
499
500 if use examples ; then
501 ewarn
502 ewarn "The examples webapp has a known exploit, please refer to"
503 ewarn "http://cve.mitre.org/cgi-bin/cvename.cgi?name=2007-2449"
504 ewarn
505 fi
506
507 elog
508 elog " Please report any bugs to http://bugs.gentoo.org/"
509 elog
510 }
511
512
513
514 1.1 www-servers/tomcat/tomcat-6.0.29-r1.ebuild
515
516 file : http://sources.gentoo.org/viewvc.cgi/gentoo-x86/www-servers/tomcat/tomcat-6.0.29-r1.ebuild?rev=1.1&view=markup
517 plain: http://sources.gentoo.org/viewvc.cgi/gentoo-x86/www-servers/tomcat/tomcat-6.0.29-r1.ebuild?rev=1.1&content-type=text/plain
518
519 Index: tomcat-6.0.29-r1.ebuild
520 ===================================================================
521 # Copyright 1999-2011 Gentoo Foundation
522 # Distributed under the terms of the GNU General Public License v2
523 # $Header: /var/cvsroot/gentoo-x86/www-servers/tomcat/tomcat-6.0.29-r1.ebuild,v 1.1 2011/01/18 18:02:20 fordfrog Exp $
524
525 EAPI=2
526 JAVA_PKG_IUSE="doc examples source test"
527 WANT_ANT_TASKS="ant-trax"
528
529 inherit eutils java-pkg-2 java-ant-2
530
531 DESCRIPTION="Tomcat Servlet-2.5/JSP-2.1 Container"
532
533 MY_P="apache-${P}-src"
534 SLOT="6"
535 SRC_URI="mirror://apache/${PN}/${PN}-6/v${PV/_/-}/src/${MY_P}.tar.gz"
536 HOMEPAGE="http://tomcat.apache.org/"
537 KEYWORDS="~amd64 ~ppc ~ppc64 ~x86 ~x86-fbsd"
538 LICENSE="Apache-2.0"
539
540 IUSE=""
541
542 COMMON_DEPEND="dev-java/eclipse-ecj:3.3
543 dev-java/ant-eclipse-ecj:3.3
544 >=dev-java/commons-dbcp-1.2.1
545 >=dev-java/commons-logging-1.1
546 >=dev-java/commons-pool-1.2
547 ~dev-java/tomcat-servlet-api-${PV}
548 examples? ( dev-java/jakarta-jstl )"
549
550 RDEPEND="
551 !<dev-java/tomcat-native-1.1.20
552 >=virtual/jre-1.5
553 >=dev-java/commons-daemon-1.0.1
554 dev-java/ant-core
555 ${COMMON_DEPEND}"
556
557 DEPEND=">=virtual/jdk-1.5
558 ${COMMON_DEPEND}
559 test? ( =dev-java/junit-3.8* )"
560
561 S=${WORKDIR}/${MY_P}
562
563 TOMCAT_NAME="${PN}-${SLOT}"
564 TOMCAT_HOME="/usr/share/${TOMCAT_NAME}"
565 WEBAPPS_DIR="/var/lib/${TOMCAT_NAME}/webapps"
566
567 # TODO: Fails to find PrettyPrint in with python 2.6 and xml-rewriter-3
568 # Find out why so
569 JAVA_ANT_CELEMENT_REWRITER="true"
570 JAVA_ANT_REWRITE_CLASSPATH="true"
571
572 EANT_NEEDS_TOOLS="true"
573 EANT_GENTOO_CLASSPATH="tomcat-servlet-api-2.5,eclipse-ecj-3.3"
574
575 EANT_BUILD_TARGET="build-only build-jasper-jdt"
576 EANT_DOC_TARGET="build-docs"
577
578 EANT_EXTRA_ARGS="-Dbase.path=${T} -Dversion=${PV} -Dversion.number=${PV}
579 -Dcompile.debug=false -Djsp-api.jar=jsp-api.jar -Dservlet-api.jar=servlet-api.jar
580 -Dant.jar=ant.jar"
581
582 pkg_setup() {
583 java-pkg-2_pkg_setup
584 enewgroup tomcat 265
585 enewuser tomcat 265 -1 /dev/null tomcat
586 }
587
588 java_prepare() {
589 rm -v webapps/examples/WEB-INF/lib/*.jar || die
590
591 # bug # 178980 and #312293
592 if use amd64; then
593 java-pkg_force-compiler ecj-3.3
594 fi
595
596 if ! use doc; then
597 EANT_EXTRA_ARGS+=" -Dnobuild.docs=true"
598 fi
599
600 EANT_EXTRA_ARGS+=" -Djdt.jar=$(java-pkg_getjar eclipse-ecj-3.3 ecj.jar)"
601 java-pkg_jarfrom --build-only ant-core ant.jar
602 }
603
604 src_install() {
605 cd "${S}/bin"
606 rm -f *.bat
607 chmod 755 *.sh
608
609 # register jars per bug #171496
610 cd "${S}/output/build/lib/"
611 for jar in *.jar; do
612 java-pkg_dojar ${jar}
613 done
614
615 local CATALINA_BASE=/var/lib/${TOMCAT_NAME}/
616
617 # init.d, conf.d
618 newinitd "${FILESDIR}"/${SLOT}/tomcat.init.2 ${TOMCAT_NAME}
619 newconfd "${FILESDIR}"/${SLOT}/tomcat.conf ${TOMCAT_NAME}
620
621 # create dir structure
622 dodir /usr/share/${TOMCAT_NAME}
623
624 diropts -m750 -o tomcat -g tomcat
625 dodir /etc/${TOMCAT_NAME}
626 keepdir ${WEBAPPS_DIR}
627
628 diropts -m755 -o tomcat -g tomcat
629 dodir ${CATALINA_BASE}
630
631 diropts -m775 -o tomcat -g tomcat
632 dodir /etc/${TOMCAT_NAME}/Catalina/localhost
633 keepdir /var/log/${TOMCAT_NAME}/
634 keepdir /var/run/${TOMCAT_NAME}/
635 keepdir /var/tmp/${TOMCAT_NAME}/
636
637 cd "${S}"
638 # fix context's so webapps will be deployed
639 sed -i -e 's:Context a:Context docBase="${catalina.home}/webapps/host-manager" a:' "${S}"/webapps/host-manager/META-INF/context.xml
640 sed -i -e 's:Context a:Context docBase="${catalina.home}/webapps/manager" a:' "${S}"/webapps/manager/META-INF/context.xml
641
642 # replace the default pw with a random one, see #92281
643 local randpw=$(echo ${RANDOM}|md5sum|cut -c 1-15)
644 sed -e s:SHUTDOWN:${randpw}: -i conf/server.xml
645
646 # copy over the directories
647 chown -R tomcat:tomcat webapps/* conf/*
648 cp -pR conf/* "${D}"/etc/${TOMCAT_NAME} || die "failed to copy conf"
649 cp -pPR output/build/bin "${D}"/usr/share/${TOMCAT_NAME} \
650 || die "failed to copy"
651 # webapps get stored in /usr/share/${TOMCAT_NAME}/webapps
652 cd "${S}"/webapps || die
653 ebegin "Installing webapps to /usr/share/${TOMCAT_NAME}"
654
655 dodir /usr/share/${TOMCAT_NAME}/webapps
656 cp -pR ROOT "${D}"/usr/share/${TOMCAT_NAME}/webapps || die
657 cp -pR host-manager "${D}"/usr/share/${TOMCAT_NAME}/webapps || die
658 cp -pR manager "${D}"/usr/share/${TOMCAT_NAME}/webapps || die
659 if use doc; then
660 cp -pR docs "${D}"/usr/share/${TOMCAT_NAME}/webapps || die
661 fi
662 if use examples; then
663 cd "${S}"/webapps/examples/WEB-INF/lib
664 java-pkg_jar-from jakarta-jstl jstl.jar
665 java-pkg_jar-from jakarta-jstl standard.jar
666 cd "${S}"/webapps
667 cp -pR examples "${D}"/usr/share/${TOMCAT_NAME}/webapps || die
668 fi
669
670 # replace catalina.policy with gentoo specific one bug #176701
671 # cp ${FILESDIR}/${SLOT}/catalina.policy "${D}"/etc/${TOMCAT_NAME} \
672 # || die "failed to replace catalina.policy"
673
674 cp "${T}"/tomcat6-deps/jdt/jasper-jdt.jar "${D}"/usr/share/${TOMCAT_NAME}/lib \
675 || die "failed to copy"
676
677 cd "${D}/usr/share/${TOMCAT_NAME}/lib" || die
678 java-pkg_jar-from tomcat-servlet-api-2.5
679
680 # symlink the directories to make CATALINA_BASE possible
681 dosym /etc/${TOMCAT_NAME} ${CATALINA_BASE}/conf
682 dosym /var/log/${TOMCAT_NAME} ${CATALINA_BASE}/logs
683 dosym /var/tmp/${TOMCAT_NAME} ${CATALINA_BASE}/temp
684 dosym /var/run/${TOMCAT_NAME} ${CATALINA_BASE}/work
685
686 dodoc "${S}"/{RELEASE-NOTES,RUNNING.txt}
687 fperms 640 /etc/${TOMCAT_NAME}/tomcat-users.xml
688
689 #install *.sh scripts bug #278059
690 exeinto /usr/share/${TOMCAT_NAME}/bin
691 doexe "${S}"/bin/*.sh
692 }
693
694 pkg_postinst() {
695 ewarn "Changing ownership recursively on /etc/${TOMCAT_NAME}"
696 # temp fix for bug #176097
697 chown -fR tomcat:tomcat /etc/${TOMCAT_NAME}
698 ewarn "Owner ship changed to tomcat:tomcat. Temp hack/fix."
699
700 # bug #180519
701 if [[ -e "${ROOT}var/lib/${TOMCAT_NAME}/webapps/manager" ]] ; then
702 elog "The latest webapp has NOT been installed into"
703 elog "${ROOT}var/lib/${TOMCAT_NAME}/webapps/ because directory already exists"
704 elog "and we do not want to overwrite any files you have put there."
705 elog
706 elog "Installing latest webapp into"
707 elog "${ROOT}usr/share/${TOMCAT_NAME}/webapps instead"
708 elog
709 elog "Manager Symbolic Links NOT created."
710
711 else
712 einfo "Installing latest webroot to ${ROOT}/${WEBAPPS_DIR}"
713 cp -pR "${ROOT}"/usr/share/${TOMCAT_NAME}/webapps/* \
714 "${ROOT}""${WEBAPPS_DIR}"
715 # link the manager's context to the right position
716 dosym ${TOMCAT_HOME}/webapps/host-manager/META-INF/context.xml /etc/${TOMCAT_NAME}/Catalina/localhost/host-manager.xml
717 dosym ${TOMCAT_HOME}/webapps/manager/META-INF/context.xml /etc/${TOMCAT_NAME}/Catalina/localhost/manager.xml
718 fi
719
720 elog
721 elog " This ebuild implements a FHS compliant layout for tomcat"
722 elog " Please read http://www.gentoo.org/proj/en/java/tomcat6-guide.xml"
723 elog " for more information."
724 elog
725 ewarn "tomcat-dbcp.jar is not built at this time. Please fetch jar"
726 ewarn "from upstream binary if you need it. Gentoo Bug # 144276"
727 elog
728
729 ewarn "The manager webapps have known exploits, please refer to"
730 ewarn "http://cve.mitre.org/cgi-bin/cvename.cgi?name=2007-2450"
731
732 if use examples ; then
733 ewarn
734 ewarn "The examples webapp has a known exploit, please refer to"
735 ewarn "http://cve.mitre.org/cgi-bin/cvename.cgi?name=2007-2449"
736 ewarn
737 fi
738
739 elog
740 elog " Please report any bugs to http://bugs.gentoo.org/"
741 elog
742 }
743
744
745
746 1.1 www-servers/tomcat/tomcat-7.0.5-r1.ebuild
747
748 file : http://sources.gentoo.org/viewvc.cgi/gentoo-x86/www-servers/tomcat/tomcat-7.0.5-r1.ebuild?rev=1.1&view=markup
749 plain: http://sources.gentoo.org/viewvc.cgi/gentoo-x86/www-servers/tomcat/tomcat-7.0.5-r1.ebuild?rev=1.1&content-type=text/plain
750
751 Index: tomcat-7.0.5-r1.ebuild
752 ===================================================================
753 # Copyright 1999-2011 Gentoo Foundation
754 # Distributed under the terms of the GNU General Public License v2
755 # $Header: /var/cvsroot/gentoo-x86/www-servers/tomcat/tomcat-7.0.5-r1.ebuild,v 1.1 2011/01/18 18:02:20 fordfrog Exp $
756
757 EAPI=2
758 JAVA_PKG_IUSE="doc examples source test"
759 WANT_ANT_TASKS="ant-trax"
760
761 inherit eutils java-pkg-2 java-ant-2
762
763 DESCRIPTION="Tomcat Servlet-3.0/JSP-2.2 Container"
764
765 MY_P="apache-${P/_beta/}-src"
766 SLOT="7"
767 SRC_URI="mirror://apache/${PN}/${PN}-${SLOT}/v${PV/_/-}-beta/src/${MY_P}.tar.gz"
768 HOMEPAGE="http://tomcat.apache.org/"
769 KEYWORDS="~amd64 ~ppc ~ppc64 ~x86 ~x86-fbsd"
770 LICENSE="Apache-2.0"
771
772 IUSE=""
773
774 # eclipse ecj version/slot
775 ECJV="3.6"
776
777 # servlet-api slot
778 SAPIS="3.0"
779
780 COMMON_DEPEND="dev-java/eclipse-ecj:${ECJV}
781 dev-java/ant-eclipse-ecj:${ECJV}
782 >=dev-java/commons-dbcp-1.4
783 >=dev-java/commons-logging-1.1
784 >=dev-java/commons-pool-1.5.5
785 ~dev-java/tomcat-servlet-api-${PV}
786 examples? ( dev-java/jakarta-jstl )"
787
788 RDEPEND="
789 !<dev-java/tomcat-native-1.1.20
790 >=virtual/jre-1.6
791 >=dev-java/commons-daemon-1.0.3
792 dev-java/ant-core
793 ${COMMON_DEPEND}"
794
795 DEPEND=">=virtual/jdk-1.6
796 ${COMMON_DEPEND}
797 test? ( =dev-java/junit-3.8* )"
798
799 S=${WORKDIR}/${MY_P}
800
801 TOMCAT_NAME="${PN}-${SLOT}"
802 TOMCAT_HOME="/usr/share/${TOMCAT_NAME}"
803 WEBAPPS_DIR="/var/lib/${TOMCAT_NAME}/webapps"
804
805 # TODO: Fails to find PrettyPrint in with python 2.6 and xml-rewriter-3
806 # Find out why so
807 JAVA_ANT_CELEMENT_REWRITER="true"
808 JAVA_ANT_REWRITE_CLASSPATH="true"
809
810 EANT_NEEDS_TOOLS="true"
811 EANT_GENTOO_CLASSPATH="tomcat-servlet-api-${SAPIS},eclipse-ecj-${ECJV}"
812
813 EANT_BUILD_TARGET="package"
814 EANT_DOC_TARGET="build-docs"
815
816 EANT_EXTRA_ARGS="-Dbase.path=${T} -Dversion=${PV}-gentoo -Dversion.number=${PV}
817 -Dcompile.debug=false -Del-api.jar=el-api.jar -Djsp-api.jar=jsp-api.jar -Dservlet-api.jar=servlet-api.jar
818 -Dant.jar=ant.jar"
819
820 pkg_setup() {
821 java-pkg-2_pkg_setup
822 enewgroup tomcat 265
823 enewuser tomcat 265 -1 /dev/null tomcat
824 }
825
826 java_prepare() {
827 epatch "${FILESDIR}/${SLOT}/build-xml.patch"
828
829 rm -v webapps/examples/WEB-INF/lib/*.jar \
830 test/webapp-3.0-fragments/WEB-INF/lib/*.jar || die
831
832 # bug # 178980 and #312293
833 use amd64 && java-pkg_force-compiler eclipse-ecj-${ECJV}
834
835 if ! use doc; then
836 EANT_EXTRA_ARGS+=" -Dnobuild.docs=true"
837 fi
838
839 EANT_EXTRA_ARGS+=" -Djdt.jar=$(java-pkg_getjar eclipse-ecj-${ECJV} ecj.jar)"
840 java-pkg_jarfrom --build-only ant-core ant.jar
841 }
842
843 src_install() {
844 cd "${S}/bin"
845 rm -f *.bat
846 chmod 755 *.sh
847
848 # register jars per bug #171496
849 cd "${S}/output/build/lib/"
850 for jar in *.jar; do
851 java-pkg_dojar ${jar}
852 done
853
854 local CATALINA_BASE=/var/lib/${TOMCAT_NAME}/
855
856 # init.d, conf.d
857 newinitd "${FILESDIR}"/${SLOT}/tomcat.init ${TOMCAT_NAME}
858 newconfd "${FILESDIR}"/${SLOT}/tomcat.conf ${TOMCAT_NAME}
859
860 # create dir structure
861 dodir /usr/share/${TOMCAT_NAME}
862
863 diropts -m750 -o tomcat -g tomcat
864 dodir /etc/${TOMCAT_NAME}
865 keepdir ${WEBAPPS_DIR}
866
867 diropts -m755 -o tomcat -g tomcat
868 dodir ${CATALINA_BASE}
869
870 diropts -m775 -o tomcat -g tomcat
871 dodir /etc/${TOMCAT_NAME}/Catalina/localhost
872 keepdir /var/log/${TOMCAT_NAME}/
873 keepdir /var/run/${TOMCAT_NAME}/
874 keepdir /var/tmp/${TOMCAT_NAME}/
875
876 cd "${S}"
877 # fix context's so webapps will be deployed
878 sed -i -e 's:Context a:Context docBase="${catalina.home}/webapps/host-manager" a:' "${S}"/webapps/host-manager/META-INF/context.xml
879 sed -i -e 's:Context a:Context docBase="${catalina.home}/webapps/manager" a:' "${S}"/webapps/manager/META-INF/context.xml
880
881 # replace the default pw with a random one, see #92281
882 local randpw=$(echo ${RANDOM}|md5sum|cut -c 1-15)
883 sed -e s:SHUTDOWN:${randpw}: -i conf/server.xml
884
885 # copy over the directories
886 chown -R tomcat:tomcat webapps/* conf/*
887 cp -pR conf/* "${D}"/etc/${TOMCAT_NAME} || die "failed to copy conf"
888 cp -pPR output/build/bin "${D}"/usr/share/${TOMCAT_NAME} \
889 || die "failed to copy"
890 # webapps get stored in /usr/share/${TOMCAT_NAME}/webapps
891 cd "${S}"/webapps || die
892 ebegin "Installing webapps to /usr/share/${TOMCAT_NAME}"
893
894 dodir /usr/share/${TOMCAT_NAME}/webapps
895 cp -pR ROOT "${D}"/usr/share/${TOMCAT_NAME}/webapps || die
896 cp -pR host-manager "${D}"/usr/share/${TOMCAT_NAME}/webapps || die
897 cp -pR manager "${D}"/usr/share/${TOMCAT_NAME}/webapps || die
898 if use doc; then
899 cp -pR docs "${D}"/usr/share/${TOMCAT_NAME}/webapps || die
900 fi
901 if use examples; then
902 cd "${S}"/webapps/examples/WEB-INF/lib
903 java-pkg_jar-from jakarta-jstl jstl.jar
904 java-pkg_jar-from jakarta-jstl standard.jar
905 cd "${S}"/webapps
906 cp -pR examples "${D}"/usr/share/${TOMCAT_NAME}/webapps || die
907 fi
908
909 # replace catalina.policy with gentoo specific one bug #176701
910 # cp ${FILESDIR}/${SLOT}/catalina.policy "${D}"/etc/${TOMCAT_NAME} \
911 # || die "failed to replace catalina.policy"
912
913 cd "${D}/usr/share/${TOMCAT_NAME}/lib" || die
914 java-pkg_jar-from eclipse-ecj-${ECJV}
915 java-pkg_jar-from tomcat-servlet-api-${SAPIS}
916
917 # symlink the directories to make CATALINA_BASE possible
918 dosym /etc/${TOMCAT_NAME} ${CATALINA_BASE}/conf
919 dosym /var/log/${TOMCAT_NAME} ${CATALINA_BASE}/logs
920 dosym /var/tmp/${TOMCAT_NAME} ${CATALINA_BASE}/temp
921 dosym /var/run/${TOMCAT_NAME} ${CATALINA_BASE}/work
922
923 dodoc "${S}"/{RELEASE-NOTES,RUNNING.txt}
924 fperms 640 /etc/${TOMCAT_NAME}/tomcat-users.xml
925
926 #install *.sh scripts bug #278059
927 exeinto /usr/share/${TOMCAT_NAME}/bin
928 doexe "${S}"/bin/*.sh
929 }
930
931 pkg_postinst() {
932 ewarn "Changing ownership recursively on /etc/${TOMCAT_NAME}"
933 # temp fix for bug #176097
934 chown -fR tomcat:tomcat /etc/${TOMCAT_NAME}
935 ewarn "Owner ship changed to tomcat:tomcat. Temp hack/fix."
936
937 # bug #180519
938 if [[ -e "${ROOT}var/lib/${TOMCAT_NAME}/webapps/manager" ]] ; then
939 elog "The latest webapp has NOT been installed into"
940 elog "${ROOT}var/lib/${TOMCAT_NAME}/webapps/ because directory already exists"
941 elog "and we do not want to overwrite any files you have put there."
942 elog
943 elog "Installing latest webapp into"
944 elog "${ROOT}usr/share/${TOMCAT_NAME}/webapps instead"
945 elog
946 elog "Manager Symbolic Links NOT created."
947
948 else
949 einfo "Installing latest webroot to ${ROOT}/${WEBAPPS_DIR}"
950 cp -pR "${ROOT}"/usr/share/${TOMCAT_NAME}/webapps/* \
951 "${ROOT}""${WEBAPPS_DIR}"
952 # link the manager's context to the right position
953 dosym ${TOMCAT_HOME}/webapps/host-manager/META-INF/context.xml /etc/${TOMCAT_NAME}/Catalina/localhost/host-manager.xml
954 dosym ${TOMCAT_HOME}/webapps/manager/META-INF/context.xml /etc/${TOMCAT_NAME}/Catalina/localhost/manager.xml
955 fi
956
957 elog
958 elog " This ebuild implements a FHS compliant layout for tomcat"
959 elog " Please read http://www.gentoo.org/proj/en/java/tomcat6-guide.xml"
960 elog " for more information."
961 elog
962 ewarn "tomcat-dbcp.jar is not built at this time. Please fetch jar"
963 ewarn "from upstream binary if you need it. Gentoo Bug # 144276"
964 elog
965
966 ewarn "The manager webapps have known exploits, please refer to"
967 ewarn "http://cve.mitre.org/cgi-bin/cvename.cgi?name=2007-2450"
968
969 if use examples ; then
970 ewarn
971 ewarn "The examples webapp has a known exploit, please refer to"
972 ewarn "http://cve.mitre.org/cgi-bin/cvename.cgi?name=2007-2449"
973 ewarn
974 fi
975
976 elog
977 elog " Please report any bugs to http://bugs.gentoo.org/"
978 elog
979 }