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