]> git.pld-linux.org Git - packages/tomcat.git/blame_incremental - tomcat.spec
- more
[packages/tomcat.git] / tomcat.spec
... / ...
CommitLineData
1#
2# Conditional build:
3%bcond_with binary # build from binary source
4%bcond_without javadoc # skip building javadocs
5#
6Summary: Apache Servlet/JSP Engine, RI for Servlet 2.4/JSP 2.0 API
7Summary(pl.UTF-8): Silnik Servlet/JSP Apache będący wzorcową implementacją API Servlet 2.4/JSP 2.0
8Name: apache-tomcat
9Version: 5.5.23
10Release: 0.1
11License: Apache
12Group: Development/Languages/Java
13#Source0: http://www.apache.org/dist/tomcat/tomcat-5/v5.0.30/src/%{name}-%{version}-src.tar.gz
14Source0: http://www.apache.org/dist/tomcat/tomcat-5/v%{version}/src/%{name}-%{version}-src.tar.gz
15# Source0-md5: 362d1d8b15dc09882440dcab8c592dd7
16#Source0: http://apache.zone-h.org/
17Source1: jakarta-tomcat.init
18Patch0: %{name}-skip-servletapi.patch
19Patch1: %{name}-nsis.patch
20Patch2: %{name}-native.patch
21Patch3: %{name}-skip-jdt.patch
22Patch4: %{name}-no-connectors.patch
23URL: http://tomcat.apache.org/
24# required:
25BuildRequires: ant >= 1.5.3
26BuildRequires: jaas
27BuildRequires: jakarta-commons-beanutils
28BuildRequires: jakarta-commons-collections
29BuildRequires: jakarta-commons-collections-source
30BuildRequires: jakarta-commons-daemon
31BuildRequires: jakarta-commons-dbcp
32BuildRequires: jakarta-commons-dbcp-source
33BuildRequires: jakarta-commons-digester
34BuildRequires: jakarta-commons-fileupload
35BuildRequires: jakarta-commons-httpclient
36BuildRequires: jakarta-commons-launcher
37BuildRequires: eclipse-jdt
38BuildRequires: jakarta-commons-logging
39BuildRequires: jakarta-commons-modeler >= 2.0
40BuildRequires: jakarta-commons-pool
41BuildRequires: jakarta-commons-pool-source
42BuildRequires: jakarta-regexp
43BuildRequires: jakarta-servletapi5
44BuildRequires: jakarta-struts >= 1.0.2
45BuildRequires: jaxp_parser_impl
46BuildRequires: jdk >= 1.5
47BuildRequires: jpackage-utils
48BuildRequires: mx4j >= 1.1.1
49BuildRequires: puretls
50BuildRequires: rpmbuild(macros) >= 1.300
51BuildRequires: xerces-j
52%if %{with javadoc}
53BuildRequires: jakarta-commons-el
54%endif
55# optional:
56BuildRequires: jaf >= 1.0.1
57BuildRequires: jakarta-commons-dbcp
58BuildRequires: jakarta-commons-pool
59BuildRequires: javamail >= 1.2
60BuildRequires: jdbc-stdext >= 2.0
61BuildRequires: jndi >= 1.2.1
62BuildRequires: jsse >= 1.0.2
63BuildRequires: jta >= 1.0.1
64BuildRequires: junit >= 3.7
65BuildRequires: rpmbuild(macros) >= 1.268
66BuildRequires: tyrex >= 1.0
67BuildRequires: xml-commons
68Requires(post,postun): /sbin/ldconfig
69Requires(post,preun): /sbin/chkconfig
70Requires(postun): /usr/sbin/groupdel
71Requires(postun): /usr/sbin/userdel
72Requires(pre): /bin/id
73Requires(pre): /usr/bin/getgid
74Requires(pre): /usr/sbin/groupadd
75Requires(pre): /usr/sbin/useradd
76Requires: jaas
77Requires: jaf >= 1.0.1
78Requires: jakarta-commons-beanutils
79Requires: jakarta-commons-collections
80Requires: jakarta-commons-digester
81Requires: jakarta-commons-fileupload
82Requires: jakarta-commons-logging
83Requires: jakarta-regexp
84Requires: jakarta-servletapi >= 4
85Requires: javamail >= 1.2
86Requires: jaxp_parser_impl
87Requires: jdbc-stdext >= 2.0
88Requires: jndi >= 1.2.1
89Requires: jre >= 1.2
90Requires: jsse >= 1.0.2
91Requires: jta >= 1.0.1
92Requires: mx4j >= 1.1.1
93Requires: rc-scripts
94Requires: tyrex >= 1.0
95Requires: xml-commons
96Provides: group(http)
97Provides: user(http)
98Obsoletes: jakarta-tomcat
99BuildArch: noarch
100BuildRoot: %{tmpdir}/%{name}-%{version}-root-%(id -u -n)
101
102%define _tomcatdir %{_libdir}/tomcat
103%define _logdir %{_var}/log
104%define _vardir %{_var}/lib/tomcat
105
106%description
107Tomcat is the servlet container that is used in the official Reference
108Implementation for the Java Servlet and JavaServer Pages technologies.
109The Java Servlet and JavaServer Pages specifications are developed by
110Sun under the Java Community Process.
111
112Tomcat is developed in an open and participatory environment and
113released under the Apache Software License. Tomcat is intended to be a
114collaboration of the best-of-breed developers from around the world.
115We invite you to participate in this open development project.
116
117%description -l pl.UTF-8
118Tomcat to kontener serwletowy używany przez oficjalną implementację
119wzorcową technologii Java Servlet i JavaServer Pages. Specyfikacje
120Java Servlet i JavaServer Pages są rozwijane przez Suna zgodnie z Java
121Community Process.
122
123%package doc
124Summary: The Apache Tomcat Servlet/JSP Container documentation
125Summary(pl.UTF-8): Dokumentacja do Tomcata - kontekera Servlet/JSP
126Group: Development/Languages/Java
127Obsoletes: jakarta-tomcat-doc
128
129%description doc
130The Tomcat Servlet/JSP Container documentation.
131
132%description doc -l pl.UTF-8
133Dokumentacja do Tomcata - kontekera Servlet/JSP.
134
135%prep
136%setup -q -n %{name}-%{version}-src
137%patch0 -p1
138%patch1 -p1
139%patch2 -p1
140%patch3 -p1
141%patch4 -p1
142
143# servletapi built from jakarta-servletapi5.spec
144rm -rf servletapi
145
146# Remove pre-built jars
147find -name '*.jar' | xargs rm -fv
148
149%build
150TOPDIR=$(pwd)
151#xerces.jar=$(build-classpath xerces)
152#jasper-compiler-jdt.jar=$(build-classpath jdtcore)
153
154mkdir -p tomcat-deps
155> tomcat-deps/tomcat-dbcp.jar
156
157%if 0
158# build jasper javadocs
159cd jasper
160CLASSPATH=$(build-classpath xml-commons-apis)
161cat > build.properties <<EOF
162ant.jar=$(build-classpath ant)
163servlet-api.jar=$(build-classpath servlet-api)
164jsp-api.jar=$(build-classpath jsp-api)
165tools.jar=%{java_home}/lib/tools.jar
166xercesImpl.jar=$(build-classpath jaxp_parser_impl)
167xmlParserAPIs.jar=$(build-classpath xml-commons-apis)
168commons-collections.jar=$(build-classpath commons-collections)
169commons-logging.jar=$(build-classpath commons-logging)
170commons-daemon.jar=$(build-classpath commons-daemon)
171junit.jar=$(build-classpath junit)
172commons-el.jar=$(build-classpath commons-el)
173EOF
174# building jasper needs eclipse classes
175#%ant dist
176
177%if %{with javadoc}
178%ant javadoc \
179 -Dcompile.source=1.4 \
180 -Dbuild.compiler=modern \
181
182%endif
183cd -
184%endif
185
186# build tomcat 5.5
187#cd build
188cat > build.properties <<EOF
189commons-beanutils.jar=$(build-classpath commons-beanutils)
190commons-launcher.jar=$(build-classpath commons-launcher)
191commons-daemon.jar=$(build-classpath commons-daemon)
192commons-digester.jar=$(build-classpath commons-digester)
193commons-el.jar=$(build-classpath commons-el)
194commons-logging-api.jar=$(build-classpath commons-logging-api)
195commons-logging.jar=$(build-classpath commons-logging)
196commons-modeler.jar=$(build-classpath commons-modeler)
197xercesImpl.jar=$(build-classpath jaxp_parser_impl)
198xml-apis.jar=$(build-classpath xml-commons-apis)
199jdt.jar=$(build-classpath org.eclipse.jdt.core)
200jasper-compiler-jdt.home=$TOPDIR/tomcat-deps
201%if 0
202log4j.jar=${log4j.lib}/dist/lib/log4j-1.2.12.jar
203%endif
204commons-httpclient.jar=$(build-classpath commons-httpclient)
205commons-collections.jar=$(build-classpath commons-collections)
206commons-fileupload.jar=$(build-classpath commons-fileupload)
207
208
209%if 0
210jmx.jar=${jmx.lib}/mx4j.jar
211%endif
212jmx.jar=$(build-classpath jre/jmx)
213%if 0
214jmx-tools.jar=${jmx.lib}/mx4j-tools.jar
215%endif
216jmx-tools.jar=$(build-classpath jre/jmx)
217%if 0
218jmx-remote.jar=${jmx.lib}/mx4j-remote.jar
219%endif
220junit.jar=$(build-classpath junit)
221%if 0
222rhino.jar=${rhino.home}/js.jar
223%endif
224struts.jar=$(build-classpath struts)
225activation.jar=$(build-classpath jaf)
226jcert.jar=$(build-classpath java/jcert)
227jnet.jar=$(build-classpath java/jnet)
228jsse.jar=$(build-classpath java/jsse)
229jta.jar=$(build-classpath jta)
230mail.jar=$(build-classpath javamail/mailapi)
231puretls.jar=$(build-classpath puretls)
232
233servlet-api.jar=$(build-classpath servlet-api)
234# how the fck those bools work
235# build.xml:103: servletapi/jsr154/src not found.
236servletapi.build.notrequired=true
237
238jsp-api.jar=$(build-classpath jsp-api)
239jspapi.build.notrequired=true
240
241log4j.jar=$(build-classpath logging-log4j)
242#log4j.loc=%{_javadir}
243
244# source is needed because source is copied modified and recompiled as tomcat jar
245# see <target name="-build-tomcat-dbcp"> in build/build.xml
246tomcat-dbcp.home=
247commons-collections.home=%{_prefix}/src/jakarta-commons-collections-3.1
248commons-pool.home=%{_prefix}/src/jakarta-commons-pool-1.3
249commons-dbcp.home=%{_prefix}/src/jakarta-commons-dbcp-1.2.1
250tomcat-dbcp.home=$TOPDIR/tomcat-deps
251# err, it compiles three above and then appends to the jar, so the file should exist
252tomcat-dbcp.jar=$TOPDIR/tomcat-deps/tomcat-dbcp.jar
253
254%if 0
255ant.jar=%{_javadir}/ant.jar
256ant-launcher.jar=%{_javadir}/ant-launcher.jar
257jtc.home=$TOPDIR/jakarta-tomcat-connectors/
258jasper.home=$TOPDIR/jakarta-tomcat-jasper/jasper2
259commons-dbcp.jar=$(build-classpath commons-dbcp)
260commons-pool.jar=$(build-classpath commons-pool)
261jmxri.jar=$(build-classpath jre/jmx)
262regexp.jar=$(build-classpath regexp)
263jsp-api.jar=$TOPDIR/jakarta-servletapi-5/jsr152/dist/lib/jsp-api.jar
264servlet.doc=$TOPDIR/jakarta-servletapi-5/jsr154/dist/docs/api
265struts.lib=%{_datadir}/struts
266servletapi.build.notrequired=true
267tyrex.jar=$(build-classpath tyrex)
268jaas.jar=$(build-classpath jre/jaas)
269jndi.jar=$(build-classpath jre/jndi)
270jdbc20ext.jar=$(build-classpath jdbc-stdext)
271jspapi.build.notrequired=true
272taglibs-core.jar=$(build-classpath taglibs-core)
273taglibs-standard.jar=$(build-classpath taglibs-standard)
274%endif
275
276EOF
277
278%ant \
279 -Dcompile.source=1.4
280
281exit 1
282
283# build the connectors
284cd connectors
285
286%if 0
287
288# this is just plain and simply evil but something changed in a major way between 5.0.16 and 5.0.18
289oldclasspath=$CLASSPATH
290export CLASSPATH=$TOPDIR/jakarta-servletapi-5/jsr154/dist/lib/servlet-api.jar:\
291$TOPDIR/jakarta-tomcat-5/build/server/lib/catalina.jar
292%endif
293
294%if 0
295cat > build.properties <<EOF
296
297activation.jar=$(build-classpath jaf)
298ant.jar=%{_javadir}/ant.jar
299junit.jar=$(build-classpath junit)
300commons-beanutils.jar=$(build-classpath commons-beanutils)
301commons-collections.jar=$(build-classpath commons-collections)
302commons-digester.jar=$(build-classpath commons-digester)
303commons-fileupload.jar=$(build-classpath commons-fileupload)
304commons-logging.jar=$(build-classpath commons-logging)
305commons-logging-api.jar=$(build-classpath commons-logging-api)
306commons-modeler.jar=$(build-classpath commons-modeler)
307commons-pool.jar=$(build-classpath commons-pool)
308regexp.jar=$(build-classpath regexp)
309jmx.jar=$(build-classpath mx4j/mx4j)
310puretls=$(build-classpath puretls)
311activation.jar=$(build-classpath jaf)
312mail.jar=$(build-classpath javamail/mailapi)
313jta.jar=$(build-classpath jta)
314tyrex.jar=$(build-classpath tyrex)
315jaas.jar=$(build-classpath jaas)
316jndi.jar=$(build-classpath jndi)
317jdbc20ext.jar=$(build-classpath java/jdbc-stdext)
318puretls.jar=$(build-classpath puretls)
319jcert.jar=$(build-classpath jsse/jcert)
320jnet.jar=$(build-classpath jsse/jnet)
321jsse.jar=$(build-classpath jsse/jsse)
322
323%endif
324
325%if 0
326commons-beanutils.jar=${commons-beanutils.lib}/commons-beanutils.jar
327commons-collections.jar=${commons-collections.lib}/commons-collections.jar
328commons-digester.jar=${commons-digester.lib}/commons-digester.jar
329commons-fileupload.jar=${commons-fileupload.lib}/commons-fileupload-1.0-beta-1.jar
330commons-logging-api.jar=${commons-logging.lib}/commons-logging-api.jar
331commons-logging.jar=${commons-logging.lib}/commons-logging.jar
332jndi.jar=${jndi.lib}/jndi.jar
333ldap.jar=${jndi.lib}/ldap.jar
334jaas.jar=${jndi.lib}/jaas.jar
335regexp.jar=${regexp.lib}/jakarta-regexp-1.4.jar
336servlet.jar=${servlet.lib}/servlet.jar
337#xerces.jar=${xerces.lib}/xerces.jar
338xercesImpl.jar=${xerces.lib}/xercesImpl.jar
339xml-apis.jar=${xerces.lib}/xml-apis.jar
340activation.jar=${activation.lib}/activation.jar
341commons-daemon.jar=${commons-daemon.lib}/commons-daemon.jar
342commons-dbcp.jar=${commons-dbcp.lib}/commons-dbcp.jar
343commons-modeler.jar=${commons-modeler.lib}/commons-modeler.jar
344commons-pool.jar=${commons-pool.lib}/commons-pool.jar
345jdbc20ext.jar=${jdbc20ext.lib}/jdbc2_0-stdext.jar
346jmx.jar=${jmx.lib}/mx4j-jmx.jar
347jcert.jar=${jsse.lib}/jcert.jar
348jnet.jar=${jsse.lib}/jnet.jar
349jsse.jar=${jsse.lib}/jsse.jar
350jta.jar=${jta.lib}/jta.jar
351junit.jar=${junit.lib}/junit.jar
352mail.jar=${mail.lib}/mail.jar
353puretls.jar=${puretls.lib}/puretls.jar
354struts.jar=${struts.lib}/struts.jar
355tyrex.jar=${tyrex.lib}/tyrex-1.0.jar
356tomcat5.jar=${tomcat5.home}/server/lib/catalina.jar
357servlet-api.jar=${tomcat5.home}/common/lib/servlet-api.jar
358tomcat41.jar=${tomcat41.home}/server/lib/catalina.jar
359servlet-api.jar=${tomcat41.home}/common/lib/servlet.jar
360tomcat33.jar=${tomcat33.home}/lib/common/tomcat_core.jar
361%endif
362
363
364%if 0
365EOF
366%ant build \
367 -Dbuild.compiler=modern \
368 -Djava.home=%{java_home}
369%endif
370%if 0
371export CLASSPATH=$oldclasspath
372
373# build the webapps and make the tree ready to install
374cd ../jakarta-tomcat-5
375%ant -Dbuild.compiler=modern -Djava.home=%{java_home} dist
376%endif
377
378%install
379rm -rf $RPM_BUILD_ROOT
380
381DEST=$RPM_BUILD_ROOT%{_tomcatdir}
382
383install -d $DEST/bin \
384 $DEST/common/{lib,classes,endorsed} \
385 $DEST/server/{lib,classes} \
386 $DEST/webapps \
387 $RPM_BUILD_ROOT%{_sysconfdir}/tomcat \
388 $RPM_BUILD_ROOT%{_logdir}/tomcat \
389 $RPM_BUILD_ROOT%{_vardir}/work \
390 $RPM_BUILD_ROOT/etc/rc.d/init.d
391
392install build/bin/*.sh $DEST/bin
393install build/bin/bootstrap*.jar $DEST/bin
394install build/bin/tomcat*.jar $DEST/bin
395install build/common/lib/naming-*.jar $DEST/common/lib
396install build/common/lib/jasper-*.jar $DEST/common/lib
397install build/conf/* $RPM_BUILD_ROOT%{_sysconfdir}/tomcat
398install build/server/lib/catalina*.jar $DEST/server/lib
399install build/server/lib/servlets*.jar $DEST/server/lib
400install build/server/lib/tomcat*.jar $DEST/server/lib
401install build/server/lib/servlets-cgi.renametojar $DEST/server/lib/servlets-cgi.jar
402install build/server/lib/servlets-ssi.renametojar $DEST/server/lib/servlets-ssi.jar
403cp -rf build/server/webapps $DEST/server
404cp -rf build/webapps $DEST
405cp -rf build/shared $DEST
406cp -rf build/temp $DEST
407
408ln -sf %{_logdir}/tomcat $DEST/logs
409ln -sf %{_vardir}/work $DEST/work
410ln -sf %{_sysconfdir}/tomcat $DEST/conf
411
412# symlinks instead of copies
413ln -sf %{_javadir}/commons-daemon.jar $DEST/bin
414
415ln -sf %{_javadir}/activation.jar $DEST/common/lib
416ln -sf %{_javadir}/ant.jar $DEST/common/lib
417ln -sf %{_javadir}/commons-collections.jar $DEST/common/lib
418ln -sf %{_javadir}/commons-dbcp.jar $DEST/common/lib
419ln -sf %{_javadir}/commons-logging-api.jar $DEST/common/lib
420ln -sf %{_javadir}/commons-pool.jar $DEST/common/lib
421ln -sf %{_javadir}/servlet.jar $DEST/common/lib
422ln -sf %{_javadir}/servlet.jar $DEST/common/lib/servletapi4.jar
423ln -sf %{_javadir}/jdbc-stdext.jar $DEST/common/lib/jdbc2_0-stdext.jar
424ln -sf %{_javadir}/jdbc-stdext.jar $DEST/common/lib/jdbc-stdext-2.0.jar
425ln -sf %{_javadir}/jmxri.jar $DEST/common/lib
426ln -sf %{_javadir}/jndi.jar $DEST/common/lib
427ln -sf %{_javadir}/jta.jar $DEST/common/lib
428ln -sf %{_javadir}/mail.jar $DEST/common/lib
429ln -sf %{_javadir}/jsse.jar $DEST/common/lib
430ln -sf %{_javadir}/tyrex.jar $DEST/common/lib
431ln -sf %{_javadir}/junit.jar $DEST/common/lib
432
433ln -sf %{_javadir}/mailapi.jar $DEST/common/lib
434ln -sf %{_javadir}/pop3.jar $DEST/common/lib
435ln -sf %{_javadir}/pop3.jar $DEST/common/lib/pop.jar
436ln -sf %{_javadir}/smtp.jar $DEST/common/lib
437ln -sf %{_javadir}/imap.jar $DEST/common/lib
438
439ln -sf %{_javadir}/commons-beanutils.jar $DEST/server/lib
440ln -sf %{_javadir}/commons-digester.jar $DEST/server/lib
441ln -sf %{_javadir}/commons-fileupload.jar $DEST/server/lib
442ln -sf %{_javadir}/commons-logging.jar $DEST/server/lib
443ln -sf %{_javadir}/commons-modeler.jar $DEST/server/lib
444ln -sf %{_javadir}/jaas.jar $DEST/server/lib/jaas.jar
445ln -sf %{_javadir}/mx4j-jmx.jar $DEST/server/lib
446ln -sf %{_javadir}/regexp.jar $DEST/server/lib
447ln -sf %{_javadir}/regexp.jar $DEST/server/lib/jakarta-regexp-1.2.jar
448ln -sf %{_javadir}/regexp.jar $DEST/server/lib/regexp-1.2.jar
449
450ln -sf %{_javadir}/jaxp_parser_impl.jar $DEST/common/endorsed
451ln -sf %{_javadir}/xml-commons-apis.jar $DEST/common/endorsed
452
453ln -sf %{_javadir}/struts.jar $DEST/server/webapps/admin/WEB-INF/lib
454
455install %{SOURCE1} $RPM_BUILD_ROOT/etc/rc.d/init.d/tomcat
456
457%clean
458rm -rf $RPM_BUILD_ROOT
459
460%pre
461%groupadd -g 51 -r -f http
462%useradd -u 51 -r -d /home/services/httpd -s /bin/false -c "HTTP User" -g http http
463
464%post
465/sbin/chkconfig --add tomcat
466%service tomcat restart
467
468%preun
469if [ "$1" = "0" ]; then
470 %service tomcat stop
471 /sbin/chkconfig --del tomcat
472fi
473
474%postun
475if [ "$1" = "0" ]; then
476 %userremove http
477 %groupremove http
478fi
479
480%files
481%defattr(644,root,root,755)
482%doc *.txt LICENSE
483%dir %{_tomcatdir}
484%dir %{_tomcatdir}/bin
485%attr(755,root,root) %{_tomcatdir}/bin/*.sh
486%{_tomcatdir}/bin/*.jar
487%dir %{_tomcatdir}/common
488%dir %{_tomcatdir}/common/classes
489%dir %{_tomcatdir}/common/endorsed
490%{_tomcatdir}/common/endorsed/*.jar
491%{_tomcatdir}/common/lib
492%{_tomcatdir}/conf
493%{_tomcatdir}/logs
494%dir %{_tomcatdir}/server
495%dir %{_tomcatdir}/server/classes
496%{_tomcatdir}/server/lib
497%{_tomcatdir}/server/webapps
498%{_tomcatdir}/webapps
499%{_tomcatdir}/work
500%{_tomcatdir}/shared
501%{_tomcatdir}/temp
502# tomcat wants to regenerate tomcat-users.xml
503%attr(775,root,http) %dir %{_sysconfdir}/tomcat
504%config(noreplace) %verify(not md5 mtime size) %{_sysconfdir}/tomcat/*
505%attr(754,root,root) /etc/rc.d/init.d/tomcat
506%dir %{_vardir}
507%attr(1730,root,http) %dir %{_vardir}/work
508%attr(1730,root,http) %dir %{_logdir}/tomcat
509
510%files doc
511%defattr(644,root,root,755)
512%doc catalina/docs/*
This page took 0.058711 seconds and 4 git commands to generate.