]>
Commit | Line | Data |
---|---|---|
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.1 | |
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 | Patch0: %{name}-skip-servletapi.patch | |
19 | Patch1: %{name}-nsis.patch | |
20 | Patch2: %{name}-native.patch | |
21 | Patch3: %{name}-skip-jdt.patch | |
22 | Patch4: %{name}-no-connectors.patch | |
23 | Patch5: %{name}-dbcp.patch | |
24 | # this patch is needed for struts >= 1.3 | |
25 | Patch6: %{name}-struts.patch | |
26 | URL: http://tomcat.apache.org/ | |
27 | BuildRequires: ant >= 1.5.3 | |
28 | BuildRequires: ant-trax | |
29 | BuildRequires: eclipse-jdt | |
30 | BuildRequires: jaas | |
31 | BuildRequires: java-commons-httpclient | |
32 | BuildRequires: jakarta-regexp >= 0:1.3 | |
33 | #BuildRequires: java-struts >= 0:1.2.7 | |
34 | BuildRequires: java-struts >= 1.0.2 | |
35 | BuildRequires: java-commons-beanutils >= 1.7 | |
36 | BuildRequires: java-commons-collections >= 0:3.1 | |
37 | BuildRequires: java-commons-collections-tomcat5 >= 0:3.1 | |
38 | BuildRequires: java-commons-daemon >= 1.0 | |
39 | BuildRequires: java-commons-dbcp >= 0:1.2.1 | |
40 | BuildRequires: java-commons-dbcp-tomcat5 >= 0:1.2.1 | |
41 | BuildRequires: java-commons-digester >= 0:1.7 | |
42 | BuildRequires: java-commons-el >= 0:1.0 | |
43 | BuildRequires: java-commons-fileupload >= 0:1.0 | |
44 | BuildRequires: java-commons-io >= 1.4 | |
45 | BuildRequires: java-commons-launcher >= 0:0.9 | |
46 | BuildRequires: java-commons-logging >= 0:1.0.4 | |
47 | BuildRequires: java-commons-modeler >= 2.0 | |
48 | BuildRequires: java-commons-pool >= 0:1.2 | |
49 | BuildRequires: java-commons-pool-tomcat5 >= 0:1.2 | |
50 | BuildRequires: java-servletapi5 = %{version} | |
51 | BuildRequires: javamail >= 0:1.3.1 | |
52 | BuildRequires: jaxp_parser_impl >= 0:2.7.1 | |
53 | BuildRequires: jdbc-stdext >= 0:2.0 | |
54 | BuildRequires: jdk >= 1.5 | |
55 | BuildRequires: jmx | |
56 | BuildRequires: jndi >= 0:1.2.1 | |
57 | BuildRequires: jpackage-utils | |
58 | BuildRequires: jsse >= 0:1.0.3 | |
59 | BuildRequires: jta >= 0:1.0.1 | |
60 | BuildRequires: junit >= 0:3.8.1 | |
61 | BuildRequires: logging-log4j | |
62 | BuildRequires: puretls | |
63 | BuildRequires: rpmbuild(macros) >= 1.300 | |
64 | BuildRequires: xerces-j >= 0:2.7.1 | |
65 | BuildRequires: xml-commons | |
66 | #BuildRequires: xml-commons >= 1.3 | |
67 | Requires(post,postun): /sbin/ldconfig | |
68 | Requires(post,preun): /sbin/chkconfig | |
69 | Requires(postun): /usr/sbin/groupdel | |
70 | Requires(postun): /usr/sbin/userdel | |
71 | Requires(pre): /bin/id | |
72 | Requires(pre): /usr/bin/getgid | |
73 | Requires(pre): /usr/sbin/groupadd | |
74 | Requires(pre): /usr/sbin/useradd | |
75 | Requires: jaas | |
76 | #Requires: jaf >= 1.0.1 | |
77 | Requires: jakarta-regexp | |
78 | #Requires: java-commons-beanutils | |
79 | #Requires: java-commons-collections | |
80 | #Requires: java-commons-dbcp-tomcat5 | |
81 | #Requires: java-commons-digester | |
82 | Requires: java-commons-el | |
83 | #Requires: java-commons-fileupload | |
84 | #Requires: java-commons-logging | |
85 | Requires: java-servletapi5 = %{version} | |
86 | Requires: javamail >= 1.2 | |
87 | Requires: jaxp_parser_impl | |
88 | Requires: jdbc-stdext >= 2.0 | |
89 | Requires: jndi >= 1.2.1 | |
90 | Requires: jre >= 1.2 | |
91 | Requires: jsse >= 1.0.2 | |
92 | Requires: jta >= 1.0.1 | |
93 | Requires: rc-scripts | |
94 | Requires: xml-commons | |
95 | Provides: group(http) | |
96 | Provides: user(http) | |
97 | Obsoletes: jakarta-tomcat | |
98 | BuildArch: noarch | |
99 | BuildRoot: %{tmpdir}/%{name}-%{version}-root-%(id -u -n) | |
100 | ||
101 | %define _tomcatdir %{_datadir}/tomcat | |
102 | %define _logdir %{_var}/log | |
103 | %define _vardir %{_var}/lib/tomcat | |
104 | %define _sysconfdir /etc/tomcat | |
105 | ||
106 | %description | |
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. | |
111 | ||
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. | |
116 | ||
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 | |
121 | Community Process. | |
122 | ||
123 | %package doc | |
124 | Summary: The Apache Tomcat Servlet/JSP Container documentation | |
125 | Summary(pl.UTF-8): Dokumentacja do Tomcata - kontenera Servlet/JSP | |
126 | Group: Development/Languages/Java | |
127 | Obsoletes: jakarta-tomcat-doc | |
128 | ||
129 | %description doc | |
130 | The Tomcat Servlet/JSP Container documentation. | |
131 | ||
132 | %description doc -l pl.UTF-8 | |
133 | Dokumentacja do Tomcata - kontenera 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 | %patch5 -p1 | |
143 | %patch6 -p1 | |
144 | ||
145 | # servletapi built from jakarta-servletapi5.spec | |
146 | rm -rf servletapi | |
147 | ||
148 | # Remove pre-built jars | |
149 | find -name '*.jar' | xargs rm -fv | |
150 | ||
151 | %build | |
152 | TOPDIR=$(pwd) | |
153 | ||
154 | %if 0 | |
155 | # build jasper javadocs | |
156 | cd jasper | |
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) | |
171 | EOF | |
172 | #%ant dist | |
173 | ||
174 | %if %{with javadoc} | |
175 | %ant javadoc \ | |
176 | -Dcompile.source=1.4 \ | |
177 | -Dbuild.compiler=modern \ | |
178 | ||
179 | %endif | |
180 | cd - | |
181 | %endif | |
182 | ||
183 | # build tomcat 5.5 | |
184 | cat > build.properties <<EOF | |
185 | commons-beanutils.jar=$(find-jar commons-beanutils-core) | |
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 | commons-io.jar=$(find-jar commons-io) | |
201 | jmx.jar=$(find-jar jmx) | |
202 | jmx-tools.jar=$(find-jar jmx) | |
203 | junit.jar=$(find-jar junit) | |
204 | struts.jar=$(find-jar struts-core) | |
205 | struts-core.jar=$(find-jar struts-core) | |
206 | struts-taglib.jar=$(find-jar struts-taglib) | |
207 | jcert.jar=$(find-jar jcert) | |
208 | jnet.jar=$(find-jar jnet) | |
209 | jsse.jar=$(find-jar jsse) | |
210 | jta.jar=$(find-jar jta) | |
211 | puretls.jar=$(find-jar puretls) | |
212 | servlet-api.jar=$(find-jar servlet-api) | |
213 | servletapi.build.notrequired=true | |
214 | jsp-api.jar=$(find-jar jsp-api) | |
215 | jspapi.build.notrequired=true | |
216 | log4j.jar=$(find-jar log4j) | |
217 | tomcat-dbcp.jar=$(find-jar commons-dbcp-tomcat5) | |
218 | struts.lib=%{_datadir}/java-struts | |
219 | EOF | |
220 | ||
221 | %ant \ | |
222 | -Dcompile.source=1.4 | |
223 | ||
224 | %install | |
225 | rm -rf $RPM_BUILD_ROOT | |
226 | cd build/build | |
227 | TOMCATDIR=$RPM_BUILD_ROOT%{_tomcatdir} | |
228 | CATALINADIR=$RPM_BUILD_ROOT/var/lib/tomcat | |
229 | ||
230 | # we don't need dos scripts | |
231 | rm -f bin/*.bat | |
232 | ||
233 | randpw=$(echo $RANDOM$$ | md5sum | cut -c 1-15) | |
234 | %{__sed} -i -e "s:SHUTDOWN:${randpw}:" conf/{server,server-minimal}.xml | |
235 | ||
236 | install -d $TOMCATDIR/bin \ | |
237 | $TOMCATDIR/common/{lib,classes,endorsed} \ | |
238 | $TOMCATDIR/server/{lib,classes} \ | |
239 | $TOMCATDIR/webapps \ | |
240 | $RPM_BUILD_ROOT%{_logdir}/tomcat \ | |
241 | $RPM_BUILD_ROOT%{_vardir}/webapps \ | |
242 | $RPM_BUILD_ROOT%{_vardir}/work \ | |
243 | $RPM_BUILD_ROOT%{_vardir}/conf \ | |
244 | $RPM_BUILD_ROOT/etc/sysconfig \ | |
245 | $RPM_BUILD_ROOT/etc/rc.d/init.d | |
246 | ||
247 | install %{SOURCE1} $RPM_BUILD_ROOT/etc/rc.d/init.d/tomcat | |
248 | install %{SOURCE2} $RPM_BUILD_ROOT/etc/sysconfig/tomcat | |
249 | ||
250 | cp -pR conf/* $CATALINADIR/conf | |
251 | cp -HR bin common server $TOMCATDIR | |
252 | ||
253 | cp -rf server/webapps $TOMCATDIR/server | |
254 | cp -rf webapps $TOMCATDIR | |
255 | cp -rf shared $TOMCATDIR | |
256 | cp -rf temp $TOMCATDIR | |
257 | ||
258 | ln -sf %{_logdir}/tomcat $CATALINADIR/logs | |
259 | ln -sf %{_vardir}/work $TOMCATDIR/work | |
260 | ln -sf %{_vardir}/conf $TOMCATDIR/conf | |
261 | ln -sf %{_vardir}/conf $RPM_BUILD_ROOT%{_sysconfdir} | |
262 | ||
263 | # symlinks instead of copies | |
264 | ln -sf $(find-jar commons-el) $TOMCATDIR/common/lib/commons-el.jar | |
265 | ln -sf $(find-jar jakarta-commons-dbcp-tomcat5) $TOMCATDIR/common/lib/jakarta-commons-dbcp-tomcat5.jar | |
266 | ln -sf $(find-jar servlet-api) $TOMCATDIR/common/lib/servlet-api.jar | |
267 | ||
268 | ln -sf $(find-jar commons-modeler) $TOMCATDIR/server/lib/commons-modeler.jar | |
269 | ||
270 | %if 0 | |
271 | # do not make these symlinks as ant didn't do | |
272 | ln -sf $(find-jar commons-daemon) $TOMCATDIR/bin/commons-daemon.jar | |
273 | ln -sf $(find-jar activation) $TOMCATDIR/common/lib/activation.jar | |
274 | ln -sf $(find-jar ant) $TOMCATDIR/common/lib/ant.jar | |
275 | ln -sf $(find-jar commons-collections) $TOMCATDIR/common/lib/commons-collections.jar | |
276 | ln -sf $(find-jar commons-dbcp) $TOMCATDIR/common/lib/commons-dbcp.jar | |
277 | ln -sf $(find-jar commons-logging-api) $TOMCATDIR/common/lib/commons-logging-api.jar | |
278 | ln -sf $(find-jar commons-pool) $TOMCATDIR/common/lib/commons-pool.jar | |
279 | ln -sf $(find-jar servlet) $TOMCATDIR/common/lib/servlet.jar | |
280 | ln -sf $(find-jar servlet) $TOMCATDIR/common/lib/servletapi4.jar | |
281 | ln -sf $(find-jar jdbc-stdext) $TOMCATDIR/common/lib/jdbc-stdext.jar | |
282 | ln -sf jdbc-stdext.jar $TOMCATDIR/common/lib/jdbc2_0-stdext.jar | |
283 | ln -sf jdbc-stdext.jar $TOMCATDIR/common/lib/jdbc-stdext-2.0.jar | |
284 | ln -sf $(find-jar jmxri) $TOMCATDIR/common/lib/jmxri.jar | |
285 | ln -sf $(find-jar jndi) $TOMCATDIR/common/lib/jndi.jar | |
286 | ln -sf $(find-jar jta) $TOMCATDIR/common/lib/jta.jar | |
287 | ln -sf $(find-jar mail) $TOMCATDIR/common/lib/mail.jar | |
288 | ln -sf $(find-jar jsse) $TOMCATDIR/common/lib/jsse.jar | |
289 | ln -sf $(find-jar junit) $TOMCATDIR/common/lib/junit.jar | |
290 | ln -sf $(find-jar mailapi) $TOMCATDIR/common/lib/mailapi.jar | |
291 | ln -sf $(find-jar pop3) $TOMCATDIR/common/lib/pop3.jar | |
292 | ln -sf pop3.jar $TOMCATDIR/common/lib/pop.jar | |
293 | ln -sf $(find-jar smtp) $TOMCATDIR/common/lib/smtp.jar | |
294 | ln -sf $(find-jar imap) $TOMCATDIR/common/lib/imap.jar | |
295 | ln -sf $(find-jar commons-beanutils) $TOMCATDIR/server/lib/commons-beanutils.jar | |
296 | ln -sf $(find-jar commons-digester) $TOMCATDIR/server/lib/commons-digester.jar | |
297 | ln -sf $(find-jar commons-fileupload) $TOMCATDIR/server/lib/commons-fileupload.jar | |
298 | ln -sf $(find-jar commons-logging) $TOMCATDIR/server/lib/commons-logging.jar | |
299 | ln -sf $(find-jar jaas) $TOMCATDIR/server/lib/jaas.jar | |
300 | ln -sf $(find-jar regexp) $TOMCATDIR/server/lib/regexp.jar | |
301 | ln -sf $(find-jar regexp) $TOMCATDIR/server/lib/jakarta-regexp-1.2.jar | |
302 | ln -sf $(find-jar regexp) $TOMCATDIR/server/lib/regexp-1.2.jar | |
303 | %endif | |
304 | ||
305 | ln -sf $(find-jar jaxp_parser_impl) $TOMCATDIR/common/endorsed/jaxp_parser_impl.jar | |
306 | ln -sf $(find-jar xml-commons-apis) $TOMCATDIR/common/endorsed/xml-commons-apis.jar | |
307 | ln -sf $(find-jar struts-core) $TOMCATDIR/server/webapps/admin/WEB-INF/lib/struts-core.jar | |
308 | ||
309 | %clean | |
310 | rm -rf $RPM_BUILD_ROOT | |
311 | ||
312 | %pre | |
313 | %groupadd -g 51 -r -f http | |
314 | %useradd -u 51 -r -d /home/services/httpd -s /bin/false -c "HTTP User" -g http http | |
315 | ||
316 | %post | |
317 | /sbin/chkconfig --add tomcat | |
318 | %service tomcat restart | |
319 | ||
320 | %preun | |
321 | if [ "$1" = "0" ]; then | |
322 | %service tomcat stop | |
323 | /sbin/chkconfig --del tomcat | |
324 | fi | |
325 | ||
326 | %postun | |
327 | if [ "$1" = "0" ]; then | |
328 | %userremove http | |
329 | %groupremove http | |
330 | fi | |
331 | ||
332 | %files | |
333 | %defattr(644,root,root,755) | |
334 | %doc build/{RELEASE-NOTES,RUNNING.txt} | |
335 | %attr(754,root,root) /etc/rc.d/init.d/tomcat | |
336 | %config(noreplace) %verify(not md5 mtime size) /etc/sysconfdir/tomcat | |
337 | %{_sysconfdir} | |
338 | %dir %{_tomcatdir} | |
339 | %dir %{_tomcatdir}/conf | |
340 | %dir %{_tomcatdir}/bin | |
341 | %{_tomcatdir}/bin/catalina-tasks.xml | |
342 | %{_tomcatdir}/bin/jkstatus-tasks.xml | |
343 | %{_tomcatdir}/bin/jmxaccessor-tasks.xml | |
344 | %attr(755,root,root) %{_tomcatdir}/bin/*.sh | |
345 | %{_tomcatdir}/bin/*.jar | |
346 | %dir %{_tomcatdir}/common | |
347 | %dir %{_tomcatdir}/common/classes | |
348 | %dir %{_tomcatdir}/common/endorsed | |
349 | %dir %{_tomcatdir}/common/i18n | |
350 | %{_tomcatdir}/common/endorsed/*.jar | |
351 | %{_tomcatdir}/common/i18n/tomcat-i18n-en.jar | |
352 | %lang(es) %{_tomcatdir}/common/i18n/tomcat-i18n-es.jar | |
353 | %lang(fr) %{_tomcatdir}/common/i18n/tomcat-i18n-fr.jar | |
354 | %lang(ja) %{_tomcatdir}/common/i18n/tomcat-i18n-ja.jar | |
355 | %{_tomcatdir}/common/lib | |
356 | %dir %{_tomcatdir}/server | |
357 | %dir %{_tomcatdir}/server/classes | |
358 | %{_tomcatdir}/server/lib | |
359 | %{_tomcatdir}/server/webapps | |
360 | %{_tomcatdir}/webapps | |
361 | %{_tomcatdir}/work | |
362 | %{_tomcatdir}/shared | |
363 | %{_tomcatdir}/temp | |
364 | %dir %{_vardir} | |
365 | # tomcat config has to be writeable because of tomacta-users.xml file and | |
366 | # Catalina dir | |
367 | %config(noreplace) %attr(775,root,http) %verify(not md5 mtime size) %{_vardir}/conf | |
368 | %dir %attr(1730,root,http) %{_vardir}/work | |
369 | %dir %attr(775,root,http) %{_vardir}/webapps | |
370 | %dir %attr(775,root,http) %{_logdir}/tomcat | |
371 | %{_vardir}/logs | |
372 | ||
373 | %if 0 | |
374 | %files doc | |
375 | %defattr(644,root,root,755) | |
376 | %doc catalina/docs/* | |
377 | %endif |