]> git.pld-linux.org Git - packages/tomcat.git/blame_incremental - tomcat.spec
- jasper subpackage must not create symlinks in tomcat dirs. These links should
[packages/tomcat.git] / tomcat.spec
... / ...
CommitLineData
1
2# Conditional build:
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
6
7%define jspapiver 2.1
8%define servletapiver 2.5
9
10%include /usr/lib/rpm/macros.java
11Summary: Web server and Servlet/JSP Engine, RI for Servlet %{servletapiver}/JSP %{jspapiver}API
12Summary(pl.UTF-8): Serwer www i silnik Servlet/JSP będący wzorcową implementacją API Servlet %{servletapiver}/JSP %{jspapiver}
13Name: tomcat
14Version: 6.0.20
15Release: 6
16License: Apache v2.0
17Group: Networking/Daemons/Java
18Source0: http://www.apache.org/dist/tomcat/tomcat-6/v%{version}/src/apache-%{name}-%{version}-src.tar.gz
19# Source0-md5: 44f49e7e14028b6a53c3c346bd18c72f
20Source1: apache-%{name}.init
21Source2: apache-%{name}.sysconfig
22Source3: %{name}-build.properties
23Source10: %{name}-context-ROOT.xml
24Source11: %{name}-context-docs.xml
25Source12: %{name}-context-manager.xml
26Source13: %{name}-context-host-manager.xml
27Source14: %{name}-context-examples.xml
28Patch0: %{name}-build.xml.patch
29Patch1: %{name}-extras.xml.patch
30URL: http://tomcat.apache.org/
31BuildRequires: apr-devel
32BuildRequires: autoconf
33BuildRequires: libtool
34BuildRequires: openssl-devel
35%if %{with java_sun}
36BuildRequires: java-sun >= 1.5
37BuildRequires: java-sun-jre >= 1.5
38%else
39BuildRequires: java-gcj-compat-devel
40%endif
41BuildRequires: ant >= 1.5.3
42BuildRequires: ant-trax
43BuildRequires: eclipse-jdt >= 3.2
44BuildRequires: java-commons-collections >= 0:2.0
45BuildRequires: java-commons-daemon >= 1.0
46BuildRequires: java-commons-dbcp-tomcat5 >= 0:1.1
47BuildRequires: java-commons-pool-tomcat5
48%if %{with webservices}
49BuildRequires: java(JSR109)
50BuildRequires: java-geronimo-spec-jaxrpc
51%endif
52BuildRequires: jpackage-utils
53BuildRequires: rpmbuild(macros) >= 1.300
54Requires(post,preun): /sbin/chkconfig
55Requires(postun): /usr/sbin/groupdel
56Requires(postun): /usr/sbin/userdel
57Requires(pre): /bin/id
58Requires(pre): /usr/bin/getgid
59Requires(pre): /usr/sbin/groupadd
60Requires(pre): /usr/sbin/useradd
61Requires: %{name}-catalina = %{epoch}:%{version}-%{release}
62Requires: %{name}-coyote = %{epoch}:%{version}-%{release}
63Requires: %{name}-jasper = %{epoch}:%{version}-%{release}
64Requires: java-commons-dbcp-tomcat5 >= 0:1.1
65Requires: java-commons-pool-tomcat5
66Requires: java-jdbc-mysql
67Requires: java-servletapi = %{epoch}:%{version}-%{release}
68Requires: java-sun-jre >= 1.2
69Requires: jaxp_parser_impl
70Requires: jndi >= 1.2.1
71Requires: rc-scripts
72Suggests: tomcat-native
73Provides: group(servlet)
74Provides: group(tomcat)
75Provides: user(tomcat)
76Obsoletes: apache-tomcat
77Obsoletes: jakarta-tomcat
78BuildArch: noarch
79BuildRoot: %{tmpdir}/%{name}-%{version}-root-%(id -u -n)
80
81%define _tomcatdir %{_datadir}/tomcat
82%define _logdir %{_var}/log
83%define _vardir %{_var}/lib/tomcat
84%define _sysconfdir /etc/tomcat
85
86%define find_jar() %{expand:%%define jarfile {%(jar=$(find-jar %1); echo ${jar:-%%nil})}}%{?jarfile}%{!?jarfile:%{error:find-jar %1 failed}}%{nil}
87
88%description
89Tomcat is the servlet container that is used in the official Reference
90Implementation for the Java Servlet and JavaServer Pages technologies.
91The Java Servlet and JavaServer Pages specifications are developed by
92Sun under the Java Community Process.
93
94Tomcat is developed in an open and participatory environment and
95released under the Apache Software License. Tomcat is intended to be a
96collaboration of the best-of-breed developers from around the world.
97We invite you to participate in this open development project.
98
99%description -l pl.UTF-8
100Tomcat to kontener serwletowy używany przez oficjalną implementację
101wzorcową technologii Java Servlet i JavaServer Pages. Specyfikacje
102Java Servlet i JavaServer Pages są rozwijane przez Suna zgodnie z Java
103Community Process.
104
105%package webapp-docs
106Summary: The Apache Tomcat Servlet/JSP Container documentation
107Summary(pl.UTF-8): Dokumentacja do Tomcata - kontenera Servlet/JSP
108Group: Documentation
109Obsoletes: apache-tomcat-doc
110Obsoletes: jakarta-tomcat-doc
111Obsoletes: tomcat-doc
112
113%description webapp-docs
114The Tomcat Servlet/JSP Container documentation.
115
116%description webapp-docs -l pl.UTF-8
117Dokumentacja do Tomcata - kontenera Servlet/JSP.
118
119%package webapp-manager
120Summary: The Apache Tomcat Servlet/JSP application manager
121Summary(pl.UTF-8): Zarządca aplikacji w Tomcacie
122Group: Networking/Daemons/Java/Servlets
123Requires: %{name} = %{epoch}:%{version}-%{release}
124
125%description webapp-manager
126The Apache Tomcat Servlet/JSP application manager.
127
128%description webapp-manager -l pl.UTF-8
129Zarządca aplikacji w Tomcacie.
130
131%package webapp-host-manager
132Summary: The Apache Tomcat Servlet/JSP virtual hosts manager
133Summary(pl.UTF-8): Zarządca wirtualnych hostów w Tomcacie
134Group: Networking/Daemons/Java/Servlets
135Requires: %{name} = %{epoch}:%{version}-%{release}
136Obsoletes: tomcat-admin
137
138%description webapp-host-manager
139The Apache Tomcat Servlet/JSP virtual hosts manager.
140
141%description webapp-host-manager -l pl.UTF-8
142Zarządca wirtualnych hostów w Tomcacie.
143
144%package webapp-examples
145Summary: The Apache Tomcat Servlet/JSP example applications
146Summary(pl.UTF-8): Przykładowe aplikacje dla Tomcata
147Group: Networking/Daemons/Java/Servlets
148Requires: %{name} = %{epoch}:%{version}-%{release}
149
150%description webapp-examples
151The Apache Tomcat Servlet/JSP example applications.
152
153%description webapp-examples -l pl.UTF-8
154Przykładowe aplikacje dla Tomcata.
155
156%package webservices
157Summary: Web Services support (JSR 109)
158Group: Libraries/Java
159Requires: %{name} = %{epoch}:%{version}-%{release}
160Requires: java(JSR109)
161Requires: java-geronimo-spec-jaxrpc
162
163%description webservices
164Factories for JSR 109 which may be used to resolve web services
165references.
166
167%package catalina
168Summary: Tomcat's servlet container
169Group: Libraries/Java
170Requires: jpackage-utils
171
172%description catalina
173Catalina is Tomcat's servlet container. Catalina implements Sun
174Microsystems' specifications for servlet and JavaServer Pages (JSP).
175
176%package coyote
177Summary: Tomcat HTTP connector
178Group: Libraries/Java
179Requires: jpackage-utils
180
181%description coyote
182Coyote is Tomcat's HTTP Connector component that supports the HTTP 1.1
183protocol for the web server or application container. Coyote listens
184for incoming connections on a specific TCP port on the server and
185forwards the request to the Tomcat Engine to process the request and
186send back a response to the requesting client.
187
188%package jasper
189Summary: JSP compiler
190Summary(pl.UTF-8): Kompilator JSP
191Group: Libraries/Java
192Requires: eclipse-jdt >= 3.2
193Requires: jpackage-utils
194Obsoletes: apache-tomcat-jasper
195
196%description jasper
197Jasper is Java ServerPages compiler used by Apache Tomcat servlet
198container.
199
200%description jasper -l pl.UTF-8
201Jasper jest kompilatorem Java ServerPages używanym przez kontener
202servletów Apache Tomcat.
203
204%package -n java-servletapi
205Summary: Java servlet and JSP implementation classes
206Summary(pl.UTF-8): Klasy z implementacją Java Servlet i JSP
207Group: Libraries/Java
208Provides: java(JSP) = %{jspapiver}
209Provides: java(Servlet) = %{servletapiver}
210Obsoletes: java-servletapi5
211
212%description -n java-servletapi
213Implementation classes of the Java Servlet and JSP APIs (packages
214javax.servlet, javax.servlet.http, javax.servlet.jsp, and
215javax.servlet.jsp.tagext).
216
217%description -n java-servletapi -l pl.UTF-8
218Implementacje klas API Java Servlet i JSP (pakiety javax.servlet,
219javax.servlet.http, javax.servlet.jsp i java.servlet.jsp.tagext).
220
221%prep
222%setup -q -n apache-%{name}-%{version}-src
223
224%patch0 -p0
225%patch1 -p0
226
227# we don't need those scripts
228rm bin/*.bat
229rm bin/{startup,shutdown}.sh
230
231cp %{SOURCE3} build.properties
232
233%build
234TOPDIR=$(pwd)
235
236%ant -Drpm.javadir=%{_javadir} -Drpm.libdir=%{_libdir}
237
238%if %{with javadoc}
239%ant -f dist.xml dist-javadoc
240%endif
241
242%if %{with webservices}
243mkdir -p output/extras/webservices
244
245ln -s %{_javadir}/geronimo-spec-jaxrpc.jar output/extras/webservices/jaxrpc.jar
246ln -s %{_javadir}/jsr109.jar output/extras/webservices/wsdl4j.jar
247
248%ant -f extras.xml webservices
249%endif
250
251
252%install
253rm -rf $RPM_BUILD_ROOT
254cd output/build
255
256TOMCATDIR=$RPM_BUILD_ROOT%{_tomcatdir}
257CATALINADIR=$RPM_BUILD_ROOT/var/lib/tomcat
258
259install -d $TOMCATDIR \
260 $CATALINADIR/temp \
261 $RPM_BUILD_ROOT%{_vardir}/webapps \
262 $RPM_BUILD_ROOT%{_vardir}/work \
263 $RPM_BUILD_ROOT%{_vardir}/conf \
264 $RPM_BUILD_ROOT%{_logdir}/tomcat \
265 $RPM_BUILD_ROOT/etc/sysconfig \
266 $RPM_BUILD_ROOT/etc/rc.d/init.d
267
268install %{SOURCE1} $RPM_BUILD_ROOT/etc/rc.d/init.d/tomcat
269install %{SOURCE2} $RPM_BUILD_ROOT/etc/sysconfig/tomcat
270
271cp -a conf/* $CATALINADIR/conf
272install -d $CATALINADIR/conf/Catalina/localhost
273install %{SOURCE10} $CATALINADIR/conf/Catalina/localhost/ROOT.xml
274install %{SOURCE11} $CATALINADIR/conf/Catalina/localhost/docs.xml
275install %{SOURCE12} $CATALINADIR/conf/Catalina/localhost/manager.xml
276install %{SOURCE13} $CATALINADIR/conf/Catalina/localhost/host-manager.xml
277install %{SOURCE14} $CATALINADIR/conf/Catalina/localhost/examples.xml
278
279cp -a bin lib webapps $TOMCATDIR
280cp -a temp $CATALINADIR
281
282ln -sf %{_logdir}/tomcat $CATALINADIR/logs
283ln -sf %{_logdir}/tomcat $TOMCATDIR/logs
284ln -sf %{_vardir}/work $TOMCATDIR/work
285ln -sf %{_vardir}/conf $TOMCATDIR/conf
286ln -sf %{_vardir}/conf $RPM_BUILD_ROOT%{_sysconfdir}
287
288# symlinks instead of copies
289jars="commons-daemon commons-logging-api"
290for jar in $jars; do
291 jar=$(find-jar $jar)
292 ln -sf $jar $TOMCATDIR/bin
293done
294
295jars="commons-pool-tomcat5 commons-dbcp-tomcat5 mysql-connector-java org.eclipse.jdt.core"
296for jar in $jars; do
297 jar=$(find-jar $jar)
298 ln -sf $jar $TOMCATDIR/lib
299done
300
301install -d $RPM_BUILD_ROOT%{_javadir}
302mv $TOMCATDIR/lib/jasper*.jar $RPM_BUILD_ROOT%{_javadir}
303mv $TOMCATDIR/lib/jsp-api.jar $RPM_BUILD_ROOT%{_javadir}/jsp-api-%{jspapiver}.jar
304mv $TOMCATDIR/lib/servlet-api.jar $RPM_BUILD_ROOT%{_javadir}/servlet-api-%{servletapiver}.jar
305mv $TOMCATDIR/lib/catalina.jar $RPM_BUILD_ROOT%{_javadir}/tomcat6-catalina.jar
306mv $TOMCATDIR/lib/tomcat-coyote.jar $RPM_BUILD_ROOT%{_javadir}/tomcat6-coyote.jar
307
308ln -s jsp-api-%{jspapiver}.jar $RPM_BUILD_ROOT%{_javadir}/jsp-api.jar
309ln -s servlet-api-%{servletapiver}.jar $RPM_BUILD_ROOT%{_javadir}/servlet-api.jar
310
311# XXX add softlinks jasper-compiler.jar and jasper-runtime for compatibility with tomcat 5.5?
312ln -sf %{_javadir}/jasper-el.jar $TOMCATDIR/lib
313ln -sf %{_javadir}/jasper.jar $TOMCATDIR/lib
314
315ln -sf %{_javadir}/jsp-api-%{jspapiver}.jar $TOMCATDIR/lib
316ln -sf %{_javadir}/servlet-api-%{servletapiver}.jar $TOMCATDIR/lib
317
318ln -sf %{_javadir}/tomcat6-catalina.jar $TOMCATDIR/lib/catalina.jar
319ln -sf %{_javadir}/tomcat6-coyote.jar $TOMCATDIR/lib/tomcat-coyote.jar
320
321%if %{with webservices}
322install ../extras/catalina-ws.jar $TOMCATDIR/lib/catalina-ws.jar
323
324ln -s %{_javadir}/geronimo-spec-jaxrpc.jar $TOMCATDIR/lib/jaxrpc.jar
325ln -s %{_javadir}/jsr109.jar $TOMCATDIR/lib/jsr109.jar
326%endif
327
328%clean
329rm -rf $RPM_BUILD_ROOT
330
331%pre
332%groupadd -g 234 -r -f tomcat
333%groupadd -g 237 -r -f servlet
334%useradd -u 234 -r -d /var/lib/tomcat -s /bin/false -c "Tomcat User" -g tomcat -G servlet tomcat
335
336%post
337/sbin/chkconfig --add tomcat
338%service tomcat restart
339
340%preun
341if [ "$1" = "0" ]; then
342 %service tomcat stop
343 /sbin/chkconfig --del tomcat
344fi
345
346%postun
347if [ "$1" = "0" ]; then
348 %userremove tomcat
349 %groupremove tomcat
350 %groupremove servlet
351fi
352
353%files
354%defattr(644,root,root,755)
355%doc KEYS RELEASE-NOTES RELEASE-PLAN-6.0.txt RUNNING.txt
356%attr(754,root,root) /etc/rc.d/init.d/tomcat
357%config(noreplace) %verify(not md5 mtime size) /etc/sysconfig/tomcat
358%{_sysconfdir}
359%dir %{_tomcatdir}
360%dir %{_tomcatdir}/conf
361%dir %{_tomcatdir}/bin
362%{_tomcatdir}/bin/catalina-tasks.xml
363%attr(755,root,root) %{_tomcatdir}/bin/*.sh
364%{_tomcatdir}/bin/*.jar
365%dir %{_tomcatdir}/lib
366%{_tomcatdir}/lib/annotations-api.jar
367%{_tomcatdir}/lib/catalina-ant.jar
368%{_tomcatdir}/lib/catalina-ha.jar
369%{_tomcatdir}/lib/catalina.jar
370%{_tomcatdir}/lib/catalina-tribes.jar
371%{_tomcatdir}/lib/commons-dbcp-tomcat5.jar
372%{_tomcatdir}/lib/commons-pool-tomcat5.jar
373%{_tomcatdir}/lib/el-api.jar
374%{_tomcatdir}/lib/jasper-el.jar
375%{_tomcatdir}/lib/jasper.jar
376%{_tomcatdir}/lib/jsp-api-2.1.jar
377%{_tomcatdir}/lib/mysql-connector-java.jar
378%{_tomcatdir}/lib/org.eclipse.jdt.core.jar
379%{_tomcatdir}/lib/servlet-api-2.5.jar
380%{_tomcatdir}/lib/tomcat-coyote.jar
381%{_tomcatdir}/lib/tomcat-i18n-es.jar
382%{_tomcatdir}/lib/tomcat-i18n-fr.jar
383%{_tomcatdir}/lib/tomcat-i18n-ja.jar
384
385%dir %{_tomcatdir}/webapps
386
387%config(noreplace) %attr(664,root,tomcat) %verify(not md5 mtime size) %{_vardir}/conf/Catalina/localhost/ROOT.xml
388%{_tomcatdir}/webapps/ROOT
389
390%{_tomcatdir}/logs
391%{_tomcatdir}/work
392%dir %attr(770,root,tomcat) %{_vardir}
393# these directory has to be writeable because /admin need to modify config
394# files and create temporary files
395%dir %attr(770,root,tomcat) %{_vardir}/conf
396%dir %attr(770,root,tomcat) %{_vardir}/conf/Catalina
397%dir %{_vardir}/conf/Catalina/localhost
398# tomcat config has to be writeable because of tomcat-users.xml file and Catalina dir
399%config(noreplace) %attr(660,root,tomcat) %verify(not md5 mtime size) %{_vardir}/conf/catalina.policy
400%config(noreplace) %attr(660,root,tomcat) %verify(not md5 mtime size) %{_vardir}/conf/*.properties*
401%config(noreplace) %attr(660,root,tomcat) %verify(not md5 mtime size) %{_vardir}/conf/*.xml
402%dir %attr(770,root,tomcat) %{_vardir}/work
403%dir %attr(770,root,tomcat) %{_vardir}/webapps
404%dir %attr(770,root,tomcat) %{_vardir}/temp
405%dir %attr(770,root,tomcat) %{_logdir}/tomcat
406%{_vardir}/logs
407
408%files webapp-docs
409%defattr(644,root,root,755)
410%config(noreplace) %attr(664,root,tomcat) %verify(not md5 mtime size) %{_vardir}/conf/Catalina/localhost/docs.xml
411%{_tomcatdir}/webapps/docs
412
413%files webapp-manager
414%defattr(644,root,root,755)
415%config(noreplace) %attr(664,root,tomcat) %verify(not md5 mtime size) %{_vardir}/conf/Catalina/localhost/manager.xml
416%{_tomcatdir}/webapps/manager
417
418%files webapp-host-manager
419%defattr(644,root,root,755)
420%config(noreplace) %attr(664,root,tomcat) %verify(not md5 mtime size) %{_vardir}/conf/Catalina/localhost/host-manager.xml
421%{_tomcatdir}/webapps/host-manager
422
423%files webapp-examples
424%defattr(644,root,root,755)
425%config(noreplace) %attr(664,root,tomcat) %verify(not md5 mtime size) %{_vardir}/conf/Catalina/localhost/examples.xml
426%{_tomcatdir}/webapps/examples
427
428%if %{with webservices}
429%files webservices
430%defattr(644,root,root,755)
431%{_tomcatdir}/lib/catalina-ws.jar
432%{_tomcatdir}/lib/jsr109.jar
433%{_tomcatdir}/lib/jaxrpc.jar
434%endif
435
436%files jasper
437%defattr(644,root,root,755)
438%{_javadir}/jasper-el.jar
439%{_javadir}/jasper.jar
440
441%files catalina
442%defattr(644,root,root,755)
443%{_javadir}/tomcat6-catalina.jar
444
445%files coyote
446%defattr(644,root,root,755)
447%{_javadir}/tomcat6-coyote.jar
448
449%files -n java-servletapi
450%defattr(644,root,root,755)
451%{_javadir}/jsp-api*.jar
452%{_javadir}/servlet-api*.jar
This page took 0.067522 seconds and 4 git commands to generate.