]>
Commit | Line | Data |
---|---|---|
a50d18a2 ER |
1 | # TODO |
2 | # - packages for *.renametojar files (-cgi and -ssi in server/lib) | |
3 | # | |
d58ce9ff | 4 | # Conditional build: |
d58ce9ff ER |
5 | %bcond_without javadoc # skip building javadocs |
6 | # | |
7 | Summary: Apache Servlet/JSP Engine, RI for Servlet 2.4/JSP 2.0 API | |
e22e9de1 | 8 | Summary(pl.UTF-8): Silnik Servlet/JSP Apache będący wzorcową implementacją API Servlet 2.4/JSP 2.0 |
3cd7b38d | 9 | Name: apache-tomcat |
7f75c591 | 10 | Version: 5.5.27 |
a9122388 | 11 | Release: 0.1 |
27743710 | 12 | License: Apache |
4470e4fe | 13 | Group: Development/Languages/Java |
3cd7b38d | 14 | Source0: http://www.apache.org/dist/tomcat/tomcat-5/v%{version}/src/%{name}-%{version}-src.tar.gz |
7f75c591 | 15 | # Source0-md5: eb3f196013550b9b1684e4ff18593a8e |
fe9b4066 | 16 | Source1: %{name}.init |
3cd7b38d ER |
17 | Patch0: %{name}-skip-servletapi.patch |
18 | Patch1: %{name}-nsis.patch | |
19 | Patch2: %{name}-native.patch | |
20 | Patch3: %{name}-skip-jdt.patch | |
05be5db6 | 21 | Patch4: %{name}-no-connectors.patch |
7f75c591 | 22 | Patch5: %{name}-dbcp.patch |
88f0da13 | 23 | # this patch is needed for struts >= 1.3 |
24 | Patch6: %{name}-struts.patch | |
797e0d23 | 25 | URL: http://tomcat.apache.org/ |
51bf99d9 | 26 | BuildRequires: ant >= 1.5.3 |
581348cf ER |
27 | BuildRequires: ant-trax |
28 | BuildRequires: eclipse-jdt | |
4c334025 | 29 | BuildRequires: jaas |
8bb97185 | 30 | BuildRequires: java-commons-httpclient |
23f53f24 | 31 | BuildRequires: jakarta-regexp >= 0:1.3 |
8bb97185 | 32 | #BuildRequires: java-struts >= 0:1.2.7 |
33 | BuildRequires: java-struts >= 1.0.2 | |
90ee603b | 34 | BuildRequires: java-commons-beanutils >= 1.7 |
35 | BuildRequires: java-commons-collections >= 0:3.1 | |
36 | BuildRequires: java-commons-collections-tomcat5 >= 0:3.1 | |
37 | BuildRequires: java-commons-daemon >= 1.0 | |
38 | BuildRequires: java-commons-dbcp >= 0:1.2.1 | |
39 | BuildRequires: java-commons-dbcp-tomcat5 >= 0:1.2.1 | |
40 | BuildRequires: java-commons-digester >= 0:1.7 | |
41 | BuildRequires: java-commons-el >= 0:1.0 | |
42 | BuildRequires: java-commons-fileupload >= 0:1.0 | |
43 | BuildRequires: java-commons-io >= 1.4 | |
44 | BuildRequires: java-commons-launcher >= 0:0.9 | |
45 | BuildRequires: java-commons-logging >= 0:1.0.4 | |
46 | BuildRequires: java-commons-modeler >= 2.0 | |
47 | BuildRequires: java-commons-pool >= 0:1.2 | |
48 | BuildRequires: java-commons-pool-tomcat5 >= 0:1.2 | |
8bb97185 | 49 | BuildRequires: java-servletapi5 = %{version} |
23f53f24 ER |
50 | BuildRequires: javamail >= 0:1.3.1 |
51 | BuildRequires: jaxp_parser_impl >= 0:2.7.1 | |
52 | BuildRequires: jdbc-stdext >= 0:2.0 | |
581348cf | 53 | BuildRequires: jdk >= 1.5 |
8eee8985 | 54 | BuildRequires: jmx |
23f53f24 | 55 | BuildRequires: jndi >= 0:1.2.1 |
581348cf | 56 | BuildRequires: jpackage-utils |
23f53f24 ER |
57 | BuildRequires: jsse >= 0:1.0.3 |
58 | BuildRequires: jta >= 0:1.0.1 | |
59 | BuildRequires: junit >= 0:3.8.1 | |
581348cf | 60 | BuildRequires: logging-log4j |
581348cf ER |
61 | BuildRequires: puretls |
62 | BuildRequires: rpmbuild(macros) >= 1.300 | |
23f53f24 | 63 | BuildRequires: xerces-j >= 0:2.7.1 |
8665efb1 | 64 | BuildRequires: xml-commons |
23f53f24 | 65 | #BuildRequires: xml-commons >= 1.3 |
43310914 ER |
66 | Requires(post,postun): /sbin/ldconfig |
67 | Requires(post,preun): /sbin/chkconfig | |
68 | Requires(postun): /usr/sbin/groupdel | |
69 | Requires(postun): /usr/sbin/userdel | |
70 | Requires(pre): /bin/id | |
71 | Requires(pre): /usr/bin/getgid | |
72 | Requires(pre): /usr/sbin/groupadd | |
73 | Requires(pre): /usr/sbin/useradd | |
74 | Requires: jaas | |
581348cf | 75 | #Requires: jaf >= 1.0.1 |
55df0736 | 76 | Requires: jakarta-regexp |
90ee603b | 77 | #Requires: java-commons-beanutils |
78 | #Requires: java-commons-collections | |
79 | #Requires: java-commons-dbcp-tomcat5 | |
80 | #Requires: java-commons-digester | |
81 | Requires: java-commons-el | |
82 | #Requires: java-commons-fileupload | |
83 | #Requires: java-commons-logging | |
15031060 | 84 | Requires: java-servletapi5 = %{version}-%{release} |
43310914 ER |
85 | Requires: javamail >= 1.2 |
86 | Requires: jaxp_parser_impl | |
55df0736 | 87 | Requires: jdbc-stdext >= 2.0 |
55df0736 | 88 | Requires: jndi >= 1.2.1 |
43310914 | 89 | Requires: jre >= 1.2 |
55df0736 JB |
90 | Requires: jsse >= 1.0.2 |
91 | Requires: jta >= 1.0.1 | |
d58ce9ff | 92 | Requires: rc-scripts |
8665efb1 | 93 | Requires: xml-commons |
0c0e0d39 | 94 | Provides: group(http) |
95 | Provides: user(http) | |
3cd7b38d | 96 | Obsoletes: jakarta-tomcat |
4470e4fe | 97 | BuildArch: noarch |
98 | BuildRoot: %{tmpdir}/%{name}-%{version}-root-%(id -u -n) | |
99 | ||
8eee8985 | 100 | %define _tomcatdir %{_datadir}/tomcat |
4470e4fe | 101 | %define _logdir %{_var}/log |
55df0736 | 102 | %define _vardir %{_var}/lib/tomcat |
8eee8985 | 103 | %define _sysconfdir /etc/tomcat |
4470e4fe | 104 | |
105 | %description | |
d58ce9ff ER |
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. | |
4470e4fe | 110 | |
d58ce9ff ER |
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. | |
115 | ||
e22e9de1 JB |
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 | |
3cd7b38d ER |
119 | Java Servlet i JavaServer Pages są rozwijane przez Suna zgodnie z Java |
120 | Community Process. | |
4470e4fe | 121 | |
122 | %package doc | |
3cd7b38d | 123 | Summary: The Apache Tomcat Servlet/JSP Container documentation |
71272daf | 124 | Summary(pl.UTF-8): Dokumentacja do Tomcata - kontenera Servlet/JSP |
4470e4fe | 125 | Group: Development/Languages/Java |
3cd7b38d | 126 | Obsoletes: jakarta-tomcat-doc |
4470e4fe | 127 | |
128 | %description doc | |
2b38d386 JB |
129 | The Tomcat Servlet/JSP Container documentation. |
130 | ||
e22e9de1 | 131 | %description doc -l pl.UTF-8 |
71272daf | 132 | Dokumentacja do Tomcata - kontenera Servlet/JSP. |
4470e4fe | 133 | |
134 | %prep | |
3cd7b38d | 135 | %setup -q -n %{name}-%{version}-src |
8bfa2080 ER |
136 | %patch0 -p1 |
137 | %patch1 -p1 | |
138 | %patch2 -p1 | |
139 | %patch3 -p1 | |
05be5db6 | 140 | %patch4 -p1 |
99082140 | 141 | %patch5 -p1 |
88f0da13 | 142 | %patch6 -p1 |
8bfa2080 | 143 | |
05be5db6 | 144 | # servletapi built from jakarta-servletapi5.spec |
8bfa2080 | 145 | rm -rf servletapi |
d58ce9ff ER |
146 | |
147 | # Remove pre-built jars | |
148 | find -name '*.jar' | xargs rm -fv | |
4470e4fe | 149 | |
150 | %build | |
d58ce9ff ER |
151 | TOPDIR=$(pwd) |
152 | ||
8bfa2080 ER |
153 | %if 0 |
154 | # build jasper javadocs | |
155 | cd jasper | |
156 | CLASSPATH=$(build-classpath xml-commons-apis) | |
a50d18a2 | 157 | # building jasper needs eclipse classes |
d58ce9ff | 158 | cat > build.properties <<EOF |
a50d18a2 ER |
159 | ant.jar=$(find-jar ant) |
160 | servlet-api.jar=$(find-jar servlet-api) | |
161 | jsp-api.jar=$(find-jar jsp-api) | |
d58ce9ff | 162 | tools.jar=%{java_home}/lib/tools.jar |
a50d18a2 ER |
163 | xercesImpl.jar=$(find-jar jaxp_parser_impl) |
164 | xmlParserAPIs.jar=$(find-jar xml-commons-apis) | |
165 | commons-collections.jar=$(find-jar commons-collections) | |
166 | commons-logging.jar=$(find-jar commons-logging) | |
167 | commons-daemon.jar=$(find-jar commons-daemon) | |
168 | junit.jar=$(find-jar junit) | |
169 | commons-el.jar=$(find-jar commons-el) | |
d58ce9ff | 170 | EOF |
8bfa2080 ER |
171 | #%ant dist |
172 | ||
173 | %if %{with javadoc} | |
174 | %ant javadoc \ | |
175 | -Dcompile.source=1.4 \ | |
176 | -Dbuild.compiler=modern \ | |
177 | ||
178 | %endif | |
179 | cd - | |
180 | %endif | |
d58ce9ff ER |
181 | |
182 | # build tomcat 5.5 | |
8bfa2080 | 183 | cat > build.properties <<EOF |
e9abaf04 | 184 | commons-beanutils.jar=$(find-jar commons-beanutils-core) |
a50d18a2 ER |
185 | commons-launcher.jar=$(find-jar commons-launcher) |
186 | commons-daemon.jar=$(find-jar commons-daemon) | |
187 | commons-digester.jar=$(find-jar commons-digester) | |
188 | commons-el.jar=$(find-jar commons-el) | |
189 | commons-logging-api.jar=$(find-jar commons-logging-api) | |
190 | commons-logging.jar=$(find-jar commons-logging) | |
191 | commons-modeler.jar=$(find-jar commons-modeler) | |
192 | xercesImpl.jar=$(find-jar jaxp_parser_impl) | |
193 | xml-apis.jar=$(find-jar xml-commons-apis) | |
194 | jdt.jar=$(find-jar org.eclipse.jdt.core) | |
74f47b90 | 195 | jasper-compiler-jdt.home=$TOPDIR/tomcat-deps |
a50d18a2 ER |
196 | commons-httpclient.jar=$(find-jar commons-httpclient) |
197 | commons-collections.jar=$(find-jar commons-collections) | |
198 | commons-fileupload.jar=$(find-jar commons-fileupload) | |
bce65856 | 199 | commons-io.jar=$(find-jar commons-io) |
a50d18a2 ER |
200 | jmx.jar=$(find-jar jmx) |
201 | jmx-tools.jar=$(find-jar jmx) | |
202 | junit.jar=$(find-jar junit) | |
e9abaf04 | 203 | struts.jar=$(find-jar struts-core) |
204 | struts-core.jar=$(find-jar struts-core) | |
205 | struts-taglib.jar=$(find-jar struts-taglib) | |
a50d18a2 ER |
206 | jcert.jar=$(find-jar jcert) |
207 | jnet.jar=$(find-jar jnet) | |
208 | jsse.jar=$(find-jar jsse) | |
209 | jta.jar=$(find-jar jta) | |
210 | puretls.jar=$(find-jar puretls) | |
211 | servlet-api.jar=$(find-jar servlet-api) | |
8bfa2080 | 212 | servletapi.build.notrequired=true |
a50d18a2 | 213 | jsp-api.jar=$(find-jar jsp-api) |
8bfa2080 | 214 | jspapi.build.notrequired=true |
a50d18a2 | 215 | log4j.jar=$(find-jar log4j) |
e9abaf04 | 216 | tomcat-dbcp.jar=$(find-jar commons-dbcp-tomcat5) |
8bb97185 | 217 | struts.lib=%{_datadir}/java-struts |
d58ce9ff ER |
218 | EOF |
219 | ||
05be5db6 ER |
220 | %ant \ |
221 | -Dcompile.source=1.4 | |
d58ce9ff | 222 | |
4470e4fe | 223 | %install |
224 | rm -rf $RPM_BUILD_ROOT | |
8eee8985 ER |
225 | cd build/build |
226 | TOMCATDIR=$RPM_BUILD_ROOT%{_tomcatdir} | |
227 | CATALINADIR=$RPM_BUILD_ROOT/var/lib/tomcat | |
4470e4fe | 228 | |
8eee8985 ER |
229 | # we don't need dos scripts |
230 | rm -f bin/*.bat | |
8665efb1 | 231 | |
8eee8985 | 232 | randpw=$(echo $RANDOM$$ | md5sum | cut -c 1-15) |
a50d18a2 | 233 | %{__sed} -i -e "s:SHUTDOWN:${randpw}:" conf/{server,server-minimal}.xml |
8eee8985 ER |
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} \ | |
55df0736 JB |
240 | $RPM_BUILD_ROOT%{_logdir}/tomcat \ |
241 | $RPM_BUILD_ROOT%{_vardir}/work \ | |
242 | $RPM_BUILD_ROOT/etc/rc.d/init.d | |
98862cba | 243 | |
8eee8985 | 244 | install %{SOURCE1} $RPM_BUILD_ROOT/etc/rc.d/init.d/tomcat |
4470e4fe | 245 | |
8eee8985 ER |
246 | cp -pR conf/* $RPM_BUILD_ROOT%{_sysconfdir} |
247 | cp -HR bin common server $TOMCATDIR | |
d58ce9ff | 248 | |
a50d18a2 ER |
249 | cp -rf server/webapps $TOMCATDIR/server |
250 | cp -rf webapps $TOMCATDIR | |
251 | cp -rf shared $TOMCATDIR | |
252 | cp -rf temp $TOMCATDIR | |
8eee8985 | 253 | |
a50d18a2 ER |
254 | ln -sf %{_logdir}/tomcat $TOMCATDIR/logs |
255 | ln -sf %{_vardir}/work $TOMCATDIR/work | |
256 | ln -sf %{_sysconfdir} $TOMCATDIR/conf | |
8eee8985 ER |
257 | |
258 | # symlinks instead of copies | |
a50d18a2 ER |
259 | ln -sf $(find-jar commons-el) $TOMCATDIR/common/lib/commons-el.jar |
260 | ln -sf $(find-jar jakarta-commons-dbcp-tomcat5) $TOMCATDIR/common/lib/jakarta-commons-dbcp-tomcat5.jar | |
261 | ln -sf $(find-jar servlet-api) $TOMCATDIR/common/lib/servlet-api.jar | |
262 | ||
263 | ln -sf $(find-jar commons-modeler) $TOMCATDIR/server/lib/commons-modeler.jar | |
264 | ||
265 | %if 0 | |
266 | # do not make these symlinks as ant didn't do | |
267 | ln -sf $(find-jar commons-daemon) $TOMCATDIR/bin/commons-daemon.jar | |
268 | ln -sf $(find-jar activation) $TOMCATDIR/common/lib/activation.jar | |
269 | ln -sf $(find-jar ant) $TOMCATDIR/common/lib/ant.jar | |
270 | ln -sf $(find-jar commons-collections) $TOMCATDIR/common/lib/commons-collections.jar | |
271 | ln -sf $(find-jar commons-dbcp) $TOMCATDIR/common/lib/commons-dbcp.jar | |
272 | ln -sf $(find-jar commons-logging-api) $TOMCATDIR/common/lib/commons-logging-api.jar | |
273 | ln -sf $(find-jar commons-pool) $TOMCATDIR/common/lib/commons-pool.jar | |
274 | ln -sf $(find-jar servlet) $TOMCATDIR/common/lib/servlet.jar | |
275 | ln -sf $(find-jar servlet) $TOMCATDIR/common/lib/servletapi4.jar | |
276 | ln -sf $(find-jar jdbc-stdext) $TOMCATDIR/common/lib/jdbc-stdext.jar | |
277 | ln -sf jdbc-stdext.jar $TOMCATDIR/common/lib/jdbc2_0-stdext.jar | |
278 | ln -sf jdbc-stdext.jar $TOMCATDIR/common/lib/jdbc-stdext-2.0.jar | |
279 | ln -sf $(find-jar jmxri) $TOMCATDIR/common/lib/jmxri.jar | |
280 | ln -sf $(find-jar jndi) $TOMCATDIR/common/lib/jndi.jar | |
281 | ln -sf $(find-jar jta) $TOMCATDIR/common/lib/jta.jar | |
282 | ln -sf $(find-jar mail) $TOMCATDIR/common/lib/mail.jar | |
283 | ln -sf $(find-jar jsse) $TOMCATDIR/common/lib/jsse.jar | |
284 | ln -sf $(find-jar junit) $TOMCATDIR/common/lib/junit.jar | |
285 | ln -sf $(find-jar mailapi) $TOMCATDIR/common/lib/mailapi.jar | |
286 | ln -sf $(find-jar pop3) $TOMCATDIR/common/lib/pop3.jar | |
287 | ln -sf pop3.jar $TOMCATDIR/common/lib/pop.jar | |
288 | ln -sf $(find-jar smtp) $TOMCATDIR/common/lib/smtp.jar | |
289 | ln -sf $(find-jar imap) $TOMCATDIR/common/lib/imap.jar | |
290 | ln -sf $(find-jar commons-beanutils) $TOMCATDIR/server/lib/commons-beanutils.jar | |
291 | ln -sf $(find-jar commons-digester) $TOMCATDIR/server/lib/commons-digester.jar | |
292 | ln -sf $(find-jar commons-fileupload) $TOMCATDIR/server/lib/commons-fileupload.jar | |
293 | ln -sf $(find-jar commons-logging) $TOMCATDIR/server/lib/commons-logging.jar | |
294 | ln -sf $(find-jar jaas) $TOMCATDIR/server/lib/jaas.jar | |
a50d18a2 ER |
295 | ln -sf $(find-jar regexp) $TOMCATDIR/server/lib/regexp.jar |
296 | ln -sf $(find-jar regexp) $TOMCATDIR/server/lib/jakarta-regexp-1.2.jar | |
297 | ln -sf $(find-jar regexp) $TOMCATDIR/server/lib/regexp-1.2.jar | |
298 | %endif | |
299 | ||
300 | ln -sf $(find-jar jaxp_parser_impl) $TOMCATDIR/common/endorsed/jaxp_parser_impl.jar | |
301 | ln -sf $(find-jar xml-commons-apis) $TOMCATDIR/common/endorsed/xml-commons-apis.jar | |
e9abaf04 | 302 | ln -sf $(find-jar struts-core) $TOMCATDIR/server/webapps/admin/WEB-INF/lib/struts-core.jar |
55df0736 | 303 | |
4470e4fe | 304 | %clean |
305 | rm -rf $RPM_BUILD_ROOT | |
306 | ||
50d4797f | 307 | %pre |
aa5bd00e ER |
308 | %groupadd -g 51 -r -f http |
309 | %useradd -u 51 -r -d /home/services/httpd -s /bin/false -c "HTTP User" -g http http | |
50d4797f | 310 | |
311 | %post | |
312 | /sbin/chkconfig --add tomcat | |
4c334025 | 313 | %service tomcat restart |
50d4797f | 314 | |
315 | %preun | |
316 | if [ "$1" = "0" ]; then | |
4c334025 | 317 | %service tomcat stop |
50d4797f | 318 | /sbin/chkconfig --del tomcat |
319 | fi | |
320 | ||
321 | %postun | |
322 | if [ "$1" = "0" ]; then | |
0c0e0d39 | 323 | %userremove http |
324 | %groupremove http | |
50d4797f | 325 | fi |
326 | ||
4470e4fe | 327 | %files |
328 | %defattr(644,root,root,755) | |
8eee8985 ER |
329 | %doc build/{RELEASE-NOTES,RUNNING.txt} |
330 | # tomcat wants to regenerate tomcat-users.xml | |
331 | %dir %attr(775,root,http) %{_sysconfdir} | |
332 | %config(noreplace) %verify(not md5 mtime size) %{_sysconfdir}/* | |
333 | %attr(754,root,root) /etc/rc.d/init.d/tomcat | |
55df0736 JB |
334 | %dir %{_tomcatdir} |
335 | %dir %{_tomcatdir}/bin | |
8eee8985 ER |
336 | %{_tomcatdir}/bin/catalina-tasks.xml |
337 | %{_tomcatdir}/bin/jkstatus-tasks.xml | |
338 | %{_tomcatdir}/bin/jmxaccessor-tasks.xml | |
98862cba | 339 | %attr(755,root,root) %{_tomcatdir}/bin/*.sh |
98862cba | 340 | %{_tomcatdir}/bin/*.jar |
55df0736 JB |
341 | %dir %{_tomcatdir}/common |
342 | %dir %{_tomcatdir}/common/classes | |
50d4797f | 343 | %dir %{_tomcatdir}/common/endorsed |
8eee8985 | 344 | %dir %{_tomcatdir}/common/i18n |
8665efb1 | 345 | %{_tomcatdir}/common/endorsed/*.jar |
8eee8985 ER |
346 | %{_tomcatdir}/common/i18n/tomcat-i18n-en.jar |
347 | %lang(es) %{_tomcatdir}/common/i18n/tomcat-i18n-es.jar | |
348 | %lang(fr) %{_tomcatdir}/common/i18n/tomcat-i18n-fr.jar | |
349 | %lang(ja) %{_tomcatdir}/common/i18n/tomcat-i18n-ja.jar | |
4470e4fe | 350 | %{_tomcatdir}/common/lib |
351 | %{_tomcatdir}/conf | |
4470e4fe | 352 | %{_tomcatdir}/logs |
55df0736 JB |
353 | %dir %{_tomcatdir}/server |
354 | %dir %{_tomcatdir}/server/classes | |
4470e4fe | 355 | %{_tomcatdir}/server/lib |
50d4797f | 356 | %{_tomcatdir}/server/webapps |
55df0736 JB |
357 | %{_tomcatdir}/webapps |
358 | %{_tomcatdir}/work | |
50d4797f | 359 | %{_tomcatdir}/shared |
360 | %{_tomcatdir}/temp | |
55df0736 | 361 | %dir %{_vardir} |
8eee8985 ER |
362 | %dir %attr(1730,root,http) %{_vardir}/work |
363 | %dir %attr(1730,root,http) %{_logdir}/tomcat | |
4470e4fe | 364 | |
8eee8985 | 365 | %if 0 |
4470e4fe | 366 | %files doc |
9c3d8079 | 367 | %defattr(644,root,root,755) |
4470e4fe | 368 | %doc catalina/docs/* |
8eee8985 | 369 | %endif |