]>
Commit | Line | Data |
---|---|---|
1 | # TODO | |
2 | # - spec vs filename | |
3 | # | |
4 | # Conditional build: | |
5 | %bcond_with binary # build from binary source | |
6 | %bcond_without javadoc # skip building javadocs | |
7 | # | |
8 | Summary: Apache Servlet/JSP Engine, RI for Servlet 2.4/JSP 2.0 API | |
9 | Summary(pl.UTF-8): Silnik Servlet/JSP Apache będący wzorcową implementacją API Servlet 2.4/JSP 2.0 | |
10 | Name: apache-tomcat | |
11 | Version: 5.5.23 | |
12 | Release: 0.1 | |
13 | License: Apache | |
14 | Group: Development/Languages/Java | |
15 | Source0: http://www.apache.org/dist/tomcat/tomcat-5/v%{version}/src/%{name}-%{version}-src.tar.gz | |
16 | # Source0-md5: 362d1d8b15dc09882440dcab8c592dd7 | |
17 | Source1: jakarta-tomcat.init | |
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 | URL: http://tomcat.apache.org/ | |
24 | BuildRequires: ant >= 1.5.3 | |
25 | BuildRequires: ant-trax | |
26 | BuildRequires: eclipse-jdt | |
27 | BuildRequires: jaas | |
28 | BuildRequires: jakarta-commons-beanutils >= 1.7 | |
29 | BuildRequires: jakarta-commons-collections >= 0:3.1 | |
30 | BuildRequires: jakarta-commons-collections-source >= 0:3.1 | |
31 | BuildRequires: jakarta-commons-daemon >= 1.0 | |
32 | BuildRequires: jakarta-commons-dbcp >= 0:1.2.1 | |
33 | BuildRequires: jakarta-commons-dbcp-source >= 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-source >= 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 | |
51 | BuildRequires: jndi >= 0:1.2.1 | |
52 | BuildRequires: jpackage-utils | |
53 | BuildRequires: jsse >= 0:1.0.3 | |
54 | BuildRequires: jta >= 0:1.0.1 | |
55 | BuildRequires: junit >= 0:3.8.1 | |
56 | BuildRequires: logging-log4j | |
57 | #BuildRequires: mx4j >= 0:3.0.1 | |
58 | BuildRequires: mx4j >= 1.1.1 | |
59 | BuildRequires: puretls | |
60 | BuildRequires: rpmbuild(macros) >= 1.300 | |
61 | BuildRequires: xerces-j >= 0:2.7.1 | |
62 | BuildRequires: xml-commons | |
63 | #BuildRequires: xml-commons >= 1.3 | |
64 | Requires(post,postun): /sbin/ldconfig | |
65 | Requires(post,preun): /sbin/chkconfig | |
66 | Requires(postun): /usr/sbin/groupdel | |
67 | Requires(postun): /usr/sbin/userdel | |
68 | Requires(pre): /bin/id | |
69 | Requires(pre): /usr/bin/getgid | |
70 | Requires(pre): /usr/sbin/groupadd | |
71 | Requires(pre): /usr/sbin/useradd | |
72 | Requires: jaas | |
73 | #Requires: jaf >= 1.0.1 | |
74 | Requires: jakarta-commons-beanutils | |
75 | Requires: jakarta-commons-collections | |
76 | Requires: jakarta-commons-digester | |
77 | Requires: jakarta-commons-fileupload | |
78 | Requires: jakarta-commons-logging | |
79 | Requires: jakarta-regexp | |
80 | Requires: jakarta-servletapi >= 4 | |
81 | Requires: javamail >= 1.2 | |
82 | Requires: jaxp_parser_impl | |
83 | Requires: jdbc-stdext >= 2.0 | |
84 | Requires: jndi >= 1.2.1 | |
85 | Requires: jre >= 1.2 | |
86 | Requires: jsse >= 1.0.2 | |
87 | Requires: jta >= 1.0.1 | |
88 | Requires: mx4j >= 1.1.1 | |
89 | Requires: rc-scripts | |
90 | Requires: xml-commons | |
91 | Provides: group(http) | |
92 | Provides: user(http) | |
93 | Obsoletes: jakarta-tomcat | |
94 | BuildArch: noarch | |
95 | BuildRoot: %{tmpdir}/%{name}-%{version}-root-%(id -u -n) | |
96 | ||
97 | %define _tomcatdir %{_libdir}/tomcat | |
98 | %define _logdir %{_var}/log | |
99 | %define _vardir %{_var}/lib/tomcat | |
100 | ||
101 | %description | |
102 | Tomcat is the servlet container that is used in the official Reference | |
103 | Implementation for the Java Servlet and JavaServer Pages technologies. | |
104 | The Java Servlet and JavaServer Pages specifications are developed by | |
105 | Sun under the Java Community Process. | |
106 | ||
107 | Tomcat is developed in an open and participatory environment and | |
108 | released under the Apache Software License. Tomcat is intended to be a | |
109 | collaboration of the best-of-breed developers from around the world. | |
110 | We invite you to participate in this open development project. | |
111 | ||
112 | %description -l pl.UTF-8 | |
113 | Tomcat to kontener serwletowy używany przez oficjalną implementację | |
114 | wzorcową technologii Java Servlet i JavaServer Pages. Specyfikacje | |
115 | Java Servlet i JavaServer Pages są rozwijane przez Suna zgodnie z Java | |
116 | Community Process. | |
117 | ||
118 | %package doc | |
119 | Summary: The Apache Tomcat Servlet/JSP Container documentation | |
120 | Summary(pl.UTF-8): Dokumentacja do Tomcata - kontekera Servlet/JSP | |
121 | Group: Development/Languages/Java | |
122 | Obsoletes: jakarta-tomcat-doc | |
123 | ||
124 | %description doc | |
125 | The Tomcat Servlet/JSP Container documentation. | |
126 | ||
127 | %description doc -l pl.UTF-8 | |
128 | Dokumentacja do Tomcata - kontekera Servlet/JSP. | |
129 | ||
130 | %prep | |
131 | %setup -q -n %{name}-%{version}-src | |
132 | %patch0 -p1 | |
133 | %patch1 -p1 | |
134 | %patch2 -p1 | |
135 | %patch3 -p1 | |
136 | %patch4 -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 jre/jmx) | |
197 | jmx-tools.jar=$(build-classpath jre/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 | ||
226 | DEST=$RPM_BUILD_ROOT%{_tomcatdir} | |
227 | ||
228 | install -d $DEST/bin \ | |
229 | $DEST/common/{lib,classes,endorsed} \ | |
230 | $DEST/server/{lib,classes} \ | |
231 | $DEST/webapps \ | |
232 | $RPM_BUILD_ROOT%{_sysconfdir}/tomcat \ | |
233 | $RPM_BUILD_ROOT%{_logdir}/tomcat \ | |
234 | $RPM_BUILD_ROOT%{_vardir}/work \ | |
235 | $RPM_BUILD_ROOT/etc/rc.d/init.d | |
236 | ||
237 | install build/bin/*.sh $DEST/bin | |
238 | install build/bin/bootstrap*.jar $DEST/bin | |
239 | install build/bin/tomcat*.jar $DEST/bin | |
240 | install build/common/lib/naming-*.jar $DEST/common/lib | |
241 | install build/common/lib/jasper-*.jar $DEST/common/lib | |
242 | install build/conf/* $RPM_BUILD_ROOT%{_sysconfdir}/tomcat | |
243 | install build/server/lib/catalina*.jar $DEST/server/lib | |
244 | install build/server/lib/servlets*.jar $DEST/server/lib | |
245 | install build/server/lib/tomcat*.jar $DEST/server/lib | |
246 | install build/server/lib/servlets-cgi.renametojar $DEST/server/lib/servlets-cgi.jar | |
247 | install build/server/lib/servlets-ssi.renametojar $DEST/server/lib/servlets-ssi.jar | |
248 | cp -rf build/server/webapps $DEST/server | |
249 | cp -rf build/webapps $DEST | |
250 | cp -rf build/shared $DEST | |
251 | cp -rf build/temp $DEST | |
252 | ||
253 | ln -sf %{_logdir}/tomcat $DEST/logs | |
254 | ln -sf %{_vardir}/work $DEST/work | |
255 | ln -sf %{_sysconfdir}/tomcat $DEST/conf | |
256 | ||
257 | # symlinks instead of copies | |
258 | ln -sf %{_javadir}/commons-daemon.jar $DEST/bin | |
259 | ||
260 | ln -sf %{_javadir}/activation.jar $DEST/common/lib | |
261 | ln -sf %{_javadir}/ant.jar $DEST/common/lib | |
262 | ln -sf %{_javadir}/commons-collections.jar $DEST/common/lib | |
263 | ln -sf %{_javadir}/commons-dbcp.jar $DEST/common/lib | |
264 | ln -sf %{_javadir}/commons-logging-api.jar $DEST/common/lib | |
265 | ln -sf %{_javadir}/commons-pool.jar $DEST/common/lib | |
266 | ln -sf %{_javadir}/servlet.jar $DEST/common/lib | |
267 | ln -sf %{_javadir}/servlet.jar $DEST/common/lib/servletapi4.jar | |
268 | ln -sf %{_javadir}/jdbc-stdext.jar $DEST/common/lib/jdbc2_0-stdext.jar | |
269 | ln -sf %{_javadir}/jdbc-stdext.jar $DEST/common/lib/jdbc-stdext-2.0.jar | |
270 | ln -sf %{_javadir}/jmxri.jar $DEST/common/lib | |
271 | ln -sf %{_javadir}/jndi.jar $DEST/common/lib | |
272 | ln -sf %{_javadir}/jta.jar $DEST/common/lib | |
273 | ln -sf %{_javadir}/mail.jar $DEST/common/lib | |
274 | ln -sf %{_javadir}/jsse.jar $DEST/common/lib | |
275 | ln -sf %{_javadir}/junit.jar $DEST/common/lib | |
276 | ||
277 | ln -sf %{_javadir}/mailapi.jar $DEST/common/lib | |
278 | ln -sf %{_javadir}/pop3.jar $DEST/common/lib | |
279 | ln -sf %{_javadir}/pop3.jar $DEST/common/lib/pop.jar | |
280 | ln -sf %{_javadir}/smtp.jar $DEST/common/lib | |
281 | ln -sf %{_javadir}/imap.jar $DEST/common/lib | |
282 | ||
283 | ln -sf %{_javadir}/commons-beanutils.jar $DEST/server/lib | |
284 | ln -sf %{_javadir}/commons-digester.jar $DEST/server/lib | |
285 | ln -sf %{_javadir}/commons-fileupload.jar $DEST/server/lib | |
286 | ln -sf %{_javadir}/commons-logging.jar $DEST/server/lib | |
287 | ln -sf %{_javadir}/commons-modeler.jar $DEST/server/lib | |
288 | ln -sf %{_javadir}/jaas.jar $DEST/server/lib/jaas.jar | |
289 | ln -sf %{_javadir}/mx4j-jmx.jar $DEST/server/lib | |
290 | ln -sf %{_javadir}/regexp.jar $DEST/server/lib | |
291 | ln -sf %{_javadir}/regexp.jar $DEST/server/lib/jakarta-regexp-1.2.jar | |
292 | ln -sf %{_javadir}/regexp.jar $DEST/server/lib/regexp-1.2.jar | |
293 | ||
294 | ln -sf %{_javadir}/jaxp_parser_impl.jar $DEST/common/endorsed | |
295 | ln -sf %{_javadir}/xml-commons-apis.jar $DEST/common/endorsed | |
296 | ||
297 | ln -sf %{_javadir}/struts.jar $DEST/server/webapps/admin/WEB-INF/lib | |
298 | ||
299 | install %{SOURCE1} $RPM_BUILD_ROOT/etc/rc.d/init.d/tomcat | |
300 | ||
301 | %clean | |
302 | rm -rf $RPM_BUILD_ROOT | |
303 | ||
304 | %pre | |
305 | %groupadd -g 51 -r -f http | |
306 | %useradd -u 51 -r -d /home/services/httpd -s /bin/false -c "HTTP User" -g http http | |
307 | ||
308 | %post | |
309 | /sbin/chkconfig --add tomcat | |
310 | %service tomcat restart | |
311 | ||
312 | %preun | |
313 | if [ "$1" = "0" ]; then | |
314 | %service tomcat stop | |
315 | /sbin/chkconfig --del tomcat | |
316 | fi | |
317 | ||
318 | %postun | |
319 | if [ "$1" = "0" ]; then | |
320 | %userremove http | |
321 | %groupremove http | |
322 | fi | |
323 | ||
324 | %files | |
325 | %defattr(644,root,root,755) | |
326 | %doc *.txt LICENSE | |
327 | %dir %{_tomcatdir} | |
328 | %dir %{_tomcatdir}/bin | |
329 | %attr(755,root,root) %{_tomcatdir}/bin/*.sh | |
330 | %{_tomcatdir}/bin/*.jar | |
331 | %dir %{_tomcatdir}/common | |
332 | %dir %{_tomcatdir}/common/classes | |
333 | %dir %{_tomcatdir}/common/endorsed | |
334 | %{_tomcatdir}/common/endorsed/*.jar | |
335 | %{_tomcatdir}/common/lib | |
336 | %{_tomcatdir}/conf | |
337 | %{_tomcatdir}/logs | |
338 | %dir %{_tomcatdir}/server | |
339 | %dir %{_tomcatdir}/server/classes | |
340 | %{_tomcatdir}/server/lib | |
341 | %{_tomcatdir}/server/webapps | |
342 | %{_tomcatdir}/webapps | |
343 | %{_tomcatdir}/work | |
344 | %{_tomcatdir}/shared | |
345 | %{_tomcatdir}/temp | |
346 | # tomcat wants to regenerate tomcat-users.xml | |
347 | %attr(775,root,http) %dir %{_sysconfdir}/tomcat | |
348 | %config(noreplace) %verify(not md5 mtime size) %{_sysconfdir}/tomcat/* | |
349 | %attr(754,root,root) /etc/rc.d/init.d/tomcat | |
350 | %dir %{_vardir} | |
351 | %attr(1730,root,http) %dir %{_vardir}/work | |
352 | %attr(1730,root,http) %dir %{_logdir}/tomcat | |
353 | ||
354 | %files doc | |
355 | %defattr(644,root,root,755) | |
356 | %doc catalina/docs/* |