2 # - review dependencies
3 # - packages for *.renametojar files (-cgi and -ssi in server/lib)
5 %bcond_without javadoc # skip building javadocs
6 %bcond_without java_sun # build with gcj (does not work)
7 %bcond_without webservices # skip building webservices
11 %define servletapiver 2.5
13 Summary: Apache Servlet/JSP Engine, RI for Servlet %{servletapiver}/JSP %{jspapiver}API
14 Summary(pl.UTF-8): Silnik Servlet/JSP Apache będący wzorcową implementacją API Servlet %{servletapiver}/JSP %{jspapiver}
19 Group: Networking/Daemons/Java
20 Source0: http://www.apache.org/dist/tomcat/tomcat-6/v%{version}/src/apache-%{name}-%{version}-src.tar.gz
21 # Source0-md5: 44f49e7e14028b6a53c3c346bd18c72f
22 Source1: apache-%{name}.init
23 Source2: apache-%{name}.sysconfig
24 Source3: %{name}-build.properties
25 Source10: %{name}-context-ROOT.xml
26 Source11: %{name}-context-docs.xml
27 Source12: %{name}-context-manager.xml
28 Source13: %{name}-context-host-manager.xml
29 Source14: %{name}-context-examples.xml
30 Patch0: %{name}-build.xml.patch
31 Patch1: %{name}-extras.xml.patch
32 URL: http://tomcat.apache.org/
33 BuildRequires: apr-devel
34 BuildRequires: autoconf
35 BuildRequires: libtool
36 BuildRequires: openssl-devel
38 BuildRequires: java-sun >= 1.5
39 BuildRequires: java-sun-jre >= 1.5
41 BuildRequires: java-gcj-compat-devel
43 BuildRequires: ant >= 1.5.3
44 BuildRequires: ant-trax
45 BuildRequires: eclipse-jdt >= 3.2
46 BuildRequires: java-commons-collections >= 0:2.0
47 BuildRequires: java-commons-daemon >= 1.0
48 BuildRequires: java-commons-dbcp >= 0:1.1
49 BuildRequires: java-commons-dbcp-tomcat5 >= 0:1.1
50 %if %{with webservices}
51 BuildRequires: java-geronimo-spec-jaxrpc
52 BuildRequires: java(JSR109)
54 BuildRequires: jpackage-utils
55 BuildRequires: rpmbuild(macros) >= 1.300
56 Requires(post,postun): /sbin/ldconfig
57 Requires(post,preun): /sbin/chkconfig
58 Requires(postun): /usr/sbin/groupdel
59 Requires(postun): /usr/sbin/userdel
60 Requires(pre): /bin/id
61 Requires(pre): /usr/bin/getgid
62 Requires(pre): /usr/sbin/groupadd
63 Requires(pre): /usr/sbin/useradd
64 Requires: %{name}-jasper = %{version}-%{release}
65 Requires: java-commons-daemon
66 Requires: java-commons-logging
67 Requires: java-servletapi = %{epoch}:%{version}-%{release}
68 Requires: jaxp_parser_impl
69 Requires: jndi >= 1.2.1
72 Provides: group(servlet)
73 Provides: group(tomcat)
74 Provides: user(tomcat)
75 Obsoletes: apache-tomcat
76 Obsoletes: jakarta-tomcat
78 BuildRoot: %{tmpdir}/%{name}-%{version}-root-%(id -u -n)
80 %define _tomcatdir %{_datadir}/tomcat
81 %define _logdir %{_var}/log
82 %define _vardir %{_var}/lib/tomcat
83 %define _sysconfdir /etc/tomcat
85 %define find_jar() %{expand:%%define jarfile {%(jar=$(find-jar %1); echo ${jar:-%%nil})}}%{?jarfile}%{!?jarfile:%{error:find-jar %1 failed}}%{nil}
88 Tomcat is the servlet container that is used in the official Reference
89 Implementation for the Java Servlet and JavaServer Pages technologies.
90 The Java Servlet and JavaServer Pages specifications are developed by
91 Sun under the Java Community Process.
93 Tomcat is developed in an open and participatory environment and
94 released under the Apache Software License. Tomcat is intended to be a
95 collaboration of the best-of-breed developers from around the world.
96 We invite you to participate in this open development project.
98 %description -l pl.UTF-8
99 Tomcat to kontener serwletowy używany przez oficjalną implementację
100 wzorcową technologii Java Servlet i JavaServer Pages. Specyfikacje
101 Java Servlet i JavaServer Pages są rozwijane przez Suna zgodnie z Java
105 Summary: The Apache Tomcat Servlet/JSP Container documentation
106 Summary(pl.UTF-8): Dokumentacja do Tomcata - kontenera Servlet/JSP
108 Obsoletes: apache-tomcat-doc
109 Obsoletes: jakarta-tomcat-doc
110 Obsoletes: tomcat-doc
112 %description webapp-docs
113 The Tomcat Servlet/JSP Container documentation.
115 %description webapp-docs -l pl.UTF-8
116 Dokumentacja do Tomcata - kontenera Servlet/JSP.
118 %package webapp-manager
119 Summary: The Apache Tomcat Servlet/JSP application manager
120 Summary(pl.UTF-8): Zarządca aplikacji w Tomcacie
121 Group: Networking/Daemons/Java/Servlets
123 %description webapp-manager
124 The Apache Tomcat Servlet/JSP application manager.
126 %description webapp-manager -l pl.UTF-8
127 Zarządca aplikacji w Tomcacie.
129 %package webapp-host-manager
130 Summary: The Apache Tomcat Servlet/JSP virtual hosts manager
131 Summary(pl.UTF-8): Zarządca wirtualnych hostów w Tomcacie
132 Group: Networking/Daemons/Java/Servlets
133 Obsoletes: tomcat-admin
135 %description webapp-host-manager
136 The Apache Tomcat Servlet/JSP virtual hosts manager.
138 %description webapp-host-manager -l pl.UTF-8
139 Zarządca wirtualnych hostów w Tomcacie.
141 %package webapp-examples
142 Summary: The Apache Tomcat Servlet/JSP example applications
143 Summary(pl.UTF-8): Przykładowe aplikacje dla Tomcata
144 Group: Networking/Daemons/Java/Servlets
146 %description webapp-examples
147 The Apache Tomcat Servlet/JSP example applications.
149 %description webapp-examples -l pl.UTF-8
150 Przykładowe aplikacje dla Tomcata.
153 Summary: Web Services support (JSR 109)
154 Group: Libraries/Java
155 Requires: java-geronimo-spec-jaxrpc
156 Requires: java(JSR109)
158 %description webservices
159 Factories for JSR 109 which may be used to resolve web services
163 Summary: JSP compiler
164 Summary(pl.UTF-8): Kompilator JSP
165 Group: Libraries/Java
166 Requires: jpackage-utils
167 Obsoletes: apache-tomcat-jasper
170 Jasper is Java ServerPages compiler used by Apache Tomcat servlet
173 %description jasper -l pl.UTF-8
174 Jasper jest kompilatorem Java ServerPages używanym przez kontener
175 servletów Apache Tomcat.
177 %package -n java-servletapi
178 Summary: Java servlet and JSP implementation classes
179 Summary(pl.UTF-8): Klasy z implementacją Java Servlet i JSP
180 Group: Libraries/Java
181 Provides: java(JSP) = %{jspapiver}
182 Provides: java(Servlet) = %{servletapiver}
183 Obsoletes: java-servletapi5
185 %description -n java-servletapi
186 Implementation classes of the Java Servlet and JSP APIs (packages
187 javax.servlet, javax.servlet.http, javax.servlet.jsp, and
188 javax.servlet.jsp.tagext).
190 %description -n java-servletapi -l pl.UTF-8
191 Implementacje klas API Java Servlet i JSP (pakiety javax.servlet,
192 javax.servlet.http, javax.servlet.jsp i java.servlet.jsp.tagext).
195 %setup -q -n apache-%{name}-%{version}-src
200 # we don't need those scripts
202 rm bin/{startup,shutdown}.sh
204 cp %{SOURCE3} build.properties
209 %ant -Drpm.javadir=%{_javadir} -Drpm.libdir=%{_libdir}
212 %ant -f dist.xml dist-javadoc
215 %if %{with webservices}
216 mkdir -p output/extras/webservices
218 ln -s %{_javadir}/geronimo-spec-jaxrpc.jar output/extras/webservices/jaxrpc.jar
219 ln -s %{_javadir}/jsr109.jar output/extras/webservices/wsdl4j.jar
221 %ant -f extras.xml webservices
226 rm -rf $RPM_BUILD_ROOT
229 TOMCATDIR=$RPM_BUILD_ROOT%{_tomcatdir}
230 CATALINADIR=$RPM_BUILD_ROOT/var/lib/tomcat
232 install -d $TOMCATDIR \
234 $RPM_BUILD_ROOT%{_vardir}/webapps \
235 $RPM_BUILD_ROOT%{_vardir}/work \
236 $RPM_BUILD_ROOT%{_vardir}/conf \
237 $RPM_BUILD_ROOT%{_logdir}/tomcat \
238 $RPM_BUILD_ROOT/etc/sysconfig \
239 $RPM_BUILD_ROOT/etc/rc.d/init.d
241 install %{SOURCE1} $RPM_BUILD_ROOT/etc/rc.d/init.d/tomcat
242 install %{SOURCE2} $RPM_BUILD_ROOT/etc/sysconfig/tomcat
244 cp -a conf/* $CATALINADIR/conf
245 install -d $CATALINADIR/conf/Catalina/localhost
246 install %{SOURCE10} $CATALINADIR/conf/Catalina/localhost/ROOT.xml
247 install %{SOURCE11} $CATALINADIR/conf/Catalina/localhost/docs.xml
248 install %{SOURCE12} $CATALINADIR/conf/Catalina/localhost/manager.xml
249 install %{SOURCE13} $CATALINADIR/conf/Catalina/localhost/host-manager.xml
250 install %{SOURCE14} $CATALINADIR/conf/Catalina/localhost/examples.xml
252 cp -a bin lib webapps $TOMCATDIR
253 cp -a temp $CATALINADIR
255 ln -sf %{_logdir}/tomcat $CATALINADIR/logs
256 ln -sf %{_logdir}/tomcat $TOMCATDIR/logs
257 ln -sf %{_vardir}/work $TOMCATDIR/work
258 ln -sf %{_vardir}/conf $TOMCATDIR/conf
259 ln -sf %{_vardir}/conf $RPM_BUILD_ROOT%{_sysconfdir}
261 # symlinks instead of copies
262 jars="commons-daemon commons-logging-api"
265 ln -sf $jar $TOMCATDIR/bin
268 install -d $RPM_BUILD_ROOT%{_javadir}
269 mv $TOMCATDIR/lib/jasper*.jar $RPM_BUILD_ROOT%{_javadir}
270 mv $TOMCATDIR/lib/jsp-api.jar $RPM_BUILD_ROOT%{_javadir}/jsp-api-%{jspapiver}.jar
271 mv $TOMCATDIR/lib/servlet-api.jar $RPM_BUILD_ROOT%{_javadir}/servlet-api-%{servletapiver}.jar
273 ln -s jsp-api-%{jspapiver}.jar $RPM_BUILD_ROOT%{_javadir}/jsp-api.jar
274 ln -s servlet-api-%{servletapiver}.jar $RPM_BUILD_ROOT%{_javadir}/servlet-api.jar
276 # XXX add softlinks jasper-compiler.jar and jasper-runtime for compatibility with tomcat 5.5?
277 ln -sf %{_javadir}/jasper-compiler-jdt.jar $TOMCATDIR/lib
278 ln -sf %{_javadir}/jasper-el.jar $TOMCATDIR/lib
279 ln -sf %{_javadir}/jasper.jar $TOMCATDIR/lib
281 ln -sf %{_javadir}/jsp-api-%{jspapiver}.jar $TOMCATDIR/lib
282 ln -sf %{_javadir}/servlet-api-%{servletapiver}.jar $TOMCATDIR/lib
284 %if %{with webservices}
285 install ../extras/catalina-ws.jar $TOMCATDIR/lib/catalina-ws.jar
287 ln -s %{_javadir}/geronimo-spec-jaxrpc.jar $TOMCATDIR/lib/jaxrpc.jar
288 ln -s %{_javadir}/jsr109.jar $TOMCATDIR/lib/jsr109.jar
292 rm -rf $RPM_BUILD_ROOT
295 %groupadd -g 234 -r -f tomcat
296 %groupadd -g 237 -r -f servlet
297 %useradd -u 234 -r -d /var/lib/tomcat -s /bin/false -c "Tomcat User" -g tomcat -G servlet tomcat
300 /sbin/chkconfig --add tomcat
301 %service tomcat restart
304 if [ "$1" = "0" ]; then
306 /sbin/chkconfig --del tomcat
310 if [ "$1" = "0" ]; then
317 %defattr(644,root,root,755)
318 %doc KEYS RELEASE-NOTES RELEASE-PLAN-6.0.txt RUNNING.txt
319 %attr(754,root,root) /etc/rc.d/init.d/tomcat
320 %config(noreplace) %verify(not md5 mtime size) /etc/sysconfig/tomcat
323 %dir %{_tomcatdir}/conf
324 %dir %{_tomcatdir}/bin
325 %{_tomcatdir}/bin/catalina-tasks.xml
326 %attr(755,root,root) %{_tomcatdir}/bin/*.sh
327 %{_tomcatdir}/bin/*.jar
328 %dir %{_tomcatdir}/lib
329 %{_tomcatdir}/lib/annotations-api.jar
330 %{_tomcatdir}/lib/catalina.jar
331 %{_tomcatdir}/lib/commons-dbcp-tomcat5.jar
332 %{_tomcatdir}/lib/jasper-el.jar
333 %{_tomcatdir}/lib/jsp-api-2.1.jar
334 %{_tomcatdir}/lib/tomcat-i18n-es.jar
335 %{_tomcatdir}/lib/catalina-ant.jar
336 %{_tomcatdir}/lib/catalina-tribes.jar
337 %{_tomcatdir}/lib/el-api.jar
338 %{_tomcatdir}/lib/jasper.jar
339 %{_tomcatdir}/lib/servlet-api-2.5.jar
340 %{_tomcatdir}/lib/tomcat-i18n-fr.jar
341 %{_tomcatdir}/lib/catalina-ha.jar
342 %{_tomcatdir}/lib/jasper-compiler-jdt.jar
343 %{_tomcatdir}/lib/tomcat-coyote.jar
344 %{_tomcatdir}/lib/tomcat-i18n-ja.jar
346 %dir %{_tomcatdir}/webapps
348 %config(noreplace) %attr(664,root,tomcat) %verify(not md5 mtime size) %{_vardir}/conf/Catalina/localhost/ROOT.xml
349 %{_tomcatdir}/webapps/ROOT
354 # these directory has to be writeable because /admin need to modify config
355 # files and create temporary files
356 %dir %attr(775,root,tomcat) %{_vardir}/conf
357 %dir %attr(775,root,tomcat) %{_vardir}/conf/Catalina
358 %dir %{_vardir}/conf/Catalina/localhost
359 # tomcat config has to be writeable because of tomcat-users.xml file and Catalina dir
360 %config(noreplace) %attr(664,root,tomcat) %verify(not md5 mtime size) %{_vardir}/conf/catalina.policy
361 %config(noreplace) %attr(664,root,tomcat) %verify(not md5 mtime size) %{_vardir}/conf/*.properties*
362 %config(noreplace) %attr(664,root,tomcat) %verify(not md5 mtime size) %{_vardir}/conf/*.xml
363 %dir %attr(1730,root,tomcat) %{_vardir}/work
364 %dir %attr(775,root,tomcat) %{_vardir}/webapps
365 %dir %attr(775,root,tomcat) %{_vardir}/temp
366 %dir %attr(775,root,tomcat) %{_logdir}/tomcat
370 %defattr(644,root,root,755)
371 %config(noreplace) %attr(664,root,tomcat) %verify(not md5 mtime size) %{_vardir}/conf/Catalina/localhost/docs.xml
372 %{_tomcatdir}/webapps/docs
374 %files webapp-manager
375 %defattr(644,root,root,755)
376 %config(noreplace) %attr(664,root,tomcat) %verify(not md5 mtime size) %{_vardir}/conf/Catalina/localhost/manager.xml
377 %{_tomcatdir}/webapps/manager
379 %files webapp-host-manager
380 %defattr(644,root,root,755)
381 %config(noreplace) %attr(664,root,tomcat) %verify(not md5 mtime size) %{_vardir}/conf/Catalina/localhost/host-manager.xml
382 %{_tomcatdir}/webapps/host-manager
384 %files webapp-examples
385 %defattr(644,root,root,755)
386 %config(noreplace) %attr(664,root,tomcat) %verify(not md5 mtime size) %{_vardir}/conf/Catalina/localhost/examples.xml
387 %{_tomcatdir}/webapps/examples
389 %if %{with webservices}
391 %defattr(644,root,root,755)
392 %{_tomcatdir}/lib/jsr109.jar
393 %{_tomcatdir}/lib/jaxrpc.jar
394 %{_tomcatdir}/lib/catalina-ws.jar
398 %defattr(644,root,root,755)
399 %{_javadir}/jasper-compiler-jdt.jar
400 %{_javadir}/jasper-el.jar
401 %{_javadir}/jasper.jar
403 %files -n java-servletapi
404 %defattr(644,root,root,755)
405 %{_javadir}/jsp-api*.jar
406 %{_javadir}/servlet-api*.jar