Gentoo Archives: gentoo-commits

From: "Petteri Raty (betelgeuse)" <betelgeuse@g.o>
To: gentoo-commits@l.g.o
Subject: [gentoo-commits] gentoo-x86 commit in www-servers/tomcat: ChangeLog tomcat-6.0.20.ebuild
Date: Wed, 17 Jun 2009 14:18:33
Message-Id: E1MGvyA-0007t7-7e@stork.gentoo.org
1 betelgeuse 09/06/17 14:18:30
2
3 Modified: ChangeLog
4 Added: tomcat-6.0.20.ebuild
5 Log:
6 Version bump for bug #273931. Fixes multiple security issue (bug #272566 and bug #273566).
7 (Portage version: 2.2_rc33/cvs/Linux i686)
8
9 Revision Changes Path
10 1.214 www-servers/tomcat/ChangeLog
11
12 file : http://sources.gentoo.org/viewcvs.py/gentoo-x86/www-servers/tomcat/ChangeLog?rev=1.214&view=markup
13 plain: http://sources.gentoo.org/viewcvs.py/gentoo-x86/www-servers/tomcat/ChangeLog?rev=1.214&content-type=text/plain
14 diff : http://sources.gentoo.org/viewcvs.py/gentoo-x86/www-servers/tomcat/ChangeLog?r1=1.213&r2=1.214
15
16 Index: ChangeLog
17 ===================================================================
18 RCS file: /var/cvsroot/gentoo-x86/www-servers/tomcat/ChangeLog,v
19 retrieving revision 1.213
20 retrieving revision 1.214
21 diff -u -r1.213 -r1.214
22 --- ChangeLog 29 Mar 2009 20:59:34 -0000 1.213
23 +++ ChangeLog 17 Jun 2009 14:18:30 -0000 1.214
24 @@ -1,6 +1,12 @@
25 # ChangeLog for www-servers/tomcat
26 # Copyright 1999-2009 Gentoo Foundation; Distributed under the GPL v2
27 -# $Header: /var/cvsroot/gentoo-x86/www-servers/tomcat/ChangeLog,v 1.213 2009/03/29 20:59:34 betelgeuse Exp $
28 +# $Header: /var/cvsroot/gentoo-x86/www-servers/tomcat/ChangeLog,v 1.214 2009/06/17 14:18:30 betelgeuse Exp $
29 +
30 +*tomcat-6.0.20 (17 Jun 2009)
31 +
32 + 17 Jun 2009; Petteri Räty <betelgeuse@g.o> +tomcat-6.0.20.ebuild:
33 + Version bump for bug #273931. Fixes multiple security issue (bug #272566
34 + and bug #273566).
35
36 29 Mar 2009; Petteri Räty <betelgeuse@g.o>
37 -tomcat-5.5.27-r1.ebuild, -tomcat-5.5.27-r2.ebuild,
38
39
40
41 1.1 www-servers/tomcat/tomcat-6.0.20.ebuild
42
43 file : http://sources.gentoo.org/viewcvs.py/gentoo-x86/www-servers/tomcat/tomcat-6.0.20.ebuild?rev=1.1&view=markup
44 plain: http://sources.gentoo.org/viewcvs.py/gentoo-x86/www-servers/tomcat/tomcat-6.0.20.ebuild?rev=1.1&content-type=text/plain
45
46 Index: tomcat-6.0.20.ebuild
47 ===================================================================
48 # Copyright 1999-2009 Gentoo Foundation
49 # Distributed under the terms of the GNU General Public License v2
50 # $Header: /var/cvsroot/gentoo-x86/www-servers/tomcat/tomcat-6.0.20.ebuild,v 1.1 2009/06/17 14:18:30 betelgeuse Exp $
51
52 EAPI=2
53 JAVA_PKG_IUSE="doc examples source test"
54 WANT_ANT_TASKS="ant-trax"
55
56 inherit eutils java-pkg-2 java-ant-2
57
58 DESCRIPTION="Tomcat Servlet-2.5/JSP-2.1 Container"
59
60 MY_P="apache-${P}-src"
61 SLOT="6"
62 SRC_URI="mirror://apache/${PN}/${PN}-6/v${PV/_/-}/src/${MY_P}.tar.gz"
63 HOMEPAGE="http://tomcat.apache.org/"
64 KEYWORDS="~amd64 ~ppc ~ppc64 ~x86 ~x86-fbsd"
65 LICENSE="Apache-2.0"
66
67 IUSE=""
68
69 COMMON_DEPEND="dev-java/eclipse-ecj:3.3
70 dev-java/ant-eclipse-ecj:3.3
71 >=dev-java/commons-dbcp-1.2.1
72 >=dev-java/commons-logging-1.1
73 >=dev-java/commons-pool-1.2
74 ~dev-java/tomcat-servlet-api-${PV}
75 examples? ( dev-java/jakarta-jstl )"
76
77 RDEPEND=">=virtual/jre-1.5
78 >=dev-java/commons-daemon-1.0.1
79 dev-java/ant-core
80 ${COMMON_DEPEND}"
81
82 DEPEND=">=virtual/jdk-1.5
83 ${COMMON_DEPEND}
84 test? ( =dev-java/junit-3.8* )"
85
86 S=${WORKDIR}/${MY_P}
87
88 TOMCAT_NAME="${PN}-${SLOT}"
89 TOMCAT_HOME="/usr/share/${TOMCAT_NAME}"
90 WEBAPPS_DIR="/var/lib/${TOMCAT_NAME}/webapps"
91
92 # TODO: Fails to find PrettyPrint in with python 2.6 and xml-rewriter-3
93 # Find out why so
94 JAVA_ANT_CELEMENT_REWRITER="true"
95 JAVA_ANT_REWRITE_CLASSPATH="true"
96
97 EANT_NEEDS_TOOLS="true"
98 EANT_GENTOO_CLASSPATH="tomcat-servlet-api-2.5,eclipse-ecj-3.3"
99
100 EANT_BUILD_TARGET="build-only build-jasper-jdt"
101 EANT_DOC_TARGET="build-docs"
102
103 EANT_EXTRA_ARGS="-Dbase.path=${T} -Dversion=${PV} -Dversion.number=${PV}
104 -Dcompile.debug=false -Djsp-api.jar=jsp-api.jar -Dservlet-api.jar=servlet-api.jar
105 -Dant.jar=ant.jar"
106
107 pkg_setup() {
108 java-pkg-2_pkg_setup
109 enewgroup tomcat 265
110 enewuser tomcat 265 -1 /dev/null tomcat
111 }
112
113 java_prepare() {
114 rm -v webapps/examples/WEB-INF/lib/*.jar || die
115
116 # bug # 178980
117 if use amd64 && [[ "${GENTOO_VM}" = "sun-jdk-1.5" ]] ; then
118 java-pkg_force-compiler ecj-3.3
119 fi
120
121 if ! use doc; then
122 EANT_EXTRA_ARGS+=" -Dnobuild.docs=true"
123 fi
124
125 EANT_EXTRA_ARGS+=" -Djdt.jar=$(java-pkg_getjar eclipse-ecj-3.3 ecj.jar)"
126 java-pkg_jarfrom --build-only ant-core ant.jar
127 }
128
129 src_install() {
130 cd "${S}/bin"
131 rm -f *.bat
132 chmod 755 *.sh
133
134 # register jars per bug #171496
135 cd "${S}/output/build/lib/"
136 for jar in *.jar; do
137 java-pkg_dojar ${jar}
138 done
139
140 local CATALINA_BASE=/var/lib/${TOMCAT_NAME}/
141
142 # init.d, conf.d
143 newinitd "${FILESDIR}"/${SLOT}/tomcat.init ${TOMCAT_NAME}
144 newconfd "${FILESDIR}"/${SLOT}/tomcat.conf ${TOMCAT_NAME}
145
146 # create dir structure
147 dodir /usr/share/${TOMCAT_NAME}
148
149 diropts -m750 -o tomcat -g tomcat
150 dodir /etc/${TOMCAT_NAME}
151 keepdir ${WEBAPPS_DIR}
152
153 diropts -m755 -o tomcat -g tomcat
154 dodir ${CATALINA_BASE}
155
156 diropts -m775 -o tomcat -g tomcat
157 dodir /etc/${TOMCAT_NAME}/Catalina/localhost
158 keepdir /var/log/${TOMCAT_NAME}/
159 keepdir /var/run/${TOMCAT_NAME}/
160 keepdir /var/tmp/${TOMCAT_NAME}/
161
162 cd "${S}"
163 # fix context's so webapps will be deployed
164 sed -i -e 's:Context a:Context docBase="${catalina.home}/webapps/host-manager" a:' "${S}"/webapps/host-manager/META-INF/context.xml
165 sed -i -e 's:Context a:Context docBase="${catalina.home}/webapps/manager" a:' "${S}"/webapps/manager/META-INF/context.xml
166
167 # replace the default pw with a random one, see #92281
168 local randpw=$(echo ${RANDOM}|md5sum|cut -c 1-15)
169 sed -e s:SHUTDOWN:${randpw}: -i conf/server.xml
170
171 # copy over the directories
172 chown -R tomcat:tomcat webapps/* conf/*
173 cp -pR conf/* "${D}"/etc/${TOMCAT_NAME} || die "failed to copy conf"
174 cp -pPR output/build/bin "${D}"/usr/share/${TOMCAT_NAME} \
175 || die "failed to copy"
176 # webapps get stored in /usr/share/${TOMCAT_NAME}/webapps
177 cd "${S}"/webapps || die
178 ebegin "Installing webapps to /usr/share/${TOMCAT_NAME}"
179
180 cp -pR ROOT "${D}"/usr/share/${TOMCAT_NAME}/webapps || die
181 cp -pR host-manager "${D}"/usr/share/${TOMCAT_NAME}/webapps || die
182 cp -pR manager "${D}"/usr/share/${TOMCAT_NAME}/webapps || die
183 if use doc; then
184 cp -pR docs "${D}"/usr/share/${TOMCAT_NAME}/webapps || die
185 fi
186 if use examples; then
187 cd "${S}"/webapps/examples/WEB-INF/lib
188 java-pkg_jar-from jakarta-jstl jstl.jar
189 java-pkg_jar-from jakarta-jstl standard.jar
190 cd "${S}"/webapps
191 cp -pR examples "${D}"/usr/share/${TOMCAT_NAME}/webapps || die
192 fi
193
194 # replace catalina.policy with gentoo specific one bug #176701
195 # cp ${FILESDIR}/${SLOT}/catalina.policy "${D}"/etc/${TOMCAT_NAME} \
196 # || die "failed to replace catalina.policy"
197
198 cp "${T}"/tomcat6-deps/jdt/jasper-jdt.jar "${D}"/usr/share/${TOMCAT_NAME}/lib \
199 || die "failed to copy"
200
201 cd "${D}/usr/share/${TOMCAT_NAME}/lib" || die
202 java-pkg_jar-from tomcat-servlet-api-2.5
203
204 # symlink the directories to make CATALINA_BASE possible
205 dosym /etc/${TOMCAT_NAME} ${CATALINA_BASE}/conf
206 dosym /var/log/${TOMCAT_NAME} ${CATALINA_BASE}/logs
207 dosym /var/tmp/${TOMCAT_NAME} ${CATALINA_BASE}/temp
208 dosym /var/run/${TOMCAT_NAME} ${CATALINA_BASE}/work
209
210 dodoc "${S}"/{RELEASE-NOTES,RUNNING.txt}
211 fperms 640 /etc/${TOMCAT_NAME}/tomcat-users.xml
212 }
213
214 pkg_postinst() {
215 ewarn "Changing ownership recursively on /etc/${TOMCAT_NAME}"
216 # temp fix for bug #176097
217 chown -fR tomcat:tomcat /etc/${TOMCAT_NAME}
218 ewarn "Owner ship changed to tomcat:tomcat. Temp hack/fix."
219
220 # bug #180519
221 if [[ -e "${ROOT}var/lib/${TOMCAT_NAME}/webapps/manager" ]] ; then
222 elog "The latest webapp has NOT been installed into"
223 elog "${ROOT}var/lib/${TOMCAT_NAME}/webapps/ because directory already exists"
224 elog "and we do not want to overwrite any files you have put there."
225 elog
226 elog "Installing latest webapp into"
227 elog "${ROOT}usr/share/${TOMCAT_NAME}/webapps instead"
228 elog
229 elog "Manager Symbolic Links NOT created."
230
231 else
232 einfo "Installing latest webroot to ${ROOT}/${WEBAPPS_DIR}"
233 cp -pR "${ROOT}"/usr/share/${TOMCAT_NAME}/webapps/* \
234 "${ROOT}""${WEBAPPS_DIR}"
235 # link the manager's context to the right position
236 dosym ${TOMCAT_HOME}/webapps/host-manager/META-INF/context.xml /etc/${TOMCAT_NAME}/Catalina/localhost/host-manager.xml
237 dosym ${TOMCAT_HOME}/webapps/manager/META-INF/context.xml /etc/${TOMCAT_NAME}/Catalina/localhost/manager.xml
238 fi
239
240 elog
241 elog " This ebuild implements a FHS compliant layout for tomcat"
242 elog " Please read http://www.gentoo.org/proj/en/java/tomcat6-guide.xml"
243 elog " for more information."
244 elog
245 ewarn "tomcat-dbcp.jar is not built at this time. Please fetch jar"
246 ewarn "from upstream binary if you need it. Gentoo Bug # 144276"
247 elog
248
249 ewarn "The manager webapps have known exploits, please refer to"
250 ewarn "http://cve.mitre.org/cgi-bin/cvename.cgi?name=2007-2450"
251
252 if use examples ; then
253 ewarn
254 ewarn "The examples webapp has a known exploit, please refer to"
255 ewarn "http://cve.mitre.org/cgi-bin/cvename.cgi?name=2007-2449"
256 ewarn
257 fi
258
259 elog
260 elog " Please report any bugs to http://bugs.gentoo.org/"
261 elog
262 }