]> git.pld-linux.org Git - packages/tomcat.git/blob - tomcat.spec
- obsoletes
[packages/tomcat.git] / tomcat.spec
1 # TODO
2 # - packages for *.renametojar files (-cgi and -ssi in server/lib)
3 #
4 # Conditional build:
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)
8 #
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
11 Name:           tomcat
12 Version:        5.5.27
13 Release:        0.3
14 License:        Apache v2.0
15 Group:          Networking/Daemons/Java
16 Source0:        http://www.apache.org/dist/tomcat/tomcat-5/v%{version}/src/apache-%{name}-%{version}-src.tar.gz
17 # Source0-md5:  eb3f196013550b9b1684e4ff18593a8e
18 Source1:        apache-%{name}.init
19 Source2:        apache-%{name}.sysconfig
20 Source10:       apache-%{name}-context-ROOT.xml
21 Source11:       apache-%{name}-context-balancer.xml
22 Source12:       apache-%{name}-context-jsp-examples.xml
23 Source13:       apache-%{name}-context-tomcat-docs.xml
24 Source14:       apache-%{name}-context-webdav.xml
25 Patch0:         apache-%{name}-skip-servletapi.patch
26 Patch1:         apache-%{name}-nsis.patch
27 Patch2:         apache-%{name}-native.patch
28 Patch3:         apache-%{name}-skip-jdt.patch
29 Patch4:         apache-%{name}-no-connectors.patch
30 Patch5:         apache-%{name}-dbcp.patch
31 # this patch is needed for struts >= 1.3
32 Patch6:         apache-%{name}-struts.patch
33 # WTF? Why is it needed? Is it related to struts version?
34 Patch7:         apache-%{name}-admin-struts.patch
35 URL:            http://tomcat.apache.org/
36 %if %{with java_sun}
37 BuildRequires:  java-sun >= 1.5
38 BuildRequires:  java-sun-jre >= 1.5
39 %else
40 # BuildRequires:        jsse >= 0:1.0.3
41 BuildRequires:  java-gcj-compat-devel
42 %endif
43 BuildRequires:  ant >= 1.5.3
44 BuildRequires:  ant-trax
45 BuildRequires:  eclipse-jdt
46 BuildRequires:  jaas
47 BuildRequires:  jakarta-regexp >= 0:1.3
48 BuildRequires:  java-commons-beanutils >= 1.7
49 BuildRequires:  java-commons-chain
50 BuildRequires:  java-commons-collections >= 0:3.1
51 BuildRequires:  java-commons-collections-tomcat5 >= 0:3.1
52 BuildRequires:  java-commons-daemon >= 1.0
53 BuildRequires:  java-commons-dbcp >= 0:1.2.1
54 BuildRequires:  java-commons-dbcp-tomcat5 >= 0:1.2.1
55 BuildRequires:  java-commons-digester >= 0:1.7
56 BuildRequires:  java-commons-el >= 0:1.0
57 BuildRequires:  java-commons-fileupload >= 0:1.0
58 BuildRequires:  java-commons-httpclient
59 BuildRequires:  java-commons-io >= 1.4
60 BuildRequires:  java-commons-launcher >= 0:0.9
61 BuildRequires:  java-commons-logging >= 0:1.0.4
62 BuildRequires:  java-commons-modeler >= 2.0
63 BuildRequires:  java-commons-pool >= 0:1.2
64 BuildRequires:  java-commons-pool-tomcat5 >= 0:1.2
65 %{?with_jta:BuildRequires:      java-jta >= 0:1.0.1}
66 BuildRequires:  java-log4j
67 BuildRequires:  java-mail >= 0:1.3.1
68 BuildRequires:  java-puretls
69 BuildRequires:  java-servletapi5 = %{version}
70 #BuildRequires: java-struts >= 0:1.2.7
71 BuildRequires:  java-struts >= 1.0.2
72 BuildRequires:  java-xerces >= 0:2.7.1
73 BuildRequires:  java-xml-commons
74 #BuildRequires: java-xml-commons >= 1.3
75 BuildRequires:  jaxp_parser_impl >= 0:2.7.1
76 BuildRequires:  jdbc-stdext >= 0:2.0
77 BuildRequires:  jmx
78 BuildRequires:  jndi >= 0:1.2.1
79 BuildRequires:  jpackage-utils
80 BuildRequires:  junit >= 0:3.8.1
81 BuildRequires:  rpmbuild(macros) >= 1.300
82 Requires(post,postun):  /sbin/ldconfig
83 Requires(post,preun):   /sbin/chkconfig
84 Requires(postun):       /usr/sbin/groupdel
85 Requires(postun):       /usr/sbin/userdel
86 Requires(pre):  /bin/id
87 Requires(pre):  /usr/bin/getgid
88 Requires(pre):  /usr/sbin/groupadd
89 Requires(pre):  /usr/sbin/useradd
90 Requires:       %{name}-jasper = %{version}-%{release}
91 Requires:       jaas
92 #Requires:      jaf >= 1.0.1
93 Requires:       java-commons-beanutils
94 Requires:       java-commons-collections
95 #Requires:      java-commons-dbcp-tomcat5
96 Requires:       java-commons-digester
97 Requires:       java-commons-el
98 #Requires:      java-commons-fileupload
99 Requires:       java-commons-logging
100 Requires:       java-commons-modeler
101 Requires:       java-regexp
102 Requires:       java-servletapi5 = %{version}
103 Requires:       java-xml-commons
104 Requires:       javamail >= 1.2
105 Requires:       jaxp_parser_impl
106 Requires:       jdbc-stdext >= 2.0
107 Requires:       jndi >= 1.2.1
108 Requires:       jre >= 1.2
109 Requires:       jsse >= 1.0.2
110 %{?with_jta:Requires:   jta >= 1.0.1}
111 Requires:       rc-scripts
112 Provides:       group(tomcat)
113 Provides:       java-servlet-container
114 Provides:       user(tomcat)
115 Obsoletes:      apache-tomcat
116 Obsoletes:      jakarta-tomcat
117 BuildArch:      noarch
118 BuildRoot:      %{tmpdir}/%{name}-%{version}-root-%(id -u -n)
119
120 %define         _tomcatdir      %{_datadir}/tomcat
121 %define         _logdir         %{_var}/log
122 %define         _vardir         %{_var}/lib/tomcat
123 %define         _sysconfdir     /etc/tomcat
124
125 %define find_jar() %{expand:%%define jarfile {%(jar=$(find-jar %1); echo ${jar:-%%nil})}}%{?jarfile}%{!?jarfile:%{error:find-jar %1 failed}}%{nil}
126
127 %description
128 Tomcat is the servlet container that is used in the official Reference
129 Implementation for the Java Servlet and JavaServer Pages technologies.
130 The Java Servlet and JavaServer Pages specifications are developed by
131 Sun under the Java Community Process.
132
133 Tomcat is developed in an open and participatory environment and
134 released under the Apache Software License. Tomcat is intended to be a
135 collaboration of the best-of-breed developers from around the world.
136 We invite you to participate in this open development project.
137
138 %description -l pl.UTF-8
139 Tomcat to kontener serwletowy używany przez oficjalną implementację
140 wzorcową technologii Java Servlet i JavaServer Pages. Specyfikacje
141 Java Servlet i JavaServer Pages są rozwijane przez Suna zgodnie z Java
142 Community Process.
143
144 %package doc
145 Summary:        The Apache Tomcat Servlet/JSP Container documentation
146 Summary(pl.UTF-8):      Dokumentacja do Tomcata - kontenera Servlet/JSP
147 Group:          Documentation
148 Obsoletes:      apache-tomcat-doc
149 Obsoletes:      jakarta-tomcat-doc
150
151 %description doc
152 The Tomcat Servlet/JSP Container documentation.
153
154 %description doc -l pl.UTF-8
155 Dokumentacja do Tomcata - kontenera Servlet/JSP.
156
157 %package admin
158 Summary:        Apache Tomcat`s Administration Web Application
159 Summary(pl.UTF-8):      Panel Administracyjny dla Apache Tomcat
160 Group:          Networking/Daemons/Java/Servlets
161 Requires:       %{name} = %{version}-%{release}
162 Requires:       java-commons-chain
163
164 %description admin
165 Administration Web Application for Apache Tomcat.
166
167 %description admin -l pl.UTF-8
168 Panel Administracyjny dla Apache Tomcat.
169
170 %package jasper
171 Summary:        JSP compiler
172 Summary(pl.UTF-8):      Kompilator JSP
173 Group:          Libraries/Java
174 Requires:       jpackage-utils
175 Obsoletes:      apache-tomcat-jasper
176
177 %description jasper
178 Jasper is Java ServerPages compiler used by Apache Tomcat servlet
179 container.
180
181 %description jasper -l pl.UTF-8
182 Jasper jest kompilatorem Java ServerPages używanym przez kontener
183 servletów Apache Tomcat.
184
185 %prep
186 %setup -q -n apache-%{name}-%{version}-src
187 %patch0 -p1
188 %patch1 -p1
189 %patch2 -p1
190 %patch3 -p1
191 %patch4 -p1
192 %patch5 -p1
193 %patch6 -p1
194
195 # we don't need dos scripts
196 rm -f container/catalina/src/bin/*.bat
197
198 # causes file(1) rpm to abort, and not really neccessary file
199 rm container/webapps/admin/images/Thumbs.db
200 # file: Thumbs.db: ERROR: Cannot read short stream (Invalid argument)
201 # rpm: error: magic_file(ms, "Thumbs.db") failed: mode 37777700644 Cannot read short stream (Invalid argument)
202
203 # servletapi built from jakarta-servletapi5.spec
204 rm -rf servletapi
205
206 # Remove pre-built jars
207 find -name '*.jar' | xargs rm -fv
208
209 %build
210 TOPDIR=$(pwd)
211
212 # build tomcat 5.5
213 cat > build.properties <<EOF
214 commons-beanutils.jar=$(find-jar commons-beanutils-core)
215 commons-launcher.jar=$(find-jar commons-launcher)
216 commons-daemon.jar=$(find-jar commons-daemon)
217 commons-digester.jar=$(find-jar commons-digester)
218 commons-el.jar=$(find-jar commons-el)
219 commons-logging-api.jar=$(find-jar commons-logging-api)
220 commons-logging.jar=$(find-jar commons-logging)
221 commons-modeler.jar=$(find-jar commons-modeler)
222 xercesImpl.jar=$(find-jar jaxp_parser_impl)
223 xml-apis.jar=$(find-jar xml-commons-apis)
224 jdt.jar=$(find-jar org.eclipse.jdt.core)
225 jasper-compiler-jdt.home=$TOPDIR/tomcat-deps
226 commons-httpclient.jar=$(find-jar commons-httpclient)
227 commons-collections.jar=$(find-jar commons-collections)
228 commons-fileupload.jar=$(find-jar commons-fileupload)
229 commons-io.jar=$(find-jar commons-io)
230 jmx.jar=$(find-jar jmx)
231 jmx-tools.jar=$(find-jar jmx)
232 junit.jar=$(find-jar junit)
233 struts.jar=$(find-jar struts-core)
234 struts-core.jar=$(find-jar struts-core)
235 struts-taglib.jar=$(find-jar struts-taglib)
236 jcert.jar=$(find-jar jcert)
237 jnet.jar=$(find-jar jnet)
238 jsse.jar=$(find-jar jsse)
239 %{?with_jta:jta.jar=$(find-jar jta)}
240 puretls.jar=$(find-jar puretls)
241 servlet-api.jar=$(find-jar servlet-api)
242 servletapi.build.notrequired=true
243 jsp-api.jar=$(find-jar jsp-api)
244 jspapi.build.notrequired=true
245 log4j.jar=$(find-jar log4j)
246 tomcat-dbcp.jar=$(find-jar commons-dbcp-tomcat5)
247 struts.lib=%{_javadir}-struts
248 EOF
249
250 if grep '=$' build.properties; then
251         : Some .jar could not be found
252         exit 1
253 fi
254
255 %ant \
256         -Dcompile.source=1.4
257
258 %install
259 rm -rf $RPM_BUILD_ROOT
260 cd build/build
261 TOMCATDIR=$RPM_BUILD_ROOT%{_tomcatdir}
262 CATALINADIR=$RPM_BUILD_ROOT/var/lib/tomcat
263
264 randpw=$(echo $RANDOM$$ | md5sum | cut -c 1-15)
265 %{__sed} -i -e "s:SHUTDOWN:${randpw}:" conf/{server,server-minimal}.xml
266
267 install -d $TOMCATDIR/bin \
268             $TOMCATDIR/common/{lib,classes,endorsed} \
269             $TOMCATDIR/server/{lib,classes} \
270             $TOMCATDIR/webapps \
271             $RPM_BUILD_ROOT%{_logdir}/tomcat \
272             $RPM_BUILD_ROOT%{_vardir}/webapps \
273             $RPM_BUILD_ROOT%{_vardir}/work \
274             $RPM_BUILD_ROOT%{_vardir}/conf \
275             $RPM_BUILD_ROOT/etc/sysconfig \
276             $RPM_BUILD_ROOT/etc/rc.d/init.d
277
278 install %{SOURCE1} $RPM_BUILD_ROOT/etc/rc.d/init.d/tomcat
279 install %{SOURCE2} $RPM_BUILD_ROOT/etc/sysconfig/tomcat
280
281 cp -a conf/* $CATALINADIR/conf
282 install %{SOURCE10} $CATALINADIR/conf/Catalina/localhost/ROOT.xml
283 install %{SOURCE11} $CATALINADIR/conf/Catalina/localhost/balancer.xml
284 install %{SOURCE12} $CATALINADIR/conf/Catalina/localhost/jsp-examples.xml
285 install %{SOURCE13} $CATALINADIR/conf/Catalina/localhost/tomcat-docs.xml
286 install %{SOURCE14} $CATALINADIR/conf/Catalina/localhost/webdav.xml
287 cp -HR bin common server $TOMCATDIR
288
289 cp -a server/webapps $TOMCATDIR/server
290 cp -a webapps $TOMCATDIR
291 cp -a shared $TOMCATDIR
292 cp -a temp $CATALINADIR
293
294 ln -sf %{_logdir}/tomcat $CATALINADIR/logs
295 ln -sf %{_vardir}/work $TOMCATDIR/work
296 ln -sf %{_vardir}/conf $TOMCATDIR/conf
297 ln -sf %{_vardir}/conf $RPM_BUILD_ROOT%{_sysconfdir}
298
299 # symlinks instead of copies
300 jars="commons-el commons-dbcp-tomcat5 servlet-api jsp-api commons-modeler"
301 for jar in $jars; do
302         jar=$(find-jar $jar)
303         ln -sf $jar $TOMCATDIR/common/lib
304 done
305
306 jars="jaxp_parser_impl xml-commons-apis"
307 for jar in $jars; do
308         jar=$(find-jar $jar)
309         ln -sf $jar $TOMCATDIR/common/endorsed
310 done
311
312 jars="struts-core struts-taglib commons-collections commons-beanutils-core commons-digester commons-chain"
313 for jar in $jars; do
314         jar=$(find-jar $jar)
315         ln -sf $jar $TOMCATDIR/server/webapps/admin/WEB-INF/lib
316 done
317
318 %if 0
319 # do not make these symlinks as ant didn't do
320 jars="commons-daemon"
321 for jar in $jars; do
322         jar=$(find-jar $jar)
323         ln -sf $jar $TOMCATDIR/bin
324 done
325
326 jars="activation ant commons-dbcp commons-logging-api commons-pool servlet jdbc-stdext
327 jmxri jndi %{?with_jta:jta} mail jsse junit mailapi pop3"
328 for jar in $jars; do
329         jar=$(find-jar $jar)
330         ln -sf $jar $TOMCATDIR/common/lib
331 done
332
333 ln -sf servlet.jar $TOMCATDIR/common/lib/servletapi4.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 pop3.jar $TOMCATDIR/common/lib/pop.jar
337
338 jars="commons-beanutils commons-digester commons-fileupload commons-logging jaas regexp"
339 for jar in $jars; do
340         jar=$(find-jar $jar)
341         ln -sf $jar $TOMCATDIR/server/lib
342 done
343 ln -sf regexp.jar $TOMCATDIR/server/lib/jakarta-regexp-1.2.jar
344 ln -sf regexp.jar $TOMCATDIR/server/lib/regexp-1.2.jar
345 %endif
346
347 install -d $RPM_BUILD_ROOT%{_javadir}
348 mv $TOMCATDIR/common/lib/jasper*.jar $RPM_BUILD_ROOT%{_javadir}
349 ln -sf %{_javadir}/jasper-compiler-jdt.jar $TOMCATDIR/common/lib
350 ln -sf %{_javadir}/jasper-compiler.jar $TOMCATDIR/common/lib
351 ln -sf %{_javadir}/jasper-runtime.jar $TOMCATDIR/common/lib
352
353 %clean
354 rm -rf $RPM_BUILD_ROOT
355
356 %pre
357 %groupadd -g 234 -r -f tomcat
358 %useradd -u 234 -r -d /var/lib/tomcat -s /bin/false -c "Tomcat User" -g tomcat tomcat
359
360 %post
361 /sbin/chkconfig --add tomcat
362 %service tomcat restart
363
364 %preun
365 if [ "$1" = "0" ]; then
366         %service tomcat stop
367         /sbin/chkconfig --del tomcat
368 fi
369
370 %postun
371 if [ "$1" = "0" ]; then
372         %userremove tomcat
373         %groupremove tomcat
374 fi
375
376 %files
377 %defattr(644,root,root,755)
378 %doc build/{RELEASE-NOTES,RUNNING.txt}
379 %attr(754,root,root) /etc/rc.d/init.d/tomcat
380 %config(noreplace) %verify(not md5 mtime size) /etc/sysconfig/tomcat
381 %{_sysconfdir}
382 %dir %{_tomcatdir}
383 %dir %{_tomcatdir}/conf
384 %dir %{_tomcatdir}/bin
385 %{_tomcatdir}/bin/catalina-tasks.xml
386 %{_tomcatdir}/bin/jkstatus-tasks.xml
387 %{_tomcatdir}/bin/jmxaccessor-tasks.xml
388 %attr(755,root,root) %{_tomcatdir}/bin/*.sh
389 %{_tomcatdir}/bin/*.jar
390 %dir %{_tomcatdir}/common
391 %dir %{_tomcatdir}/common/classes
392 %dir %{_tomcatdir}/common/endorsed
393 %dir %{_tomcatdir}/common/i18n
394 %{_tomcatdir}/common/endorsed/*.jar
395 %{_tomcatdir}/common/i18n/tomcat-i18n-en.jar
396 %lang(es) %{_tomcatdir}/common/i18n/tomcat-i18n-es.jar
397 %lang(fr) %{_tomcatdir}/common/i18n/tomcat-i18n-fr.jar
398 %lang(ja) %{_tomcatdir}/common/i18n/tomcat-i18n-ja.jar
399 %{_tomcatdir}/common/lib
400 %dir %{_tomcatdir}/server
401 %dir %{_tomcatdir}/server/classes
402 %{_tomcatdir}/server/lib
403 %dir %{_tomcatdir}/server/webapps
404 %{_tomcatdir}/server/webapps/host-manager
405 %{_tomcatdir}/server/webapps/manager
406 %{_tomcatdir}/webapps
407 %{_tomcatdir}/work
408 %{_tomcatdir}/shared
409 %dir %{_vardir}
410 %dir %{_vardir}/conf
411 %dir %{_vardir}/conf/Catalina
412 %dir %{_vardir}/conf/Catalina/localhost
413 # tomcat config has to be writeable because of tomacta-users.xml file and Catalina dir
414 %config(noreplace) %attr(664,root,tomcat) %verify(not md5 mtime size) %{_vardir}/conf/MANIFEST.MF
415 %config(noreplace) %attr(664,root,tomcat) %verify(not md5 mtime size) %{_vardir}/conf/catalina.policy
416 %config(noreplace) %attr(664,root,tomcat) %verify(not md5 mtime size) %{_vardir}/conf/*.properties*
417 %config(noreplace) %attr(664,root,tomcat) %verify(not md5 mtime size) %{_vardir}/conf/*.manifest
418 %config(noreplace) %attr(664,root,tomcat) %verify(not md5 mtime size) %{_vardir}/conf/*.xml
419 %config(noreplace) %attr(664,root,tomcat) %verify(not md5 mtime size) %{_vardir}/conf/Catalina/localhost/balancer.xml
420 %config(noreplace) %attr(664,root,tomcat) %verify(not md5 mtime size) %{_vardir}/conf/Catalina/localhost/host-manager.xml
421 %config(noreplace) %attr(664,root,tomcat) %verify(not md5 mtime size) %{_vardir}/conf/Catalina/localhost/jsp-examples.xml
422 %config(noreplace) %attr(664,root,tomcat) %verify(not md5 mtime size) %{_vardir}/conf/Catalina/localhost/manager.xml
423 %config(noreplace) %attr(664,root,tomcat) %verify(not md5 mtime size) %{_vardir}/conf/Catalina/localhost/ROOT.xml
424 %config(noreplace) %attr(664,root,tomcat) %verify(not md5 mtime size) %{_vardir}/conf/Catalina/localhost/tomcat-docs.xml
425 %config(noreplace) %attr(664,root,tomcat) %verify(not md5 mtime size) %{_vardir}/conf/Catalina/localhost/webdav.xml
426 %dir %attr(1730,root,tomcat) %{_vardir}/work
427 %dir %attr(775,root,tomcat) %{_vardir}/webapps
428 %dir %attr(775,root,tomcat) %{_vardir}/temp
429 %dir %attr(775,root,tomcat) %{_logdir}/tomcat
430 %{_vardir}/logs
431
432 %if 0
433 %files doc
434 %defattr(644,root,root,755)
435 %doc catalina/docs/*
436 %endif
437
438 %files admin
439 %defattr(644,root,root,755)
440 %config(noreplace) %attr(664,root,tomcat) %verify(not md5 mtime size) %{_vardir}/conf/Catalina/localhost/admin.xml
441 %{_tomcatdir}/server/webapps/admin
442
443 %files jasper
444 %defattr(644,root,root,755)
445 %{_javadir}/jasper-compiler-jdt.jar
446 %{_javadir}/jasper-compiler.jar
447 %{_javadir}/jasper-runtime.jar
This page took 0.118576 seconds and 4 git commands to generate.