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