]>
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 |
797e0d23 | 23 | URL: http://tomcat.apache.org/ |
51bf99d9 | 24 | BuildRequires: ant >= 1.5.3 |
581348cf ER |
25 | BuildRequires: ant-trax |
26 | BuildRequires: eclipse-jdt | |
4c334025 | 27 | BuildRequires: jaas |
23f53f24 ER |
28 | BuildRequires: jakarta-commons-beanutils >= 1.7 |
29 | BuildRequires: jakarta-commons-collections >= 0:3.1 | |
2a69eb9c | 30 | BuildRequires: jakarta-commons-collections-tomcat5 >= 0:3.1 |
23f53f24 ER |
31 | BuildRequires: jakarta-commons-daemon >= 1.0 |
32 | BuildRequires: jakarta-commons-dbcp >= 0:1.2.1 | |
2a69eb9c | 33 | BuildRequires: jakarta-commons-dbcp-tomcat5 >= 0:1.2.1 |
23f53f24 ER |
34 | BuildRequires: jakarta-commons-digester >= 0:1.7 |
35 | BuildRequires: jakarta-commons-el >= 0:1.0 | |
36 | BuildRequires: jakarta-commons-fileupload >= 0:1.0 | |
8bfa2080 | 37 | BuildRequires: jakarta-commons-httpclient |
23f53f24 ER |
38 | BuildRequires: jakarta-commons-launcher >= 0:0.9 |
39 | BuildRequires: jakarta-commons-logging >= 0:1.0.4 | |
8bfa2080 | 40 | BuildRequires: jakarta-commons-modeler >= 2.0 |
23f53f24 | 41 | BuildRequires: jakarta-commons-pool >= 0:1.2 |
2a69eb9c | 42 | BuildRequires: jakarta-commons-pool-tomcat5 >= 0:1.2 |
23f53f24 | 43 | BuildRequires: jakarta-regexp >= 0:1.3 |
8bfa2080 | 44 | BuildRequires: jakarta-servletapi5 |
23f53f24 | 45 | #BuildRequires: jakarta-struts >= 0:1.2.7 |
0c0e0d39 | 46 | BuildRequires: jakarta-struts >= 1.0.2 |
23f53f24 ER |
47 | BuildRequires: javamail >= 0:1.3.1 |
48 | BuildRequires: jaxp_parser_impl >= 0:2.7.1 | |
49 | BuildRequires: jdbc-stdext >= 0:2.0 | |
581348cf | 50 | BuildRequires: jdk >= 1.5 |
8eee8985 | 51 | BuildRequires: jmx |
23f53f24 | 52 | BuildRequires: jndi >= 0:1.2.1 |
581348cf | 53 | BuildRequires: jpackage-utils |
23f53f24 ER |
54 | BuildRequires: jsse >= 0:1.0.3 |
55 | BuildRequires: jta >= 0:1.0.1 | |
56 | BuildRequires: junit >= 0:3.8.1 | |
581348cf | 57 | BuildRequires: logging-log4j |
23f53f24 | 58 | #BuildRequires: mx4j >= 0:3.0.1 |
581348cf ER |
59 | BuildRequires: mx4j >= 1.1.1 |
60 | BuildRequires: puretls | |
61 | BuildRequires: rpmbuild(macros) >= 1.300 | |
23f53f24 | 62 | BuildRequires: xerces-j >= 0:2.7.1 |
8665efb1 | 63 | BuildRequires: xml-commons |
23f53f24 | 64 | #BuildRequires: xml-commons >= 1.3 |
43310914 ER |
65 | Requires(post,postun): /sbin/ldconfig |
66 | Requires(post,preun): /sbin/chkconfig | |
67 | Requires(postun): /usr/sbin/groupdel | |
68 | Requires(postun): /usr/sbin/userdel | |
69 | Requires(pre): /bin/id | |
70 | Requires(pre): /usr/bin/getgid | |
71 | Requires(pre): /usr/sbin/groupadd | |
72 | Requires(pre): /usr/sbin/useradd | |
73 | Requires: jaas | |
581348cf | 74 | #Requires: jaf >= 1.0.1 |
a50d18a2 ER |
75 | #Requires: jakarta-commons-beanutils |
76 | #Requires: jakarta-commons-collections | |
77 | #Requires: jakarta-commons-dbcp-tomcat5 | |
78 | #Requires: jakarta-commons-digester | |
79 | Requires: jakarta-commons-el | |
80 | #Requires: jakarta-commons-fileupload | |
81 | #Requires: jakarta-commons-logging | |
55df0736 | 82 | Requires: jakarta-regexp |
43310914 ER |
83 | Requires: jakarta-servletapi >= 4 |
84 | Requires: javamail >= 1.2 | |
85 | Requires: jaxp_parser_impl | |
55df0736 | 86 | Requires: jdbc-stdext >= 2.0 |
55df0736 | 87 | Requires: jndi >= 1.2.1 |
43310914 | 88 | Requires: jre >= 1.2 |
55df0736 JB |
89 | Requires: jsse >= 1.0.2 |
90 | Requires: jta >= 1.0.1 | |
43310914 | 91 | Requires: mx4j >= 1.1.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 |
e22e9de1 | 124 | Summary(pl.UTF-8): Dokumentacja do Tomcata - kontekera 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 JB |
131 | %description doc -l pl.UTF-8 |
132 | Dokumentacja do Tomcata - kontekera 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 |
8bfa2080 | 142 | |
05be5db6 | 143 | # servletapi built from jakarta-servletapi5.spec |
8bfa2080 | 144 | rm -rf servletapi |
d58ce9ff ER |
145 | |
146 | # Remove pre-built jars | |
147 | find -name '*.jar' | xargs rm -fv | |
4470e4fe | 148 | |
149 | %build | |
d58ce9ff ER |
150 | TOPDIR=$(pwd) |
151 | ||
8bfa2080 ER |
152 | %if 0 |
153 | # build jasper javadocs | |
154 | cd jasper | |
155 | CLASSPATH=$(build-classpath xml-commons-apis) | |
a50d18a2 | 156 | # building jasper needs eclipse classes |
d58ce9ff | 157 | cat > build.properties <<EOF |
a50d18a2 ER |
158 | ant.jar=$(find-jar ant) |
159 | servlet-api.jar=$(find-jar servlet-api) | |
160 | jsp-api.jar=$(find-jar jsp-api) | |
d58ce9ff | 161 | tools.jar=%{java_home}/lib/tools.jar |
a50d18a2 ER |
162 | xercesImpl.jar=$(find-jar jaxp_parser_impl) |
163 | xmlParserAPIs.jar=$(find-jar xml-commons-apis) | |
164 | commons-collections.jar=$(find-jar commons-collections) | |
165 | commons-logging.jar=$(find-jar commons-logging) | |
166 | commons-daemon.jar=$(find-jar commons-daemon) | |
167 | junit.jar=$(find-jar junit) | |
168 | commons-el.jar=$(find-jar commons-el) | |
d58ce9ff | 169 | EOF |
8bfa2080 ER |
170 | #%ant dist |
171 | ||
172 | %if %{with javadoc} | |
173 | %ant javadoc \ | |
174 | -Dcompile.source=1.4 \ | |
175 | -Dbuild.compiler=modern \ | |
176 | ||
177 | %endif | |
178 | cd - | |
179 | %endif | |
d58ce9ff ER |
180 | |
181 | # build tomcat 5.5 | |
8bfa2080 | 182 | cat > build.properties <<EOF |
a50d18a2 ER |
183 | commons-beanutils.jar=$(find-jar commons-beanutils) |
184 | commons-launcher.jar=$(find-jar commons-launcher) | |
185 | commons-daemon.jar=$(find-jar commons-daemon) | |
186 | commons-digester.jar=$(find-jar commons-digester) | |
187 | commons-el.jar=$(find-jar commons-el) | |
188 | commons-logging-api.jar=$(find-jar commons-logging-api) | |
189 | commons-logging.jar=$(find-jar commons-logging) | |
190 | commons-modeler.jar=$(find-jar commons-modeler) | |
191 | xercesImpl.jar=$(find-jar jaxp_parser_impl) | |
192 | xml-apis.jar=$(find-jar xml-commons-apis) | |
193 | jdt.jar=$(find-jar org.eclipse.jdt.core) | |
74f47b90 | 194 | jasper-compiler-jdt.home=$TOPDIR/tomcat-deps |
a50d18a2 ER |
195 | commons-httpclient.jar=$(find-jar commons-httpclient) |
196 | commons-collections.jar=$(find-jar commons-collections) | |
197 | commons-fileupload.jar=$(find-jar commons-fileupload) | |
198 | jmx.jar=$(find-jar jmx) | |
199 | jmx-tools.jar=$(find-jar jmx) | |
200 | junit.jar=$(find-jar junit) | |
201 | struts.jar=$(find-jar struts) | |
202 | jcert.jar=$(find-jar jcert) | |
203 | jnet.jar=$(find-jar jnet) | |
204 | jsse.jar=$(find-jar jsse) | |
205 | jta.jar=$(find-jar jta) | |
206 | puretls.jar=$(find-jar puretls) | |
207 | servlet-api.jar=$(find-jar servlet-api) | |
8bfa2080 | 208 | servletapi.build.notrequired=true |
a50d18a2 | 209 | jsp-api.jar=$(find-jar jsp-api) |
8bfa2080 | 210 | jspapi.build.notrequired=true |
a50d18a2 ER |
211 | log4j.jar=$(find-jar log4j) |
212 | tomcat-dbcp.jar=$(find-jar jakarta-commons-dbcp-tomcat5) | |
d58ce9ff ER |
213 | EOF |
214 | ||
05be5db6 ER |
215 | %ant \ |
216 | -Dcompile.source=1.4 | |
d58ce9ff | 217 | |
4470e4fe | 218 | %install |
219 | rm -rf $RPM_BUILD_ROOT | |
8eee8985 ER |
220 | cd build/build |
221 | TOMCATDIR=$RPM_BUILD_ROOT%{_tomcatdir} | |
222 | CATALINADIR=$RPM_BUILD_ROOT/var/lib/tomcat | |
4470e4fe | 223 | |
8eee8985 ER |
224 | # we don't need dos scripts |
225 | rm -f bin/*.bat | |
8665efb1 | 226 | |
8eee8985 | 227 | randpw=$(echo $RANDOM$$ | md5sum | cut -c 1-15) |
a50d18a2 | 228 | %{__sed} -i -e "s:SHUTDOWN:${randpw}:" conf/{server,server-minimal}.xml |
8eee8985 ER |
229 | |
230 | install -d $TOMCATDIR/bin \ | |
231 | $TOMCATDIR/common/{lib,classes,endorsed} \ | |
232 | $TOMCATDIR/server/{lib,classes} \ | |
233 | $TOMCATDIR/webapps \ | |
234 | $RPM_BUILD_ROOT%{_sysconfdir} \ | |
55df0736 JB |
235 | $RPM_BUILD_ROOT%{_logdir}/tomcat \ |
236 | $RPM_BUILD_ROOT%{_vardir}/work \ | |
237 | $RPM_BUILD_ROOT/etc/rc.d/init.d | |
98862cba | 238 | |
8eee8985 | 239 | install %{SOURCE1} $RPM_BUILD_ROOT/etc/rc.d/init.d/tomcat |
4470e4fe | 240 | |
8eee8985 ER |
241 | cp -pR conf/* $RPM_BUILD_ROOT%{_sysconfdir} |
242 | cp -HR bin common server $TOMCATDIR | |
d58ce9ff | 243 | |
a50d18a2 ER |
244 | cp -rf server/webapps $TOMCATDIR/server |
245 | cp -rf webapps $TOMCATDIR | |
246 | cp -rf shared $TOMCATDIR | |
247 | cp -rf temp $TOMCATDIR | |
8eee8985 | 248 | |
a50d18a2 ER |
249 | ln -sf %{_logdir}/tomcat $TOMCATDIR/logs |
250 | ln -sf %{_vardir}/work $TOMCATDIR/work | |
251 | ln -sf %{_sysconfdir} $TOMCATDIR/conf | |
8eee8985 ER |
252 | |
253 | # symlinks instead of copies | |
a50d18a2 ER |
254 | ln -sf $(find-jar commons-el) $TOMCATDIR/common/lib/commons-el.jar |
255 | ln -sf $(find-jar jakarta-commons-dbcp-tomcat5) $TOMCATDIR/common/lib/jakarta-commons-dbcp-tomcat5.jar | |
256 | ln -sf $(find-jar servlet-api) $TOMCATDIR/common/lib/servlet-api.jar | |
257 | ||
258 | ln -sf $(find-jar commons-modeler) $TOMCATDIR/server/lib/commons-modeler.jar | |
259 | ||
260 | %if 0 | |
261 | # do not make these symlinks as ant didn't do | |
262 | ln -sf $(find-jar commons-daemon) $TOMCATDIR/bin/commons-daemon.jar | |
263 | ln -sf $(find-jar activation) $TOMCATDIR/common/lib/activation.jar | |
264 | ln -sf $(find-jar ant) $TOMCATDIR/common/lib/ant.jar | |
265 | ln -sf $(find-jar commons-collections) $TOMCATDIR/common/lib/commons-collections.jar | |
266 | ln -sf $(find-jar commons-dbcp) $TOMCATDIR/common/lib/commons-dbcp.jar | |
267 | ln -sf $(find-jar commons-logging-api) $TOMCATDIR/common/lib/commons-logging-api.jar | |
268 | ln -sf $(find-jar commons-pool) $TOMCATDIR/common/lib/commons-pool.jar | |
269 | ln -sf $(find-jar servlet) $TOMCATDIR/common/lib/servlet.jar | |
270 | ln -sf $(find-jar servlet) $TOMCATDIR/common/lib/servletapi4.jar | |
271 | ln -sf $(find-jar jdbc-stdext) $TOMCATDIR/common/lib/jdbc-stdext.jar | |
272 | ln -sf jdbc-stdext.jar $TOMCATDIR/common/lib/jdbc2_0-stdext.jar | |
273 | ln -sf jdbc-stdext.jar $TOMCATDIR/common/lib/jdbc-stdext-2.0.jar | |
274 | ln -sf $(find-jar jmxri) $TOMCATDIR/common/lib/jmxri.jar | |
275 | ln -sf $(find-jar jndi) $TOMCATDIR/common/lib/jndi.jar | |
276 | ln -sf $(find-jar jta) $TOMCATDIR/common/lib/jta.jar | |
277 | ln -sf $(find-jar mail) $TOMCATDIR/common/lib/mail.jar | |
278 | ln -sf $(find-jar jsse) $TOMCATDIR/common/lib/jsse.jar | |
279 | ln -sf $(find-jar junit) $TOMCATDIR/common/lib/junit.jar | |
280 | ln -sf $(find-jar mailapi) $TOMCATDIR/common/lib/mailapi.jar | |
281 | ln -sf $(find-jar pop3) $TOMCATDIR/common/lib/pop3.jar | |
282 | ln -sf pop3.jar $TOMCATDIR/common/lib/pop.jar | |
283 | ln -sf $(find-jar smtp) $TOMCATDIR/common/lib/smtp.jar | |
284 | ln -sf $(find-jar imap) $TOMCATDIR/common/lib/imap.jar | |
285 | ln -sf $(find-jar commons-beanutils) $TOMCATDIR/server/lib/commons-beanutils.jar | |
286 | ln -sf $(find-jar commons-digester) $TOMCATDIR/server/lib/commons-digester.jar | |
287 | ln -sf $(find-jar commons-fileupload) $TOMCATDIR/server/lib/commons-fileupload.jar | |
288 | ln -sf $(find-jar commons-logging) $TOMCATDIR/server/lib/commons-logging.jar | |
289 | ln -sf $(find-jar jaas) $TOMCATDIR/server/lib/jaas.jar | |
290 | ln -sf $(find-jar mx4j-jmx) $TOMCATDIR/server/lib/mx4j-jmx.jar | |
291 | ln -sf $(find-jar regexp) $TOMCATDIR/server/lib/regexp.jar | |
292 | ln -sf $(find-jar regexp) $TOMCATDIR/server/lib/jakarta-regexp-1.2.jar | |
293 | ln -sf $(find-jar regexp) $TOMCATDIR/server/lib/regexp-1.2.jar | |
294 | %endif | |
295 | ||
296 | ln -sf $(find-jar jaxp_parser_impl) $TOMCATDIR/common/endorsed/jaxp_parser_impl.jar | |
297 | ln -sf $(find-jar xml-commons-apis) $TOMCATDIR/common/endorsed/xml-commons-apis.jar | |
298 | ln -sf $(find-jar struts) $TOMCATDIR/server/webapps/admin/WEB-INF/lib/struts.jar | |
55df0736 | 299 | |
4470e4fe | 300 | %clean |
301 | rm -rf $RPM_BUILD_ROOT | |
302 | ||
50d4797f | 303 | %pre |
aa5bd00e ER |
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 | |
50d4797f | 306 | |
307 | %post | |
308 | /sbin/chkconfig --add tomcat | |
4c334025 | 309 | %service tomcat restart |
50d4797f | 310 | |
311 | %preun | |
312 | if [ "$1" = "0" ]; then | |
4c334025 | 313 | %service tomcat stop |
50d4797f | 314 | /sbin/chkconfig --del tomcat |
315 | fi | |
316 | ||
317 | %postun | |
318 | if [ "$1" = "0" ]; then | |
0c0e0d39 | 319 | %userremove http |
320 | %groupremove http | |
50d4797f | 321 | fi |
322 | ||
4470e4fe | 323 | %files |
324 | %defattr(644,root,root,755) | |
8eee8985 ER |
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 | |
55df0736 JB |
330 | %dir %{_tomcatdir} |
331 | %dir %{_tomcatdir}/bin | |
8eee8985 ER |
332 | %{_tomcatdir}/bin/catalina-tasks.xml |
333 | %{_tomcatdir}/bin/jkstatus-tasks.xml | |
334 | %{_tomcatdir}/bin/jmxaccessor-tasks.xml | |
98862cba | 335 | %attr(755,root,root) %{_tomcatdir}/bin/*.sh |
98862cba | 336 | %{_tomcatdir}/bin/*.jar |
55df0736 JB |
337 | %dir %{_tomcatdir}/common |
338 | %dir %{_tomcatdir}/common/classes | |
50d4797f | 339 | %dir %{_tomcatdir}/common/endorsed |
8eee8985 | 340 | %dir %{_tomcatdir}/common/i18n |
8665efb1 | 341 | %{_tomcatdir}/common/endorsed/*.jar |
8eee8985 ER |
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 | |
4470e4fe | 346 | %{_tomcatdir}/common/lib |
347 | %{_tomcatdir}/conf | |
4470e4fe | 348 | %{_tomcatdir}/logs |
55df0736 JB |
349 | %dir %{_tomcatdir}/server |
350 | %dir %{_tomcatdir}/server/classes | |
4470e4fe | 351 | %{_tomcatdir}/server/lib |
50d4797f | 352 | %{_tomcatdir}/server/webapps |
55df0736 JB |
353 | %{_tomcatdir}/webapps |
354 | %{_tomcatdir}/work | |
50d4797f | 355 | %{_tomcatdir}/shared |
356 | %{_tomcatdir}/temp | |
55df0736 | 357 | %dir %{_vardir} |
8eee8985 ER |
358 | %dir %attr(1730,root,http) %{_vardir}/work |
359 | %dir %attr(1730,root,http) %{_logdir}/tomcat | |
4470e4fe | 360 | |
8eee8985 | 361 | %if 0 |
4470e4fe | 362 | %files doc |
9c3d8079 | 363 | %defattr(644,root,root,755) |
4470e4fe | 364 | %doc catalina/docs/* |
8eee8985 | 365 | %endif |