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