Gentoo Archives: gentoo-commits

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