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