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