2 # - packages for *.renametojar files (-cgi and -ssi in server/lib)
5 %bcond_without javadoc # skip building javadocs
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
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: 362d1d8b15dc09882440dcab8c592dd7
17 Patch0: %{name}-skip-servletapi.patch
18 Patch1: %{name}-nsis.patch
19 Patch2: %{name}-native.patch
20 Patch3: %{name}-skip-jdt.patch
21 Patch4: %{name}-no-connectors.patch
22 Patch5: %{name}-nowrite.patch
23 Patch6: %{name}-dbcp.patch
24 URL: http://tomcat.apache.org/
25 BuildRequires: ant >= 1.5.3
26 BuildRequires: ant-trax
27 BuildRequires: eclipse-jdt
29 BuildRequires: jakarta-commons-beanutils >= 1.7
30 BuildRequires: jakarta-commons-collections >= 0:3.1
31 BuildRequires: jakarta-commons-collections-tomcat5 >= 0:3.1
32 BuildRequires: jakarta-commons-daemon >= 1.0
33 BuildRequires: jakarta-commons-dbcp >= 0:1.2.1
34 BuildRequires: jakarta-commons-dbcp-tomcat5 >= 0:1.2.1
35 BuildRequires: jakarta-commons-digester >= 0:1.7
36 BuildRequires: jakarta-commons-el >= 0:1.0
37 BuildRequires: jakarta-commons-fileupload >= 0:1.0
38 BuildRequires: jakarta-commons-httpclient
39 BuildRequires: jakarta-commons-launcher >= 0:0.9
40 BuildRequires: jakarta-commons-logging >= 0:1.0.4
41 BuildRequires: jakarta-commons-modeler >= 2.0
42 BuildRequires: jakarta-commons-pool >= 0:1.2
43 BuildRequires: jakarta-commons-pool-tomcat5 >= 0:1.2
44 BuildRequires: jakarta-regexp >= 0:1.3
45 BuildRequires: jakarta-servletapi5
46 #BuildRequires: jakarta-struts >= 0:1.2.7
47 BuildRequires: jakarta-struts >= 1.0.2
48 BuildRequires: javamail >= 0:1.3.1
49 BuildRequires: jaxp_parser_impl >= 0:2.7.1
50 BuildRequires: jdbc-stdext >= 0:2.0
51 BuildRequires: jdk >= 1.5
53 BuildRequires: jndi >= 0:1.2.1
54 BuildRequires: jpackage-utils
55 BuildRequires: jsse >= 0:1.0.3
56 BuildRequires: jta >= 0:1.0.1
57 BuildRequires: junit >= 0:3.8.1
58 BuildRequires: logging-log4j
59 #BuildRequires: mx4j >= 0:3.0.1
60 BuildRequires: mx4j >= 1.1.1
61 BuildRequires: puretls
62 BuildRequires: rpmbuild(macros) >= 1.300
63 BuildRequires: xerces-j >= 0:2.7.1
64 BuildRequires: xml-commons
65 #BuildRequires: xml-commons >= 1.3
66 Requires(post,postun): /sbin/ldconfig
67 Requires(post,preun): /sbin/chkconfig
68 Requires(postun): /usr/sbin/groupdel
69 Requires(postun): /usr/sbin/userdel
70 Requires(pre): /bin/id
71 Requires(pre): /usr/bin/getgid
72 Requires(pre): /usr/sbin/groupadd
73 Requires(pre): /usr/sbin/useradd
75 #Requires: jaf >= 1.0.1
76 #Requires: jakarta-commons-beanutils
77 #Requires: jakarta-commons-collections
78 #Requires: jakarta-commons-dbcp-tomcat5
79 #Requires: jakarta-commons-digester
80 Requires: jakarta-commons-el
81 #Requires: jakarta-commons-fileupload
82 #Requires: jakarta-commons-logging
83 Requires: jakarta-regexp
84 Requires: jakarta-servletapi >= 4
85 Requires: javamail >= 1.2
86 Requires: jaxp_parser_impl
87 Requires: jdbc-stdext >= 2.0
88 Requires: jndi >= 1.2.1
90 Requires: jsse >= 1.0.2
91 Requires: jta >= 1.0.1
92 Requires: mx4j >= 1.1.1
97 Obsoletes: jakarta-tomcat
99 BuildRoot: %{tmpdir}/%{name}-%{version}-root-%(id -u -n)
101 %define _tomcatdir %{_datadir}/tomcat
102 %define _logdir %{_var}/log
103 %define _vardir %{_var}/lib/tomcat
104 %define _sysconfdir /etc/tomcat
107 Tomcat is the servlet container that is used in the official Reference
108 Implementation for the Java Servlet and JavaServer Pages technologies.
109 The Java Servlet and JavaServer Pages specifications are developed by
110 Sun under the Java Community Process.
112 Tomcat is developed in an open and participatory environment and
113 released under the Apache Software License. Tomcat is intended to be a
114 collaboration of the best-of-breed developers from around the world.
115 We invite you to participate in this open development project.
117 %description -l pl.UTF-8
118 Tomcat to kontener serwletowy używany przez oficjalną implementację
119 wzorcową technologii Java Servlet i JavaServer Pages. Specyfikacje
120 Java Servlet i JavaServer Pages są rozwijane przez Suna zgodnie z Java
124 Summary: The Apache Tomcat Servlet/JSP Container documentation
125 Summary(pl.UTF-8): Dokumentacja do Tomcata - kontekera Servlet/JSP
126 Group: Development/Languages/Java
127 Obsoletes: jakarta-tomcat-doc
130 The Tomcat Servlet/JSP Container documentation.
132 %description doc -l pl.UTF-8
133 Dokumentacja do Tomcata - kontekera Servlet/JSP.
136 %setup -q -n %{name}-%{version}-src
145 # servletapi built from jakarta-servletapi5.spec
148 # Remove pre-built jars
149 find -name '*.jar' | xargs rm -fv
155 # build jasper javadocs
157 CLASSPATH=$(build-classpath xml-commons-apis)
158 # building jasper needs eclipse classes
159 cat > build.properties <<EOF
160 ant.jar=$(find-jar ant)
161 servlet-api.jar=$(find-jar servlet-api)
162 jsp-api.jar=$(find-jar jsp-api)
163 tools.jar=%{java_home}/lib/tools.jar
164 xercesImpl.jar=$(find-jar jaxp_parser_impl)
165 xmlParserAPIs.jar=$(find-jar xml-commons-apis)
166 commons-collections.jar=$(find-jar commons-collections)
167 commons-logging.jar=$(find-jar commons-logging)
168 commons-daemon.jar=$(find-jar commons-daemon)
169 junit.jar=$(find-jar junit)
170 commons-el.jar=$(find-jar commons-el)
176 -Dcompile.source=1.4 \
177 -Dbuild.compiler=modern \
184 cat > build.properties <<EOF
185 commons-beanutils.jar=$(find-jar commons-beanutils)
186 commons-launcher.jar=$(find-jar commons-launcher)
187 commons-daemon.jar=$(find-jar commons-daemon)
188 commons-digester.jar=$(find-jar commons-digester)
189 commons-el.jar=$(find-jar commons-el)
190 commons-logging-api.jar=$(find-jar commons-logging-api)
191 commons-logging.jar=$(find-jar commons-logging)
192 commons-modeler.jar=$(find-jar commons-modeler)
193 xercesImpl.jar=$(find-jar jaxp_parser_impl)
194 xml-apis.jar=$(find-jar xml-commons-apis)
195 jdt.jar=$(find-jar org.eclipse.jdt.core)
196 jasper-compiler-jdt.home=$TOPDIR/tomcat-deps
197 commons-httpclient.jar=$(find-jar commons-httpclient)
198 commons-collections.jar=$(find-jar commons-collections)
199 commons-fileupload.jar=$(find-jar commons-fileupload)
200 jmx.jar=$(find-jar jmx)
201 jmx-tools.jar=$(find-jar jmx)
202 junit.jar=$(find-jar junit)
203 struts.jar=$(find-jar struts)
204 jcert.jar=$(find-jar jcert)
205 jnet.jar=$(find-jar jnet)
206 jsse.jar=$(find-jar jsse)
207 jta.jar=$(find-jar jta)
208 puretls.jar=$(find-jar puretls)
209 servlet-api.jar=$(find-jar servlet-api)
210 servletapi.build.notrequired=true
211 jsp-api.jar=$(find-jar jsp-api)
212 jspapi.build.notrequired=true
213 log4j.jar=$(find-jar log4j)
214 tomcat-dbcp.jar=$(find-jar jakarta-commons-dbcp-tomcat5)
221 rm -rf $RPM_BUILD_ROOT
223 TOMCATDIR=$RPM_BUILD_ROOT%{_tomcatdir}
224 CATALINADIR=$RPM_BUILD_ROOT/var/lib/tomcat
226 # we don't need dos scripts
229 randpw=$(echo $RANDOM$$ | md5sum | cut -c 1-15)
230 %{__sed} -i -e "s:SHUTDOWN:${randpw}:" conf/{server,server-minimal}.xml
232 install -d $TOMCATDIR/bin \
233 $TOMCATDIR/common/{lib,classes,endorsed} \
234 $TOMCATDIR/server/{lib,classes} \
236 $RPM_BUILD_ROOT%{_sysconfdir} \
237 $RPM_BUILD_ROOT%{_logdir}/tomcat \
238 $RPM_BUILD_ROOT%{_vardir}/work \
239 $RPM_BUILD_ROOT/etc/rc.d/init.d
241 install %{SOURCE1} $RPM_BUILD_ROOT/etc/rc.d/init.d/tomcat
243 cp -pR conf/* $RPM_BUILD_ROOT%{_sysconfdir}
244 cp -HR bin common server $TOMCATDIR
246 cp -rf server/webapps $TOMCATDIR/server
247 cp -rf webapps $TOMCATDIR
248 cp -rf shared $TOMCATDIR
249 cp -rf temp $TOMCATDIR
251 ln -sf %{_logdir}/tomcat $TOMCATDIR/logs
252 ln -sf %{_vardir}/work $TOMCATDIR/work
253 ln -sf %{_sysconfdir} $TOMCATDIR/conf
255 # symlinks instead of copies
256 ln -sf $(find-jar commons-el) $TOMCATDIR/common/lib/commons-el.jar
257 ln -sf $(find-jar jakarta-commons-dbcp-tomcat5) $TOMCATDIR/common/lib/jakarta-commons-dbcp-tomcat5.jar
258 ln -sf $(find-jar servlet-api) $TOMCATDIR/common/lib/servlet-api.jar
260 ln -sf $(find-jar commons-modeler) $TOMCATDIR/server/lib/commons-modeler.jar
263 # do not make these symlinks as ant didn't do
264 ln -sf $(find-jar commons-daemon) $TOMCATDIR/bin/commons-daemon.jar
265 ln -sf $(find-jar activation) $TOMCATDIR/common/lib/activation.jar
266 ln -sf $(find-jar ant) $TOMCATDIR/common/lib/ant.jar
267 ln -sf $(find-jar commons-collections) $TOMCATDIR/common/lib/commons-collections.jar
268 ln -sf $(find-jar commons-dbcp) $TOMCATDIR/common/lib/commons-dbcp.jar
269 ln -sf $(find-jar commons-logging-api) $TOMCATDIR/common/lib/commons-logging-api.jar
270 ln -sf $(find-jar commons-pool) $TOMCATDIR/common/lib/commons-pool.jar
271 ln -sf $(find-jar servlet) $TOMCATDIR/common/lib/servlet.jar
272 ln -sf $(find-jar servlet) $TOMCATDIR/common/lib/servletapi4.jar
273 ln -sf $(find-jar jdbc-stdext) $TOMCATDIR/common/lib/jdbc-stdext.jar
274 ln -sf jdbc-stdext.jar $TOMCATDIR/common/lib/jdbc2_0-stdext.jar
275 ln -sf jdbc-stdext.jar $TOMCATDIR/common/lib/jdbc-stdext-2.0.jar
276 ln -sf $(find-jar jmxri) $TOMCATDIR/common/lib/jmxri.jar
277 ln -sf $(find-jar jndi) $TOMCATDIR/common/lib/jndi.jar
278 ln -sf $(find-jar jta) $TOMCATDIR/common/lib/jta.jar
279 ln -sf $(find-jar mail) $TOMCATDIR/common/lib/mail.jar
280 ln -sf $(find-jar jsse) $TOMCATDIR/common/lib/jsse.jar
281 ln -sf $(find-jar junit) $TOMCATDIR/common/lib/junit.jar
282 ln -sf $(find-jar mailapi) $TOMCATDIR/common/lib/mailapi.jar
283 ln -sf $(find-jar pop3) $TOMCATDIR/common/lib/pop3.jar
284 ln -sf pop3.jar $TOMCATDIR/common/lib/pop.jar
285 ln -sf $(find-jar smtp) $TOMCATDIR/common/lib/smtp.jar
286 ln -sf $(find-jar imap) $TOMCATDIR/common/lib/imap.jar
287 ln -sf $(find-jar commons-beanutils) $TOMCATDIR/server/lib/commons-beanutils.jar
288 ln -sf $(find-jar commons-digester) $TOMCATDIR/server/lib/commons-digester.jar
289 ln -sf $(find-jar commons-fileupload) $TOMCATDIR/server/lib/commons-fileupload.jar
290 ln -sf $(find-jar commons-logging) $TOMCATDIR/server/lib/commons-logging.jar
291 ln -sf $(find-jar jaas) $TOMCATDIR/server/lib/jaas.jar
292 ln -sf $(find-jar mx4j-jmx) $TOMCATDIR/server/lib/mx4j-jmx.jar
293 ln -sf $(find-jar regexp) $TOMCATDIR/server/lib/regexp.jar
294 ln -sf $(find-jar regexp) $TOMCATDIR/server/lib/jakarta-regexp-1.2.jar
295 ln -sf $(find-jar regexp) $TOMCATDIR/server/lib/regexp-1.2.jar
298 ln -sf $(find-jar jaxp_parser_impl) $TOMCATDIR/common/endorsed/jaxp_parser_impl.jar
299 ln -sf $(find-jar xml-commons-apis) $TOMCATDIR/common/endorsed/xml-commons-apis.jar
300 ln -sf $(find-jar struts) $TOMCATDIR/server/webapps/admin/WEB-INF/lib/struts.jar
303 rm -rf $RPM_BUILD_ROOT
306 %groupadd -g 51 -r -f http
307 %useradd -u 51 -r -d /home/services/httpd -s /bin/false -c "HTTP User" -g http http
310 /sbin/chkconfig --add tomcat
311 %service tomcat restart
314 if [ "$1" = "0" ]; then
316 /sbin/chkconfig --del tomcat
320 if [ "$1" = "0" ]; then
326 %defattr(644,root,root,755)
327 %doc build/{RELEASE-NOTES,RUNNING.txt}
328 # tomcat wants to regenerate tomcat-users.xml
329 %dir %attr(775,root,http) %{_sysconfdir}
330 %config(noreplace) %verify(not md5 mtime size) %{_sysconfdir}/*
331 %attr(754,root,root) /etc/rc.d/init.d/tomcat
333 %dir %{_tomcatdir}/bin
334 %{_tomcatdir}/bin/catalina-tasks.xml
335 %{_tomcatdir}/bin/jkstatus-tasks.xml
336 %{_tomcatdir}/bin/jmxaccessor-tasks.xml
337 %attr(755,root,root) %{_tomcatdir}/bin/*.sh
338 %{_tomcatdir}/bin/*.jar
339 %dir %{_tomcatdir}/common
340 %dir %{_tomcatdir}/common/classes
341 %dir %{_tomcatdir}/common/endorsed
342 %dir %{_tomcatdir}/common/i18n
343 %{_tomcatdir}/common/endorsed/*.jar
344 %{_tomcatdir}/common/i18n/tomcat-i18n-en.jar
345 %lang(es) %{_tomcatdir}/common/i18n/tomcat-i18n-es.jar
346 %lang(fr) %{_tomcatdir}/common/i18n/tomcat-i18n-fr.jar
347 %lang(ja) %{_tomcatdir}/common/i18n/tomcat-i18n-ja.jar
348 %{_tomcatdir}/common/lib
351 %dir %{_tomcatdir}/server
352 %dir %{_tomcatdir}/server/classes
353 %{_tomcatdir}/server/lib
354 %{_tomcatdir}/server/webapps
355 %{_tomcatdir}/webapps
360 %dir %attr(1730,root,http) %{_vardir}/work
361 %dir %attr(1730,root,http) %{_logdir}/tomcat
365 %defattr(644,root,root,755)