2 # - packages for *.renametojar files (-cgi and -ssi in server/lib)
5 %bcond_without javadoc # skip building javadocs
6 %bcond_with jta # put jta jar into tomcat lib dir.
7 %bcond_without java_sun # build with gcj (does not work)
9 Summary: Apache Servlet/JSP Engine, RI for Servlet 2.4/JSP 2.0 API
10 Summary(pl.UTF-8): Silnik Servlet/JSP Apache będący wzorcową implementacją API Servlet 2.4/JSP 2.0
15 Group: Networking/Daemons/Java
16 Source0: http://www.apache.org/dist/tomcat/tomcat-5/v%{version}/src/%{name}-%{version}-src.tar.gz
17 # Source0-md5: eb3f196013550b9b1684e4ff18593a8e
19 Source2: %{name}.sysconfig
20 Source10: %{name}-context-ROOT.xml
21 Source11: %{name}-context-balancer.xml
22 Source12: %{name}-context-jsp-examples.xml
23 Source13: %{name}-context-tomcat-docs.xml
24 Source14: %{name}-context-webdav.xml
25 Patch0: %{name}-skip-servletapi.patch
26 Patch1: %{name}-nsis.patch
27 Patch2: %{name}-native.patch
28 Patch3: %{name}-skip-jdt.patch
29 Patch4: %{name}-no-connectors.patch
30 Patch5: %{name}-dbcp.patch
31 # this patch is needed for struts >= 1.3
32 Patch6: %{name}-struts.patch
33 URL: http://tomcat.apache.org/
35 BuildRequires: java-sun >= 1.5
36 BuildRequires: java-sun-jre >= 1.5
38 BuildRequires: java-gcj-compat-devel
39 # BuildRequires: jsse >= 0:1.0.3
41 BuildRequires: ant >= 1.5.3
42 BuildRequires: ant-trax
43 BuildRequires: eclipse-jdt
45 BuildRequires: jakarta-regexp >= 0:1.3
46 BuildRequires: java-commons-beanutils >= 1.7
47 BuildRequires: java-commons-collections >= 0:3.1
48 BuildRequires: java-commons-collections-tomcat5 >= 0:3.1
49 BuildRequires: java-commons-daemon >= 1.0
50 BuildRequires: java-commons-dbcp >= 0:1.2.1
51 BuildRequires: java-commons-dbcp-tomcat5 >= 0:1.2.1
52 BuildRequires: java-commons-digester >= 0:1.7
53 BuildRequires: java-commons-el >= 0:1.0
54 BuildRequires: java-commons-fileupload >= 0:1.0
55 BuildRequires: java-commons-httpclient
56 BuildRequires: java-commons-io >= 1.4
57 BuildRequires: java-commons-launcher >= 0:0.9
58 BuildRequires: java-commons-logging >= 0:1.0.4
59 BuildRequires: java-commons-modeler >= 2.0
60 BuildRequires: java-commons-pool >= 0:1.2
61 BuildRequires: java-commons-pool-tomcat5 >= 0:1.2
62 %{?with_jta:BuildRequires: java-jta >= 0:1.0.1}
63 BuildRequires: java-log4j
64 BuildRequires: java-puretls
65 BuildRequires: java-servletapi5 = %{version}
66 #BuildRequires: java-struts >= 0:1.2.7
67 BuildRequires: java-struts >= 1.0.2
68 BuildRequires: java-xerces >= 0:2.7.1
69 BuildRequires: java-xml-commons
70 #BuildRequires: java-xml-commons >= 1.3
71 BuildRequires: java-mail >= 0:1.3.1
72 BuildRequires: jaxp_parser_impl >= 0:2.7.1
73 BuildRequires: jdbc-stdext >= 0:2.0
75 BuildRequires: jndi >= 0:1.2.1
76 BuildRequires: jpackage-utils
77 BuildRequires: junit >= 0:3.8.1
78 BuildRequires: rpmbuild(macros) >= 1.300
79 Requires(post,postun): /sbin/ldconfig
80 Requires(post,preun): /sbin/chkconfig
81 Requires(postun): /usr/sbin/groupdel
82 Requires(postun): /usr/sbin/userdel
83 Requires(pre): /bin/id
84 Requires(pre): /usr/bin/getgid
85 Requires(pre): /usr/sbin/groupadd
86 Requires(pre): /usr/sbin/useradd
87 Requires: %{name}-jasper = %{version}-%{release}
89 #Requires: jaf >= 1.0.1
90 Requires: java-commons-beanutils
91 Requires: java-commons-collections
92 #Requires: java-commons-dbcp-tomcat5
93 Requires: java-commons-digester
94 Requires: java-commons-el
95 #Requires: java-commons-fileupload
96 Requires: java-commons-logging
97 Requires: java-commons-modeler
99 Requires: java-servletapi5 = %{version}
100 Requires: java-xml-commons
101 Requires: javamail >= 1.2
102 Requires: jaxp_parser_impl
103 Requires: jdbc-stdext >= 2.0
104 Requires: jndi >= 1.2.1
106 Requires: jsse >= 1.0.2
107 %{?with_jta:Requires: jta >= 1.0.1}
109 Provides: group(tomcat)
110 Provides: java-servlet-container
111 Provides: user(tomcat)
112 Obsoletes: jakarta-tomcat
114 BuildRoot: %{tmpdir}/%{name}-%{version}-root-%(id -u -n)
116 %define _tomcatdir %{_datadir}/tomcat
117 %define _logdir %{_var}/log
118 %define _vardir %{_var}/lib/tomcat
119 %define _sysconfdir /etc/tomcat
122 Tomcat is the servlet container that is used in the official Reference
123 Implementation for the Java Servlet and JavaServer Pages technologies.
124 The Java Servlet and JavaServer Pages specifications are developed by
125 Sun under the Java Community Process.
127 Tomcat is developed in an open and participatory environment and
128 released under the Apache Software License. Tomcat is intended to be a
129 collaboration of the best-of-breed developers from around the world.
130 We invite you to participate in this open development project.
132 %description -l pl.UTF-8
133 Tomcat to kontener serwletowy używany przez oficjalną implementację
134 wzorcową technologii Java Servlet i JavaServer Pages. Specyfikacje
135 Java Servlet i JavaServer Pages są rozwijane przez Suna zgodnie z Java
139 Summary: The Apache Tomcat Servlet/JSP Container documentation
140 Summary(pl.UTF-8): Dokumentacja do Tomcata - kontenera Servlet/JSP
142 Obsoletes: jakarta-tomcat-doc
145 The Tomcat Servlet/JSP Container documentation.
147 %description doc -l pl.UTF-8
148 Dokumentacja do Tomcata - kontenera Servlet/JSP.
151 Summary: Apache Tomcat`s Administration Web Application
152 Summary(pl.UTF-8): Panel Administracyjny dla Apache Tomcat
153 Group: Networking/Daemons/Java/Servlets
156 Administration Web Application for Apache Tomcat.
158 %description admin -l pl.UTF-8
159 Panel Administracyjny dla Apache Tomcat.
162 Summary: JSP compiler
163 Summary(pl.UTF-8): Kompilator JSP
164 Group: Libraries/Java
165 Requires: jpackage-utils
168 Jasper is Java ServerPages compiler used by Apache Tomcat servlet
171 %description jasper -l pl.UTF-8
172 Jasper jest kompilatorem Java ServerPages używanym przez kontener
173 servletów Apache Tomcat.
176 %setup -q -n %{name}-%{version}-src
185 # servletapi built from jakarta-servletapi5.spec
188 # Remove pre-built jars
189 find -name '*.jar' | xargs rm -fv
195 # build jasper javadocs
197 CLASSPATH=$(build-classpath xml-commons-apis)
198 # building jasper needs eclipse classes
199 cat > build.properties <<EOF
200 ant.jar=$(find-jar ant)
201 servlet-api.jar=$(find-jar servlet-api)
202 jsp-api.jar=$(find-jar jsp-api)
203 tools.jar=%{java_home}/lib/tools.jar
204 xercesImpl.jar=$(find-jar jaxp_parser_impl)
205 xmlParserAPIs.jar=$(find-jar xml-commons-apis)
206 commons-collections.jar=$(find-jar commons-collections)
207 commons-logging.jar=$(find-jar commons-logging)
208 commons-daemon.jar=$(find-jar commons-daemon)
209 junit.jar=$(find-jar junit)
210 commons-el.jar=$(find-jar commons-el)
216 -Dcompile.source=1.4 \
217 -Dbuild.compiler=modern \
224 # XXX build process should fail if one of these find-jar commands fails
226 cat > build.properties <<EOF
227 commons-beanutils.jar=$(find-jar commons-beanutils-core)
228 commons-launcher.jar=$(find-jar commons-launcher)
229 commons-daemon.jar=$(find-jar commons-daemon)
230 commons-digester.jar=$(find-jar commons-digester)
231 commons-el.jar=$(find-jar commons-el)
232 commons-logging-api.jar=$(find-jar commons-logging-api)
233 commons-logging.jar=$(find-jar commons-logging)
234 commons-modeler.jar=$(find-jar commons-modeler)
235 xercesImpl.jar=$(find-jar jaxp_parser_impl)
236 xml-apis.jar=$(find-jar xml-commons-apis)
237 jdt.jar=$(find-jar org.eclipse.jdt.core)
238 jasper-compiler-jdt.home=$TOPDIR/tomcat-deps
239 commons-httpclient.jar=$(find-jar commons-httpclient)
240 commons-collections.jar=$(find-jar commons-collections)
241 commons-fileupload.jar=$(find-jar commons-fileupload)
242 commons-io.jar=$(find-jar commons-io)
243 jmx.jar=$(find-jar jmx)
244 jmx-tools.jar=$(find-jar jmx)
245 junit.jar=$(find-jar junit)
246 struts.jar=$(find-jar struts-core)
247 struts-core.jar=$(find-jar struts-core)
248 struts-taglib.jar=$(find-jar struts-taglib)
249 jcert.jar=$(find-jar jcert)
250 jnet.jar=$(find-jar jnet)
251 jsse.jar=$(find-jar jsse)
252 %{?with_jta:jta.jar=$(find-jar jta)}
253 puretls.jar=$(find-jar puretls)
254 servlet-api.jar=$(find-jar servlet-api)
255 servletapi.build.notrequired=true
256 jsp-api.jar=$(find-jar jsp-api)
257 jspapi.build.notrequired=true
258 log4j.jar=$(find-jar log4j)
259 tomcat-dbcp.jar=$(find-jar commons-dbcp-tomcat5)
260 struts.lib=%{_javadir}-struts
267 rm -rf $RPM_BUILD_ROOT
269 TOMCATDIR=$RPM_BUILD_ROOT%{_tomcatdir}
270 CATALINADIR=$RPM_BUILD_ROOT/var/lib/tomcat
272 # we don't need dos scripts
275 randpw=$(echo $RANDOM$$ | md5sum | cut -c 1-15)
276 %{__sed} -i -e "s:SHUTDOWN:${randpw}:" conf/{server,server-minimal}.xml
278 install -d $TOMCATDIR/bin \
279 $TOMCATDIR/common/{lib,classes,endorsed} \
280 $TOMCATDIR/server/{lib,classes} \
282 $RPM_BUILD_ROOT%{_logdir}/tomcat \
283 $RPM_BUILD_ROOT%{_vardir}/webapps \
284 $RPM_BUILD_ROOT%{_vardir}/work \
285 $RPM_BUILD_ROOT%{_vardir}/conf \
286 $RPM_BUILD_ROOT/etc/sysconfig \
287 $RPM_BUILD_ROOT/etc/rc.d/init.d
289 install %{SOURCE1} $RPM_BUILD_ROOT/etc/rc.d/init.d/tomcat
290 install %{SOURCE2} $RPM_BUILD_ROOT/etc/sysconfig/tomcat
292 cp -pR conf/* $CATALINADIR/conf
293 install %{SOURCE10} $CATALINADIR/conf/Catalina/localhost/ROOT.xml
294 install %{SOURCE11} $CATALINADIR/conf/Catalina/localhost/balancer.xml
295 install %{SOURCE12} $CATALINADIR/conf/Catalina/localhost/jsp-examples.xml
296 install %{SOURCE13} $CATALINADIR/conf/Catalina/localhost/tomcat-docs.xml
297 install %{SOURCE14} $CATALINADIR/conf/Catalina/localhost/webdav.xml
298 cp -HR bin common server $TOMCATDIR
300 cp -rf server/webapps $TOMCATDIR/server
301 cp -rf webapps $TOMCATDIR
302 cp -rf shared $TOMCATDIR
303 cp -rf temp $CATALINADIR
305 ln -sf %{_logdir}/tomcat $CATALINADIR/logs
306 ln -sf %{_vardir}/work $TOMCATDIR/work
307 ln -sf %{_vardir}/conf $TOMCATDIR/conf
308 ln -sf %{_vardir}/conf $RPM_BUILD_ROOT%{_sysconfdir}
310 # symlinks instead of copies
311 ln -sf $(find-jar commons-el) $TOMCATDIR/common/lib/commons-el.jar
312 ln -sf $(find-jar jakarta-commons-dbcp-tomcat5) $TOMCATDIR/common/lib/jakarta-commons-dbcp-tomcat5.jar
313 ln -sf $(find-jar servlet-api) $TOMCATDIR/common/lib/servlet-api.jar
314 ln -sf $(find-jar jsp-api) $TOMCATDIR/common/lib/jsp-api.jar
316 ln -sf $(find-jar commons-modeler) $TOMCATDIR/server/lib/commons-modeler.jar
318 ln -sf $(find-jar jaxp_parser_impl) $TOMCATDIR/common/endorsed/jaxp_parser_impl.jar
319 ln -sf $(find-jar xml-commons-apis) $TOMCATDIR/common/endorsed/xml-commons-apis.jar
320 ln -sf $(find-jar struts) $TOMCATDIR/server/webapps/admin/WEB-INF/lib/struts.jar
323 # do not make these symlinks as ant didn't do
324 ln -sf $(find-jar commons-daemon) $TOMCATDIR/bin/commons-daemon.jar
325 ln -sf $(find-jar activation) $TOMCATDIR/common/lib/activation.jar
326 ln -sf $(find-jar ant) $TOMCATDIR/common/lib/ant.jar
327 ln -sf $(find-jar commons-collections) $TOMCATDIR/common/lib/commons-collections.jar
328 ln -sf $(find-jar commons-dbcp) $TOMCATDIR/common/lib/commons-dbcp.jar
329 ln -sf $(find-jar commons-logging-api) $TOMCATDIR/common/lib/commons-logging-api.jar
330 ln -sf $(find-jar commons-pool) $TOMCATDIR/common/lib/commons-pool.jar
331 ln -sf $(find-jar servlet) $TOMCATDIR/common/lib/servlet.jar
332 ln -sf $(find-jar servlet) $TOMCATDIR/common/lib/servletapi4.jar
333 ln -sf $(find-jar jdbc-stdext) $TOMCATDIR/common/lib/jdbc-stdext.jar
334 ln -sf jdbc-stdext.jar $TOMCATDIR/common/lib/jdbc2_0-stdext.jar
335 ln -sf jdbc-stdext.jar $TOMCATDIR/common/lib/jdbc-stdext-2.0.jar
336 ln -sf $(find-jar jmxri) $TOMCATDIR/common/lib/jmxri.jar
337 ln -sf $(find-jar jndi) $TOMCATDIR/common/lib/jndi.jar
338 %{?with_jta:ln -sf $(find-jar jta) $TOMCATDIR/common/lib/jta.jar}
339 ln -sf $(find-jar mail) $TOMCATDIR/common/lib/mail.jar
340 ln -sf $(find-jar jsse) $TOMCATDIR/common/lib/jsse.jar
341 ln -sf $(find-jar junit) $TOMCATDIR/common/lib/junit.jar
342 ln -sf $(find-jar mailapi) $TOMCATDIR/common/lib/mailapi.jar
343 ln -sf $(find-jar pop3) $TOMCATDIR/common/lib/pop3.jar
344 ln -sf pop3.jar $TOMCATDIR/common/lib/pop.jar
345 ln -sf $(find-jar smtp) $TOMCATDIR/common/lib/smtp.jar
346 ln -sf $(find-jar imap) $TOMCATDIR/common/lib/imap.jar
347 ln -sf $(find-jar commons-beanutils) $TOMCATDIR/server/lib/commons-beanutils.jar
348 ln -sf $(find-jar commons-digester) $TOMCATDIR/server/lib/commons-digester.jar
349 ln -sf $(find-jar commons-fileupload) $TOMCATDIR/server/lib/commons-fileupload.jar
350 ln -sf $(find-jar commons-logging) $TOMCATDIR/server/lib/commons-logging.jar
351 ln -sf $(find-jar jaas) $TOMCATDIR/server/lib/jaas.jar
352 ln -sf $(find-jar regexp) $TOMCATDIR/server/lib/regexp.jar
353 ln -sf $(find-jar regexp) $TOMCATDIR/server/lib/jakarta-regexp-1.2.jar
354 ln -sf $(find-jar regexp) $TOMCATDIR/server/lib/regexp-1.2.jar
357 ln -sf $(find-jar jaxp_parser_impl) $TOMCATDIR/common/endorsed/jaxp_parser_impl.jar
358 ln -sf $(find-jar xml-commons-apis) $TOMCATDIR/common/endorsed/xml-commons-apis.jar
359 ln -sf $(find-jar struts-core) $TOMCATDIR/server/webapps/admin/WEB-INF/lib/struts-core.jar
361 install -d $RPM_BUILD_ROOT%{_javadir}
362 mv $TOMCATDIR/common/lib/jasper* $RPM_BUILD_ROOT%{_javadir}
363 ln -sf %{_javadir}/jasper-compiler-jdt.jar $TOMCATDIR/common/lib/
364 ln -sf %{_javadir}/jasper-compiler.jar $TOMCATDIR/common/lib/
365 ln -sf %{_javadir}/jasper-runtime.jar $TOMCATDIR/common/lib/
368 rm -rf $RPM_BUILD_ROOT
371 %groupadd -g 234 -r -f tomcat
372 %useradd -u 234 -r -d /var/lib/tomcat -s /bin/false -c "Tomcat User" -g tomcat tomcat
375 /sbin/chkconfig --add tomcat
376 %service tomcat restart
379 if [ "$1" = "0" ]; then
381 /sbin/chkconfig --del tomcat
385 if [ "$1" = "0" ]; then
391 %defattr(644,root,root,755)
392 %doc build/{RELEASE-NOTES,RUNNING.txt}
393 %attr(754,root,root) /etc/rc.d/init.d/tomcat
394 %config(noreplace) %verify(not md5 mtime size) /etc/sysconfig/tomcat
397 %dir %{_tomcatdir}/conf
398 %dir %{_tomcatdir}/bin
399 %{_tomcatdir}/bin/catalina-tasks.xml
400 %{_tomcatdir}/bin/jkstatus-tasks.xml
401 %{_tomcatdir}/bin/jmxaccessor-tasks.xml
402 %attr(755,root,root) %{_tomcatdir}/bin/*.sh
403 %{_tomcatdir}/bin/*.jar
404 %dir %{_tomcatdir}/common
405 %dir %{_tomcatdir}/common/classes
406 %dir %{_tomcatdir}/common/endorsed
407 %dir %{_tomcatdir}/common/i18n
408 %{_tomcatdir}/common/endorsed/*.jar
409 %{_tomcatdir}/common/i18n/tomcat-i18n-en.jar
410 %lang(es) %{_tomcatdir}/common/i18n/tomcat-i18n-es.jar
411 %lang(fr) %{_tomcatdir}/common/i18n/tomcat-i18n-fr.jar
412 %lang(ja) %{_tomcatdir}/common/i18n/tomcat-i18n-ja.jar
413 %{_tomcatdir}/common/lib
414 %dir %{_tomcatdir}/server
415 %dir %{_tomcatdir}/server/classes
416 %{_tomcatdir}/server/lib
417 %{_tomcatdir}/server/webapps/host-manager
418 %{_tomcatdir}/server/webapps/manager
419 %{_tomcatdir}/webapps
423 %dir %{_vardir}/conf/Catalina
424 %dir %{_vardir}/conf/Catalina/localhost
425 # tomcat config has to be writeable because of tomacta-users.xml file and Catalina dir
426 %config(noreplace) %attr(664,root,tomcat) %verify(not md5 mtime size) %{_vardir}/conf/MANIFEST.MF
427 %config(noreplace) %attr(664,root,tomcat) %verify(not md5 mtime size) %{_vardir}/conf/catalina.policy
428 %config(noreplace) %attr(664,root,tomcat) %verify(not md5 mtime size) %{_vardir}/conf/*.properties*
429 %config(noreplace) %attr(664,root,tomcat) %verify(not md5 mtime size) %{_vardir}/conf/*.manifest
430 %config(noreplace) %attr(664,root,tomcat) %verify(not md5 mtime size) %{_vardir}/conf/*.xml
431 %config(noreplace) %attr(664,root,tomcat) %verify(not md5 mtime size) %{_vardir}/conf/Catalina/localhost/balancer.xml
432 %config(noreplace) %attr(664,root,tomcat) %verify(not md5 mtime size) %{_vardir}/conf/Catalina/localhost/host-manager.xml
433 %config(noreplace) %attr(664,root,tomcat) %verify(not md5 mtime size) %{_vardir}/conf/Catalina/localhost/jsp-examples.xml
434 %config(noreplace) %attr(664,root,tomcat) %verify(not md5 mtime size) %{_vardir}/conf/Catalina/localhost/manager.xml
435 %config(noreplace) %attr(664,root,tomcat) %verify(not md5 mtime size) %{_vardir}/conf/Catalina/localhost/ROOT.xml
436 %config(noreplace) %attr(664,root,tomcat) %verify(not md5 mtime size) %{_vardir}/conf/Catalina/localhost/tomcat-docs.xml
437 %config(noreplace) %attr(664,root,tomcat) %verify(not md5 mtime size) %{_vardir}/conf/Catalina/localhost/webdav.xml
438 %dir %attr(1730,root,tomcat) %{_vardir}/work
439 %dir %attr(775,root,tomcat) %{_vardir}/webapps
440 %dir %attr(775,root,tomcat) %{_vardir}/temp
441 %dir %attr(775,root,tomcat) %{_logdir}/tomcat
446 %defattr(644,root,root,755)
451 %defattr(644,root,root,755)
452 %config(noreplace) %attr(664,root,tomcat) %verify(not md5 mtime size) %{_vardir}/conf/Catalina/localhost/admin.xml
453 %{_tomcatdir}/server/webapps/admin
456 %defattr(644,root,root,755)
457 %{_javadir}/jasper-compiler-jdt.jar
458 %{_javadir}/jasper-compiler.jar
459 %{_javadir}/jasper-runtime.jar