3 %bcond_without javadoc # skip building javadocs
4 %bcond_without java_sun # build with gcj (does not work)
5 %bcond_without webservices # skip building webservices
8 %define servletapiver 2.5
10 %include /usr/lib/rpm/macros.java
11 Summary: Apache Servlet/JSP Engine, RI for Servlet %{servletapiver}/JSP %{jspapiver}API
12 Summary(pl.UTF-8): Silnik Servlet/JSP Apache będący wzorcową implementacją API Servlet %{servletapiver}/JSP %{jspapiver}
17 Group: Networking/Daemons/Java
18 Source0: http://www.apache.org/dist/tomcat/tomcat-6/v%{version}/src/apache-%{name}-%{version}-src.tar.gz
19 # Source0-md5: 44f49e7e14028b6a53c3c346bd18c72f
20 Source1: apache-%{name}.init
21 Source2: apache-%{name}.sysconfig
22 Source3: %{name}-build.properties
23 Source10: %{name}-context-ROOT.xml
24 Source11: %{name}-context-docs.xml
25 Source12: %{name}-context-manager.xml
26 Source13: %{name}-context-host-manager.xml
27 Source14: %{name}-context-examples.xml
28 Patch0: %{name}-build.xml.patch
29 Patch1: %{name}-extras.xml.patch
30 URL: http://tomcat.apache.org/
31 BuildRequires: apr-devel
32 BuildRequires: autoconf
33 BuildRequires: libtool
34 BuildRequires: openssl-devel
36 BuildRequires: java-sun >= 1.5
37 BuildRequires: java-sun-jre >= 1.5
39 BuildRequires: java-gcj-compat-devel
41 BuildRequires: ant >= 1.5.3
42 BuildRequires: ant-trax
43 BuildRequires: eclipse-jdt >= 3.2
44 BuildRequires: java-commons-collections >= 0:2.0
45 BuildRequires: java-commons-daemon >= 1.0
46 BuildRequires: java-commons-dbcp >= 0:1.1
47 BuildRequires: java-commons-dbcp-tomcat5 >= 0:1.1
48 %if %{with webservices}
49 BuildRequires: java(JSR109)
50 BuildRequires: java-geronimo-spec-jaxrpc
52 BuildRequires: jpackage-utils
53 BuildRequires: rpmbuild(macros) >= 1.300
54 Requires(post,postun): /sbin/ldconfig
55 Requires(post,preun): /sbin/chkconfig
56 Requires(postun): /usr/sbin/groupdel
57 Requires(postun): /usr/sbin/userdel
58 Requires(pre): /bin/id
59 Requires(pre): /usr/bin/getgid
60 Requires(pre): /usr/sbin/groupadd
61 Requires(pre): /usr/sbin/useradd
62 Requires: %{name}-jasper = %{version}-%{release}
63 Requires: java-servletapi = %{epoch}:%{version}-%{release}
64 Requires: java-sun-jre >= 1.2
65 Requires: jaxp_parser_impl
66 Requires: jndi >= 1.2.1
68 Provides: group(servlet)
69 Provides: group(tomcat)
70 Provides: user(tomcat)
71 Obsoletes: apache-tomcat
72 Obsoletes: jakarta-tomcat
74 BuildRoot: %{tmpdir}/%{name}-%{version}-root-%(id -u -n)
76 %define _tomcatdir %{_datadir}/tomcat
77 %define _logdir %{_var}/log
78 %define _vardir %{_var}/lib/tomcat
79 %define _sysconfdir /etc/tomcat
81 %define find_jar() %{expand:%%define jarfile {%(jar=$(find-jar %1); echo ${jar:-%%nil})}}%{?jarfile}%{!?jarfile:%{error:find-jar %1 failed}}%{nil}
84 Tomcat is the servlet container that is used in the official Reference
85 Implementation for the Java Servlet and JavaServer Pages technologies.
86 The Java Servlet and JavaServer Pages specifications are developed by
87 Sun under the Java Community Process.
89 Tomcat is developed in an open and participatory environment and
90 released under the Apache Software License. Tomcat is intended to be a
91 collaboration of the best-of-breed developers from around the world.
92 We invite you to participate in this open development project.
94 %description -l pl.UTF-8
95 Tomcat to kontener serwletowy używany przez oficjalną implementację
96 wzorcową technologii Java Servlet i JavaServer Pages. Specyfikacje
97 Java Servlet i JavaServer Pages są rozwijane przez Suna zgodnie z Java
101 Summary: The Apache Tomcat Servlet/JSP Container documentation
102 Summary(pl.UTF-8): Dokumentacja do Tomcata - kontenera Servlet/JSP
104 Obsoletes: apache-tomcat-doc
105 Obsoletes: jakarta-tomcat-doc
106 Obsoletes: tomcat-doc
108 %description webapp-docs
109 The Tomcat Servlet/JSP Container documentation.
111 %description webapp-docs -l pl.UTF-8
112 Dokumentacja do Tomcata - kontenera Servlet/JSP.
114 %package webapp-manager
115 Summary: The Apache Tomcat Servlet/JSP application manager
116 Summary(pl.UTF-8): Zarządca aplikacji w Tomcacie
117 Group: Networking/Daemons/Java/Servlets
119 %description webapp-manager
120 The Apache Tomcat Servlet/JSP application manager.
122 %description webapp-manager -l pl.UTF-8
123 Zarządca aplikacji w Tomcacie.
125 %package webapp-host-manager
126 Summary: The Apache Tomcat Servlet/JSP virtual hosts manager
127 Summary(pl.UTF-8): Zarządca wirtualnych hostów w Tomcacie
128 Group: Networking/Daemons/Java/Servlets
129 Obsoletes: tomcat-admin
131 %description webapp-host-manager
132 The Apache Tomcat Servlet/JSP virtual hosts manager.
134 %description webapp-host-manager -l pl.UTF-8
135 Zarządca wirtualnych hostów w Tomcacie.
137 %package webapp-examples
138 Summary: The Apache Tomcat Servlet/JSP example applications
139 Summary(pl.UTF-8): Przykładowe aplikacje dla Tomcata
140 Group: Networking/Daemons/Java/Servlets
142 %description webapp-examples
143 The Apache Tomcat Servlet/JSP example applications.
145 %description webapp-examples -l pl.UTF-8
146 Przykładowe aplikacje dla Tomcata.
149 Summary: Web Services support (JSR 109)
150 Group: Libraries/Java
151 Requires: java(JSR109)
152 Requires: java-geronimo-spec-jaxrpc
154 %description webservices
155 Factories for JSR 109 which may be used to resolve web services
159 Summary: JSP compiler
160 Summary(pl.UTF-8): Kompilator JSP
161 Group: Libraries/Java
162 Requires: jpackage-utils
163 Obsoletes: apache-tomcat-jasper
166 Jasper is Java ServerPages compiler used by Apache Tomcat servlet
169 %description jasper -l pl.UTF-8
170 Jasper jest kompilatorem Java ServerPages używanym przez kontener
171 servletów Apache Tomcat.
173 %package -n java-servletapi
174 Summary: Java servlet and JSP implementation classes
175 Summary(pl.UTF-8): Klasy z implementacją Java Servlet i JSP
176 Group: Libraries/Java
177 Provides: java(JSP) = %{jspapiver}
178 Provides: java(Servlet) = %{servletapiver}
179 Obsoletes: java-servletapi5
181 %description -n java-servletapi
182 Implementation classes of the Java Servlet and JSP APIs (packages
183 javax.servlet, javax.servlet.http, javax.servlet.jsp, and
184 javax.servlet.jsp.tagext).
186 %description -n java-servletapi -l pl.UTF-8
187 Implementacje klas API Java Servlet i JSP (pakiety javax.servlet,
188 javax.servlet.http, javax.servlet.jsp i java.servlet.jsp.tagext).
191 %setup -q -n apache-%{name}-%{version}-src
196 # we don't need those scripts
198 rm bin/{startup,shutdown}.sh
200 cp %{SOURCE3} build.properties
205 %ant -Drpm.javadir=%{_javadir} -Drpm.libdir=%{_libdir}
208 %ant -f dist.xml dist-javadoc
211 %if %{with webservices}
212 mkdir -p output/extras/webservices
214 ln -s %{_javadir}/geronimo-spec-jaxrpc.jar output/extras/webservices/jaxrpc.jar
215 ln -s %{_javadir}/jsr109.jar output/extras/webservices/wsdl4j.jar
217 %ant -f extras.xml webservices
222 rm -rf $RPM_BUILD_ROOT
225 TOMCATDIR=$RPM_BUILD_ROOT%{_tomcatdir}
226 CATALINADIR=$RPM_BUILD_ROOT/var/lib/tomcat
228 install -d $TOMCATDIR \
230 $RPM_BUILD_ROOT%{_vardir}/webapps \
231 $RPM_BUILD_ROOT%{_vardir}/work \
232 $RPM_BUILD_ROOT%{_vardir}/conf \
233 $RPM_BUILD_ROOT%{_logdir}/tomcat \
234 $RPM_BUILD_ROOT/etc/sysconfig \
235 $RPM_BUILD_ROOT/etc/rc.d/init.d
237 install %{SOURCE1} $RPM_BUILD_ROOT/etc/rc.d/init.d/tomcat
238 install %{SOURCE2} $RPM_BUILD_ROOT/etc/sysconfig/tomcat
240 cp -a conf/* $CATALINADIR/conf
241 install -d $CATALINADIR/conf/Catalina/localhost
242 install %{SOURCE10} $CATALINADIR/conf/Catalina/localhost/ROOT.xml
243 install %{SOURCE11} $CATALINADIR/conf/Catalina/localhost/docs.xml
244 install %{SOURCE12} $CATALINADIR/conf/Catalina/localhost/manager.xml
245 install %{SOURCE13} $CATALINADIR/conf/Catalina/localhost/host-manager.xml
246 install %{SOURCE14} $CATALINADIR/conf/Catalina/localhost/examples.xml
248 cp -a bin lib webapps $TOMCATDIR
249 cp -a temp $CATALINADIR
251 ln -sf %{_logdir}/tomcat $CATALINADIR/logs
252 ln -sf %{_logdir}/tomcat $TOMCATDIR/logs
253 ln -sf %{_vardir}/work $TOMCATDIR/work
254 ln -sf %{_vardir}/conf $TOMCATDIR/conf
255 ln -sf %{_vardir}/conf $RPM_BUILD_ROOT%{_sysconfdir}
257 # symlinks instead of copies
258 jars="commons-daemon commons-logging-api commons-dbcp-tomcat5 commons-pool-tomcat5"
261 ln -sf $jar $TOMCATDIR/bin
264 install -d $RPM_BUILD_ROOT%{_javadir}
265 mv $TOMCATDIR/lib/jasper*.jar $RPM_BUILD_ROOT%{_javadir}
266 mv $TOMCATDIR/lib/jsp-api.jar $RPM_BUILD_ROOT%{_javadir}/jsp-api-%{jspapiver}.jar
267 mv $TOMCATDIR/lib/servlet-api.jar $RPM_BUILD_ROOT%{_javadir}/servlet-api-%{servletapiver}.jar
269 ln -s jsp-api-%{jspapiver}.jar $RPM_BUILD_ROOT%{_javadir}/jsp-api.jar
270 ln -s servlet-api-%{servletapiver}.jar $RPM_BUILD_ROOT%{_javadir}/servlet-api.jar
272 # XXX add softlinks jasper-compiler.jar and jasper-runtime for compatibility with tomcat 5.5?
273 ln -sf %{_javadir}/jasper-compiler-jdt.jar $TOMCATDIR/lib
274 ln -sf %{_javadir}/jasper-el.jar $TOMCATDIR/lib
275 ln -sf %{_javadir}/jasper.jar $TOMCATDIR/lib
277 ln -sf %{_javadir}/jsp-api-%{jspapiver}.jar $TOMCATDIR/lib
278 ln -sf %{_javadir}/servlet-api-%{servletapiver}.jar $TOMCATDIR/lib
280 %if %{with webservices}
281 install ../extras/catalina-ws.jar $TOMCATDIR/lib/catalina-ws.jar
283 ln -s %{_javadir}/geronimo-spec-jaxrpc.jar $TOMCATDIR/lib/jaxrpc.jar
284 ln -s %{_javadir}/jsr109.jar $TOMCATDIR/lib/jsr109.jar
288 rm -rf $RPM_BUILD_ROOT
291 %groupadd -g 234 -r -f tomcat
292 %groupadd -g 237 -r -f servlet
293 %useradd -u 234 -r -d /var/lib/tomcat -s /bin/false -c "Tomcat User" -g tomcat -G servlet tomcat
296 /sbin/chkconfig --add tomcat
297 %service tomcat restart
300 if [ "$1" = "0" ]; then
302 /sbin/chkconfig --del tomcat
306 if [ "$1" = "0" ]; then
313 %defattr(644,root,root,755)
314 %doc KEYS RELEASE-NOTES RELEASE-PLAN-6.0.txt RUNNING.txt
315 %attr(754,root,root) /etc/rc.d/init.d/tomcat
316 %config(noreplace) %verify(not md5 mtime size) /etc/sysconfig/tomcat
319 %dir %{_tomcatdir}/conf
320 %dir %{_tomcatdir}/bin
321 %{_tomcatdir}/bin/catalina-tasks.xml
322 %attr(755,root,root) %{_tomcatdir}/bin/*.sh
323 %{_tomcatdir}/bin/*.jar
324 %dir %{_tomcatdir}/lib
325 %{_tomcatdir}/lib/annotations-api.jar
326 %{_tomcatdir}/lib/catalina.jar
327 %{_tomcatdir}/lib/commons-dbcp-tomcat5.jar
328 %{_tomcatdir}/lib/commons-pool-tomcat5.jar
329 %{_tomcatdir}/lib/jasper-el.jar
330 %{_tomcatdir}/lib/jsp-api-2.1.jar
331 %{_tomcatdir}/lib/tomcat-i18n-es.jar
332 %{_tomcatdir}/lib/catalina-ant.jar
333 %{_tomcatdir}/lib/catalina-tribes.jar
334 %{_tomcatdir}/lib/el-api.jar
335 %{_tomcatdir}/lib/jasper.jar
336 %{_tomcatdir}/lib/servlet-api-2.5.jar
337 %{_tomcatdir}/lib/tomcat-i18n-fr.jar
338 %{_tomcatdir}/lib/catalina-ha.jar
339 %{_tomcatdir}/lib/jasper-compiler-jdt.jar
340 %{_tomcatdir}/lib/tomcat-coyote.jar
341 %{_tomcatdir}/lib/tomcat-i18n-ja.jar
343 %dir %{_tomcatdir}/webapps
345 %config(noreplace) %attr(664,root,tomcat) %verify(not md5 mtime size) %{_vardir}/conf/Catalina/localhost/ROOT.xml
346 %{_tomcatdir}/webapps/ROOT
351 # these directory has to be writeable because /admin need to modify config
352 # files and create temporary files
353 %dir %attr(775,root,tomcat) %{_vardir}/conf
354 %dir %attr(775,root,tomcat) %{_vardir}/conf/Catalina
355 %dir %{_vardir}/conf/Catalina/localhost
356 # tomcat config has to be writeable because of tomcat-users.xml file and Catalina dir
357 %config(noreplace) %attr(660,root,tomcat) %verify(not md5 mtime size) %{_vardir}/conf/catalina.policy
358 %config(noreplace) %attr(660,root,tomcat) %verify(not md5 mtime size) %{_vardir}/conf/*.properties*
359 %config(noreplace) %attr(660,root,tomcat) %verify(not md5 mtime size) %{_vardir}/conf/*.xml
360 %dir %attr(1730,root,tomcat) %{_vardir}/work
361 %dir %attr(775,root,tomcat) %{_vardir}/webapps
362 %dir %attr(775,root,tomcat) %{_vardir}/temp
363 %dir %attr(775,root,tomcat) %{_logdir}/tomcat
367 %defattr(644,root,root,755)
368 %config(noreplace) %attr(664,root,tomcat) %verify(not md5 mtime size) %{_vardir}/conf/Catalina/localhost/docs.xml
369 %{_tomcatdir}/webapps/docs
371 %files webapp-manager
372 %defattr(644,root,root,755)
373 %config(noreplace) %attr(664,root,tomcat) %verify(not md5 mtime size) %{_vardir}/conf/Catalina/localhost/manager.xml
374 %{_tomcatdir}/webapps/manager
376 %files webapp-host-manager
377 %defattr(644,root,root,755)
378 %config(noreplace) %attr(664,root,tomcat) %verify(not md5 mtime size) %{_vardir}/conf/Catalina/localhost/host-manager.xml
379 %{_tomcatdir}/webapps/host-manager
381 %files webapp-examples
382 %defattr(644,root,root,755)
383 %config(noreplace) %attr(664,root,tomcat) %verify(not md5 mtime size) %{_vardir}/conf/Catalina/localhost/examples.xml
384 %{_tomcatdir}/webapps/examples
386 %if %{with webservices}
388 %defattr(644,root,root,755)
389 %{_tomcatdir}/lib/jsr109.jar
390 %{_tomcatdir}/lib/jaxrpc.jar
391 %{_tomcatdir}/lib/catalina-ws.jar
395 %defattr(644,root,root,755)
396 %{_javadir}/jasper-compiler-jdt.jar
397 %{_javadir}/jasper-el.jar
398 %{_javadir}/jasper.jar
400 %files -n java-servletapi
401 %defattr(644,root,root,755)
402 %{_javadir}/jsp-api*.jar
403 %{_javadir}/servlet-api*.jar