]>
Commit | Line | Data |
---|---|---|
1 | # Conditional build: | |
2 | %bcond_without javadoc # skip building javadocs | |
3 | # | |
4 | Summary: Apache Servlet/JSP Engine, RI for Servlet 2.4/JSP 2.0 API | |
5 | Summary(pl.UTF-8): Silnik Servlet/JSP Apache będący wzorcową implementacją API Servlet 2.4/JSP 2.0 | |
6 | Name: apache-tomcat | |
7 | Version: 5.5.23 | |
8 | Release: 0.1 | |
9 | License: Apache | |
10 | Group: Development/Languages/Java | |
11 | Source0: http://www.apache.org/dist/tomcat/tomcat-5/v%{version}/src/%{name}-%{version}-src.tar.gz | |
12 | # Source0-md5: 362d1d8b15dc09882440dcab8c592dd7 | |
13 | Source1: %{name}.init | |
14 | Patch0: %{name}-skip-servletapi.patch | |
15 | Patch1: %{name}-nsis.patch | |
16 | Patch2: %{name}-native.patch | |
17 | Patch3: %{name}-skip-jdt.patch | |
18 | Patch4: %{name}-no-connectors.patch | |
19 | Patch5: %{name}-nowrite.patch | |
20 | URL: http://tomcat.apache.org/ | |
21 | BuildRequires: ant >= 1.5.3 | |
22 | BuildRequires: ant-trax | |
23 | BuildRequires: eclipse-jdt | |
24 | BuildRequires: jaas | |
25 | BuildRequires: jakarta-commons-beanutils >= 1.7 | |
26 | BuildRequires: jakarta-commons-collections >= 0:3.1 | |
27 | BuildRequires: jakarta-commons-collections-tomcat5 >= 0:3.1 | |
28 | BuildRequires: jakarta-commons-daemon >= 1.0 | |
29 | BuildRequires: jakarta-commons-dbcp >= 0:1.2.1 | |
30 | BuildRequires: jakarta-commons-dbcp-tomcat5 >= 0:1.2.1 | |
31 | BuildRequires: jakarta-commons-digester >= 0:1.7 | |
32 | BuildRequires: jakarta-commons-el >= 0:1.0 | |
33 | BuildRequires: jakarta-commons-fileupload >= 0:1.0 | |
34 | BuildRequires: jakarta-commons-httpclient | |
35 | BuildRequires: jakarta-commons-launcher >= 0:0.9 | |
36 | BuildRequires: jakarta-commons-logging >= 0:1.0.4 | |
37 | BuildRequires: jakarta-commons-modeler >= 2.0 | |
38 | BuildRequires: jakarta-commons-pool >= 0:1.2 | |
39 | BuildRequires: jakarta-commons-pool-tomcat5 >= 0:1.2 | |
40 | BuildRequires: jakarta-regexp >= 0:1.3 | |
41 | BuildRequires: jakarta-servletapi5 | |
42 | #BuildRequires: jakarta-struts >= 0:1.2.7 | |
43 | BuildRequires: jakarta-struts >= 1.0.2 | |
44 | BuildRequires: javamail >= 0:1.3.1 | |
45 | BuildRequires: jaxp_parser_impl >= 0:2.7.1 | |
46 | BuildRequires: jdbc-stdext >= 0:2.0 | |
47 | BuildRequires: jdk >= 1.5 | |
48 | BuildRequires: jmx | |
49 | BuildRequires: jndi >= 0:1.2.1 | |
50 | BuildRequires: jpackage-utils | |
51 | BuildRequires: jsse >= 0:1.0.3 | |
52 | BuildRequires: jta >= 0:1.0.1 | |
53 | BuildRequires: junit >= 0:3.8.1 | |
54 | BuildRequires: logging-log4j | |
55 | #BuildRequires: mx4j >= 0:3.0.1 | |
56 | BuildRequires: mx4j >= 1.1.1 | |
57 | BuildRequires: puretls | |
58 | BuildRequires: rpmbuild(macros) >= 1.300 | |
59 | BuildRequires: xerces-j >= 0:2.7.1 | |
60 | BuildRequires: xml-commons | |
61 | #BuildRequires: xml-commons >= 1.3 | |
62 | Requires(post,postun): /sbin/ldconfig | |
63 | Requires(post,preun): /sbin/chkconfig | |
64 | Requires(postun): /usr/sbin/groupdel | |
65 | Requires(postun): /usr/sbin/userdel | |
66 | Requires(pre): /bin/id | |
67 | Requires(pre): /usr/bin/getgid | |
68 | Requires(pre): /usr/sbin/groupadd | |
69 | Requires(pre): /usr/sbin/useradd | |
70 | Requires: jaas | |
71 | #Requires: jaf >= 1.0.1 | |
72 | Requires: jakarta-commons-beanutils | |
73 | Requires: jakarta-commons-collections | |
74 | Requires: jakarta-commons-digester | |
75 | Requires: jakarta-commons-fileupload | |
76 | Requires: jakarta-commons-logging | |
77 | Requires: jakarta-regexp | |
78 | Requires: jakarta-servletapi >= 4 | |
79 | Requires: javamail >= 1.2 | |
80 | Requires: jaxp_parser_impl | |
81 | Requires: jdbc-stdext >= 2.0 | |
82 | Requires: jndi >= 1.2.1 | |
83 | Requires: jre >= 1.2 | |
84 | Requires: jsse >= 1.0.2 | |
85 | Requires: jta >= 1.0.1 | |
86 | Requires: mx4j >= 1.1.1 | |
87 | Requires: rc-scripts | |
88 | Requires: xml-commons | |
89 | Provides: group(http) | |
90 | Provides: user(http) | |
91 | Obsoletes: jakarta-tomcat | |
92 | BuildArch: noarch | |
93 | BuildRoot: %{tmpdir}/%{name}-%{version}-root-%(id -u -n) | |
94 | ||
95 | %define _tomcatdir %{_datadir}/tomcat | |
96 | %define _logdir %{_var}/log | |
97 | %define _vardir %{_var}/lib/tomcat | |
98 | %define _sysconfdir /etc/tomcat | |
99 | ||
100 | %description | |
101 | Tomcat is the servlet container that is used in the official Reference | |
102 | Implementation for the Java Servlet and JavaServer Pages technologies. | |
103 | The Java Servlet and JavaServer Pages specifications are developed by | |
104 | Sun under the Java Community Process. | |
105 | ||
106 | Tomcat is developed in an open and participatory environment and | |
107 | released under the Apache Software License. Tomcat is intended to be a | |
108 | collaboration of the best-of-breed developers from around the world. | |
109 | We invite you to participate in this open development project. | |
110 | ||
111 | %description -l pl.UTF-8 | |
112 | Tomcat to kontener serwletowy używany przez oficjalną implementację | |
113 | wzorcową technologii Java Servlet i JavaServer Pages. Specyfikacje | |
114 | Java Servlet i JavaServer Pages są rozwijane przez Suna zgodnie z Java | |
115 | Community Process. | |
116 | ||
117 | %package doc | |
118 | Summary: The Apache Tomcat Servlet/JSP Container documentation | |
119 | Summary(pl.UTF-8): Dokumentacja do Tomcata - kontekera Servlet/JSP | |
120 | Group: Development/Languages/Java | |
121 | Obsoletes: jakarta-tomcat-doc | |
122 | ||
123 | %description doc | |
124 | The Tomcat Servlet/JSP Container documentation. | |
125 | ||
126 | %description doc -l pl.UTF-8 | |
127 | Dokumentacja do Tomcata - kontekera Servlet/JSP. | |
128 | ||
129 | %prep | |
130 | %setup -q -n %{name}-%{version}-src | |
131 | %patch0 -p1 | |
132 | %patch1 -p1 | |
133 | %patch2 -p1 | |
134 | %patch3 -p1 | |
135 | %patch4 -p1 | |
136 | %patch5 -p1 | |
137 | ||
138 | # servletapi built from jakarta-servletapi5.spec | |
139 | rm -rf servletapi | |
140 | ||
141 | # Remove pre-built jars | |
142 | find -name '*.jar' | xargs rm -fv | |
143 | ||
144 | %build | |
145 | TOPDIR=$(pwd) | |
146 | ||
147 | mkdir -p tomcat-deps | |
148 | > tomcat-deps/tomcat-dbcp.jar | |
149 | ||
150 | %if 0 | |
151 | # build jasper javadocs | |
152 | cd jasper | |
153 | CLASSPATH=$(build-classpath xml-commons-apis) | |
154 | cat > build.properties <<EOF | |
155 | ant.jar=$(build-classpath ant) | |
156 | servlet-api.jar=$(build-classpath servlet-api) | |
157 | jsp-api.jar=$(build-classpath jsp-api) | |
158 | tools.jar=%{java_home}/lib/tools.jar | |
159 | xercesImpl.jar=$(build-classpath jaxp_parser_impl) | |
160 | xmlParserAPIs.jar=$(build-classpath xml-commons-apis) | |
161 | commons-collections.jar=$(build-classpath commons-collections) | |
162 | commons-logging.jar=$(build-classpath commons-logging) | |
163 | commons-daemon.jar=$(build-classpath commons-daemon) | |
164 | junit.jar=$(build-classpath junit) | |
165 | commons-el.jar=$(build-classpath commons-el) | |
166 | EOF | |
167 | # building jasper needs eclipse classes | |
168 | #%ant dist | |
169 | ||
170 | %if %{with javadoc} | |
171 | %ant javadoc \ | |
172 | -Dcompile.source=1.4 \ | |
173 | -Dbuild.compiler=modern \ | |
174 | ||
175 | %endif | |
176 | cd - | |
177 | %endif | |
178 | ||
179 | # build tomcat 5.5 | |
180 | cat > build.properties <<EOF | |
181 | commons-beanutils.jar=$(build-classpath commons-beanutils) | |
182 | commons-launcher.jar=$(build-classpath commons-launcher) | |
183 | commons-daemon.jar=$(build-classpath commons-daemon) | |
184 | commons-digester.jar=$(build-classpath commons-digester) | |
185 | commons-el.jar=$(build-classpath commons-el) | |
186 | commons-logging-api.jar=$(build-classpath commons-logging-api) | |
187 | commons-logging.jar=$(build-classpath commons-logging) | |
188 | commons-modeler.jar=$(build-classpath commons-modeler) | |
189 | xercesImpl.jar=$(build-classpath jaxp_parser_impl) | |
190 | xml-apis.jar=$(build-classpath xml-commons-apis) | |
191 | jdt.jar=$(build-classpath org.eclipse.jdt.core) | |
192 | jasper-compiler-jdt.home=$TOPDIR/tomcat-deps | |
193 | commons-httpclient.jar=$(build-classpath commons-httpclient) | |
194 | commons-collections.jar=$(build-classpath commons-collections) | |
195 | commons-fileupload.jar=$(build-classpath commons-fileupload) | |
196 | jmx.jar=$(build-classpath jmx) | |
197 | jmx-tools.jar=$(build-classpath jmx) | |
198 | junit.jar=$(build-classpath junit) | |
199 | struts.jar=$(build-classpath struts) | |
200 | jcert.jar=$(build-classpath java/jcert) | |
201 | jnet.jar=$(build-classpath java/jnet) | |
202 | jsse.jar=$(build-classpath java/jsse) | |
203 | jta.jar=$(build-classpath jta) | |
204 | puretls.jar=$(build-classpath puretls) | |
205 | servlet-api.jar=$(build-classpath servlet-api) | |
206 | servletapi.build.notrequired=true | |
207 | jsp-api.jar=$(build-classpath jsp-api) | |
208 | jspapi.build.notrequired=true | |
209 | log4j.jar=$(build-classpath log4j) | |
210 | # source is needed because source is copied modified and recompiled as tomcat jar | |
211 | # see <target name="-build-tomcat-dbcp"> in build/build.xml | |
212 | commons-collections.home=%{_prefix}/src/jakarta-commons-collections-3.1 | |
213 | commons-pool.home=%{_prefix}/src/jakarta-commons-pool-1.3 | |
214 | commons-dbcp.home=%{_prefix}/src/jakarta-commons-dbcp-1.2.1 | |
215 | tomcat-dbcp.home=$TOPDIR/tomcat-deps | |
216 | # err, it compiles three above and then appends to the jar, so the file should exist | |
217 | tomcat-dbcp.jar=$TOPDIR/tomcat-deps/tomcat-dbcp.jar | |
218 | EOF | |
219 | ||
220 | %ant \ | |
221 | -Dcompile.source=1.4 | |
222 | ||
223 | %install | |
224 | rm -rf $RPM_BUILD_ROOT | |
225 | cd build/build | |
226 | TOMCATDIR=$RPM_BUILD_ROOT%{_tomcatdir} | |
227 | CATALINADIR=$RPM_BUILD_ROOT/var/lib/tomcat | |
228 | ||
229 | # we don't need dos scripts | |
230 | rm -f bin/*.bat | |
231 | ||
232 | randpw=$(echo $RANDOM$$ | md5sum | cut -c 1-15) | |
233 | sed -i -e s:SHUTDOWN:${randpw}: conf/{server,server-minimal}.xml | |
234 | ||
235 | install -d $TOMCATDIR/bin \ | |
236 | $TOMCATDIR/common/{lib,classes,endorsed} \ | |
237 | $TOMCATDIR/server/{lib,classes} \ | |
238 | $TOMCATDIR/webapps \ | |
239 | $RPM_BUILD_ROOT%{_sysconfdir} \ | |
240 | $RPM_BUILD_ROOT%{_logdir}/tomcat \ | |
241 | $RPM_BUILD_ROOT%{_vardir}/work \ | |
242 | $RPM_BUILD_ROOT/etc/rc.d/init.d | |
243 | ||
244 | install %{SOURCE1} $RPM_BUILD_ROOT/etc/rc.d/init.d/tomcat | |
245 | ||
246 | cp -pR conf/* $RPM_BUILD_ROOT%{_sysconfdir} | |
247 | cp -HR bin common server $TOMCATDIR | |
248 | ||
249 | cp -rf server/webapps $TOMCATDIR/server | |
250 | cp -rf webapps $TOMCATDIR | |
251 | cp -rf shared $TOMCATDIR | |
252 | cp -rf temp $TOMCATDIR | |
253 | ||
254 | ln -sf %{_logdir}/tomcat $TOMCATDIR/logs | |
255 | ln -sf %{_vardir}/work $TOMCATDIR/work | |
256 | ln -sf %{_sysconfdir} $TOMCATDIR/conf | |
257 | ||
258 | # symlinks instead of copies | |
259 | ln -sf %{_javadir}/commons-daemon.jar $TOMCATDIR/bin | |
260 | ||
261 | ln -sf %{_javadir}/activation.jar $TOMCATDIR/common/lib | |
262 | ln -sf %{_javadir}/ant.jar $TOMCATDIR/common/lib | |
263 | ln -sf %{_javadir}/commons-collections.jar $TOMCATDIR/common/lib | |
264 | ln -sf %{_javadir}/commons-dbcp.jar $TOMCATDIR/common/lib | |
265 | ln -sf %{_javadir}/commons-logging-api.jar $TOMCATDIR/common/lib | |
266 | ln -sf %{_javadir}/commons-pool.jar $TOMCATDIR/common/lib | |
267 | ln -sf %{_javadir}/servlet.jar $TOMCATDIR/common/lib | |
268 | ln -sf %{_javadir}/servlet.jar $TOMCATDIR/common/lib/servletapi4.jar | |
269 | ln -sf %{_javadir}/jdbc-stdext.jar $TOMCATDIR/common/lib/jdbc2_0-stdext.jar | |
270 | ln -sf %{_javadir}/jdbc-stdext.jar $TOMCATDIR/common/lib/jdbc-stdext-2.0.jar | |
271 | ln -sf %{_javadir}/jmxri.jar $TOMCATDIR/common/lib | |
272 | ln -sf %{_javadir}/jndi.jar $TOMCATDIR/common/lib | |
273 | ln -sf %{_javadir}/jta.jar $TOMCATDIR/common/lib | |
274 | ln -sf %{_javadir}/mail.jar $TOMCATDIR/common/lib | |
275 | ln -sf %{_javadir}/jsse.jar $TOMCATDIR/common/lib | |
276 | ln -sf %{_javadir}/junit.jar $TOMCATDIR/common/lib | |
277 | ||
278 | ln -sf %{_javadir}/mailapi.jar $TOMCATDIR/common/lib | |
279 | ln -sf %{_javadir}/pop3.jar $TOMCATDIR/common/lib | |
280 | ln -sf %{_javadir}/pop3.jar $TOMCATDIR/common/lib/pop.jar | |
281 | ln -sf %{_javadir}/smtp.jar $TOMCATDIR/common/lib | |
282 | ln -sf %{_javadir}/imap.jar $TOMCATDIR/common/lib | |
283 | ||
284 | ln -sf %{_javadir}/commons-beanutils.jar $TOMCATDIR/server/lib | |
285 | ln -sf %{_javadir}/commons-digester.jar $TOMCATDIR/server/lib | |
286 | ln -sf %{_javadir}/commons-fileupload.jar $TOMCATDIR/server/lib | |
287 | ln -sf %{_javadir}/commons-logging.jar $TOMCATDIR/server/lib | |
288 | ln -sf %{_javadir}/commons-modeler.jar $TOMCATDIR/server/lib | |
289 | ln -sf %{_javadir}/jaas.jar $TOMCATDIR/server/lib/jaas.jar | |
290 | ln -sf %{_javadir}/mx4j-jmx.jar $TOMCATDIR/server/lib | |
291 | ln -sf %{_javadir}/regexp.jar $TOMCATDIR/server/lib | |
292 | ln -sf %{_javadir}/regexp.jar $TOMCATDIR/server/lib/jakarta-regexp-1.2.jar | |
293 | ln -sf %{_javadir}/regexp.jar $TOMCATDIR/server/lib/regexp-1.2.jar | |
294 | ||
295 | ln -sf %{_javadir}/jaxp_parser_impl.jar $TOMCATDIR/common/endorsed | |
296 | ln -sf %{_javadir}/xml-commons-apis.jar $TOMCATDIR/common/endorsed | |
297 | ||
298 | ln -sf %{_javadir}/struts.jar $TOMCATDIR/server/webapps/admin/WEB-INF/lib | |
299 | ||
300 | %clean | |
301 | rm -rf $RPM_BUILD_ROOT | |
302 | ||
303 | %pre | |
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 | |
306 | ||
307 | %post | |
308 | /sbin/chkconfig --add tomcat | |
309 | %service tomcat restart | |
310 | ||
311 | %preun | |
312 | if [ "$1" = "0" ]; then | |
313 | %service tomcat stop | |
314 | /sbin/chkconfig --del tomcat | |
315 | fi | |
316 | ||
317 | %postun | |
318 | if [ "$1" = "0" ]; then | |
319 | %userremove http | |
320 | %groupremove http | |
321 | fi | |
322 | ||
323 | %files | |
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 | |
330 | %dir %{_tomcatdir} | |
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 | |
347 | %{_tomcatdir}/conf | |
348 | %{_tomcatdir}/logs | |
349 | %dir %{_tomcatdir}/server | |
350 | %dir %{_tomcatdir}/server/classes | |
351 | %{_tomcatdir}/server/lib | |
352 | %{_tomcatdir}/server/webapps | |
353 | %{_tomcatdir}/webapps | |
354 | %{_tomcatdir}/work | |
355 | %{_tomcatdir}/shared | |
356 | %{_tomcatdir}/temp | |
357 | %dir %{_vardir} | |
358 | %dir %attr(1730,root,http) %{_vardir}/work | |
359 | %dir %attr(1730,root,http) %{_logdir}/tomcat | |
360 | ||
361 | %if 0 | |
362 | %files doc | |
363 | %defattr(644,root,root,755) | |
364 | %doc catalina/docs/* | |
365 | %endif |