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