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