]> git.pld-linux.org Git - packages/tomcat.git/blob - tomcat.spec
- build property tomcat-jdt.jar must point to jar that contains eclipse jdt.
[packages/tomcat.git] / tomcat.spec
1
2 # Conditional build:
3 %bcond_without  javadoc         # skip building javadocs
4 %bcond_without  java_sun        # build with gcj (does not work)
5 %bcond_without  webservices     # skip building webservices
6
7 %define         jspapiver       2.1
8 %define         servletapiver   2.5
9
10 %include        /usr/lib/rpm/macros.java
11 Summary:        Apache Servlet/JSP Engine, RI for Servlet %{servletapiver}/JSP %{jspapiver}API
12 Summary(pl.UTF-8):      Silnik Servlet/JSP Apache będący wzorcową implementacją API Servlet %{servletapiver}/JSP %{jspapiver}
13 Name:           tomcat
14 Version:        6.0.20
15 Release:        4
16 License:        Apache v2.0
17 Group:          Networking/Daemons/Java
18 Source0:        http://www.apache.org/dist/tomcat/tomcat-6/v%{version}/src/apache-%{name}-%{version}-src.tar.gz
19 # Source0-md5:  44f49e7e14028b6a53c3c346bd18c72f
20 Source1:        apache-%{name}.init
21 Source2:        apache-%{name}.sysconfig
22 Source3:        %{name}-build.properties
23 Source10:       %{name}-context-ROOT.xml
24 Source11:       %{name}-context-docs.xml
25 Source12:       %{name}-context-manager.xml
26 Source13:       %{name}-context-host-manager.xml
27 Source14:       %{name}-context-examples.xml
28 Patch0:         %{name}-build.xml.patch
29 Patch1:         %{name}-extras.xml.patch
30 URL:            http://tomcat.apache.org/
31 BuildRequires:  apr-devel
32 BuildRequires:  autoconf
33 BuildRequires:  libtool
34 BuildRequires:  openssl-devel
35 %if %{with java_sun}
36 BuildRequires:  java-sun >= 1.5
37 BuildRequires:  java-sun-jre >= 1.5
38 %else
39 BuildRequires:  java-gcj-compat-devel
40 %endif
41 BuildRequires:  ant >= 1.5.3
42 BuildRequires:  ant-trax
43 BuildRequires:  eclipse-jdt >= 3.2
44 BuildRequires:  java-commons-collections >= 0:2.0
45 BuildRequires:  java-commons-daemon >= 1.0
46 BuildRequires:  java-commons-dbcp >= 0:1.1
47 BuildRequires:  java-commons-dbcp-tomcat5 >= 0:1.1
48 %if %{with webservices}
49 BuildRequires:  java(JSR109)
50 BuildRequires:  java-geronimo-spec-jaxrpc
51 %endif
52 BuildRequires:  jpackage-utils
53 BuildRequires:  rpmbuild(macros) >= 1.300
54 Requires(post,postun):  /sbin/ldconfig
55 Requires(post,preun):   /sbin/chkconfig
56 Requires(postun):       /usr/sbin/groupdel
57 Requires(postun):       /usr/sbin/userdel
58 Requires(pre):  /bin/id
59 Requires(pre):  /usr/bin/getgid
60 Requires(pre):  /usr/sbin/groupadd
61 Requires(pre):  /usr/sbin/useradd
62 Requires:       %{name}-jasper = %{epoch}:%{version}-%{release}
63 Requires:       java-jdbc-mysql
64 Requires:       java-servletapi = %{epoch}:%{version}-%{release}
65 Requires:       java-sun-jre >= 1.2
66 Requires:       jaxp_parser_impl
67 Requires:       jndi >= 1.2.1
68 Requires:       rc-scripts
69 Provides:       group(servlet)
70 Provides:       group(tomcat)
71 Provides:       user(tomcat)
72 Obsoletes:      apache-tomcat
73 Obsoletes:      jakarta-tomcat
74 BuildArch:      noarch
75 BuildRoot:      %{tmpdir}/%{name}-%{version}-root-%(id -u -n)
76
77 %define         _tomcatdir      %{_datadir}/tomcat
78 %define         _logdir         %{_var}/log
79 %define         _vardir         %{_var}/lib/tomcat
80 %define         _sysconfdir     /etc/tomcat
81
82 %define find_jar() %{expand:%%define jarfile {%(jar=$(find-jar %1); echo ${jar:-%%nil})}}%{?jarfile}%{!?jarfile:%{error:find-jar %1 failed}}%{nil}
83
84 %description
85 Tomcat is the servlet container that is used in the official Reference
86 Implementation for the Java Servlet and JavaServer Pages technologies.
87 The Java Servlet and JavaServer Pages specifications are developed by
88 Sun under the Java Community Process.
89
90 Tomcat is developed in an open and participatory environment and
91 released under the Apache Software License. Tomcat is intended to be a
92 collaboration of the best-of-breed developers from around the world.
93 We invite you to participate in this open development project.
94
95 %description -l pl.UTF-8
96 Tomcat to kontener serwletowy używany przez oficjalną implementację
97 wzorcową technologii Java Servlet i JavaServer Pages. Specyfikacje
98 Java Servlet i JavaServer Pages są rozwijane przez Suna zgodnie z Java
99 Community Process.
100
101 %package webapp-docs
102 Summary:        The Apache Tomcat Servlet/JSP Container documentation
103 Summary(pl.UTF-8):      Dokumentacja do Tomcata - kontenera Servlet/JSP
104 Group:          Documentation
105 Obsoletes:      apache-tomcat-doc
106 Obsoletes:      jakarta-tomcat-doc
107 Obsoletes:      tomcat-doc
108
109 %description webapp-docs
110 The Tomcat Servlet/JSP Container documentation.
111
112 %description webapp-docs -l pl.UTF-8
113 Dokumentacja do Tomcata - kontenera Servlet/JSP.
114
115 %package webapp-manager
116 Summary:        The Apache Tomcat Servlet/JSP application manager
117 Summary(pl.UTF-8):      Zarządca aplikacji w Tomcacie
118 Group:          Networking/Daemons/Java/Servlets
119 Requires:       %{name} = %{epoch}:%{version}-%{release}
120
121 %description webapp-manager
122 The Apache Tomcat Servlet/JSP application manager.
123
124 %description webapp-manager -l pl.UTF-8
125 Zarządca aplikacji w Tomcacie.
126
127 %package webapp-host-manager
128 Summary:        The Apache Tomcat Servlet/JSP virtual hosts manager
129 Summary(pl.UTF-8):      Zarządca wirtualnych hostów w Tomcacie
130 Group:          Networking/Daemons/Java/Servlets
131 Requires:       %{name} = %{epoch}:%{version}-%{release}
132 Obsoletes:      tomcat-admin
133
134 %description webapp-host-manager
135 The Apache Tomcat Servlet/JSP virtual hosts manager.
136
137 %description webapp-host-manager -l pl.UTF-8
138 Zarządca wirtualnych hostów w Tomcacie.
139
140 %package webapp-examples
141 Summary:        The Apache Tomcat Servlet/JSP example applications
142 Summary(pl.UTF-8):      Przykładowe aplikacje dla Tomcata
143 Group:          Networking/Daemons/Java/Servlets
144 Requires:       %{name} = %{epoch}:%{version}-%{release}
145
146 %description webapp-examples
147 The Apache Tomcat Servlet/JSP example applications.
148
149 %description webapp-examples -l pl.UTF-8
150 Przykładowe aplikacje dla Tomcata.
151
152 %package webservices
153 Summary:        Web Services support (JSR 109)
154 Group:          Libraries/Java
155 Requires:       java(JSR109)
156 Requires:       java-geronimo-spec-jaxrpc
157 Requires:       %{name} = %{epoch}:%{version}-%{release}
158
159 %description webservices
160 Factories for JSR 109 which may be used to resolve web services
161 references.
162
163 %package jasper
164 Summary:        JSP compiler
165 Summary(pl.UTF-8):      Kompilator JSP
166 Group:          Libraries/Java
167 Requires:       jpackage-utils
168 Requires:       eclipse-jdt >= 3.2
169 Obsoletes:      apache-tomcat-jasper
170
171 %description jasper
172 Jasper is Java ServerPages compiler used by Apache Tomcat servlet
173 container.
174
175 %description jasper -l pl.UTF-8
176 Jasper jest kompilatorem Java ServerPages używanym przez kontener
177 servletów Apache Tomcat.
178
179 %package -n java-servletapi
180 Summary:        Java servlet and JSP implementation classes
181 Summary(pl.UTF-8):      Klasy z implementacją Java Servlet i JSP
182 Group:          Libraries/Java
183 Provides:       java(JSP) = %{jspapiver}
184 Provides:       java(Servlet) = %{servletapiver}
185 Obsoletes:      java-servletapi5
186
187 %description -n java-servletapi
188 Implementation classes of the Java Servlet and JSP APIs (packages
189 javax.servlet, javax.servlet.http, javax.servlet.jsp, and
190 javax.servlet.jsp.tagext).
191
192 %description -n java-servletapi -l pl.UTF-8
193 Implementacje klas API Java Servlet i JSP (pakiety javax.servlet,
194 javax.servlet.http, javax.servlet.jsp i java.servlet.jsp.tagext).
195
196 %prep
197 %setup -q -n apache-%{name}-%{version}-src
198
199 %patch0 -p0
200 %patch1 -p0
201
202 # we don't need those scripts
203 rm bin/*.bat
204 rm bin/{startup,shutdown}.sh
205
206 cp %{SOURCE3} build.properties
207
208 %build
209 TOPDIR=$(pwd)
210
211 %ant -Drpm.javadir=%{_javadir} -Drpm.libdir=%{_libdir}
212
213 %if %{with javadoc}
214 %ant -f dist.xml dist-javadoc
215 %endif
216
217 %if %{with webservices}
218 mkdir -p output/extras/webservices
219
220 ln -s %{_javadir}/geronimo-spec-jaxrpc.jar output/extras/webservices/jaxrpc.jar
221 ln -s %{_javadir}/jsr109.jar output/extras/webservices/wsdl4j.jar
222
223 %ant -f extras.xml webservices
224 %endif
225
226
227 %install
228 rm -rf $RPM_BUILD_ROOT
229 cd output/build
230
231 TOMCATDIR=$RPM_BUILD_ROOT%{_tomcatdir}
232 CATALINADIR=$RPM_BUILD_ROOT/var/lib/tomcat
233
234 install -d $TOMCATDIR \
235             $CATALINADIR/temp \
236             $RPM_BUILD_ROOT%{_vardir}/webapps \
237             $RPM_BUILD_ROOT%{_vardir}/work \
238             $RPM_BUILD_ROOT%{_vardir}/conf \
239             $RPM_BUILD_ROOT%{_logdir}/tomcat \
240             $RPM_BUILD_ROOT/etc/sysconfig \
241             $RPM_BUILD_ROOT/etc/rc.d/init.d
242
243 install %{SOURCE1} $RPM_BUILD_ROOT/etc/rc.d/init.d/tomcat
244 install %{SOURCE2} $RPM_BUILD_ROOT/etc/sysconfig/tomcat
245
246 cp -a conf/* $CATALINADIR/conf
247 install -d $CATALINADIR/conf/Catalina/localhost
248 install %{SOURCE10} $CATALINADIR/conf/Catalina/localhost/ROOT.xml
249 install %{SOURCE11} $CATALINADIR/conf/Catalina/localhost/docs.xml
250 install %{SOURCE12} $CATALINADIR/conf/Catalina/localhost/manager.xml
251 install %{SOURCE13} $CATALINADIR/conf/Catalina/localhost/host-manager.xml
252 install %{SOURCE14} $CATALINADIR/conf/Catalina/localhost/examples.xml
253
254 cp -a bin lib webapps $TOMCATDIR
255 cp -a temp $CATALINADIR
256
257 ln -sf %{_logdir}/tomcat $CATALINADIR/logs
258 ln -sf %{_logdir}/tomcat $TOMCATDIR/logs
259 ln -sf %{_vardir}/work $TOMCATDIR/work
260 ln -sf %{_vardir}/conf $TOMCATDIR/conf
261 ln -sf %{_vardir}/conf $RPM_BUILD_ROOT%{_sysconfdir}
262
263 # symlinks instead of copies
264 jars="commons-daemon commons-logging-api"
265 for jar in $jars; do
266         jar=$(find-jar $jar)
267         ln -sf $jar $TOMCATDIR/bin
268 done
269
270 jars="commons-pool-tomcat5 commons-dbcp-tomcat5 mysql-connector-java org.eclipse.jdt.core"
271 for jar in $jars; do
272         jar=$(find-jar $jar)
273         ln -sf $jar $TOMCATDIR/lib
274 done
275
276 install -d $RPM_BUILD_ROOT%{_javadir}
277 mv $TOMCATDIR/lib/jasper*.jar $RPM_BUILD_ROOT%{_javadir}
278 mv $TOMCATDIR/lib/jsp-api.jar $RPM_BUILD_ROOT%{_javadir}/jsp-api-%{jspapiver}.jar
279 mv $TOMCATDIR/lib/servlet-api.jar $RPM_BUILD_ROOT%{_javadir}/servlet-api-%{servletapiver}.jar
280
281 ln -s jsp-api-%{jspapiver}.jar $RPM_BUILD_ROOT%{_javadir}/jsp-api.jar
282 ln -s servlet-api-%{servletapiver}.jar $RPM_BUILD_ROOT%{_javadir}/servlet-api.jar
283
284 # XXX add softlinks jasper-compiler.jar and jasper-runtime for compatibility with tomcat 5.5?
285 ln -sf %{_javadir}/jasper-el.jar $TOMCATDIR/lib
286 ln -sf %{_javadir}/jasper.jar $TOMCATDIR/lib
287
288 ln -sf %{_javadir}/jsp-api-%{jspapiver}.jar $TOMCATDIR/lib
289 ln -sf %{_javadir}/servlet-api-%{servletapiver}.jar $TOMCATDIR/lib
290
291 %if %{with webservices}
292 install ../extras/catalina-ws.jar $TOMCATDIR/lib/catalina-ws.jar
293
294 ln -s %{_javadir}/geronimo-spec-jaxrpc.jar $TOMCATDIR/lib/jaxrpc.jar
295 ln -s %{_javadir}/jsr109.jar $TOMCATDIR/lib/jsr109.jar
296 %endif
297
298 %clean
299 rm -rf $RPM_BUILD_ROOT
300
301 %pre
302 %groupadd -g 234 -r -f tomcat
303 %groupadd -g 237 -r -f servlet
304 %useradd -u 234 -r -d /var/lib/tomcat -s /bin/false -c "Tomcat User" -g tomcat -G servlet tomcat
305
306 %post
307 /sbin/chkconfig --add tomcat
308 %service tomcat restart
309
310 %preun
311 if [ "$1" = "0" ]; then
312         %service tomcat stop
313         /sbin/chkconfig --del tomcat
314 fi
315
316 %postun
317 if [ "$1" = "0" ]; then
318         %userremove tomcat
319         %groupremove tomcat
320         %groupremove servlet
321 fi
322
323 %files
324 %defattr(644,root,root,755)
325 %doc KEYS RELEASE-NOTES RELEASE-PLAN-6.0.txt RUNNING.txt
326 %attr(754,root,root) /etc/rc.d/init.d/tomcat
327 %config(noreplace) %verify(not md5 mtime size) /etc/sysconfig/tomcat
328 %{_sysconfdir}
329 %dir %{_tomcatdir}
330 %dir %{_tomcatdir}/conf
331 %dir %{_tomcatdir}/bin
332 %{_tomcatdir}/bin/catalina-tasks.xml
333 %attr(755,root,root) %{_tomcatdir}/bin/*.sh
334 %{_tomcatdir}/bin/*.jar
335 %dir %{_tomcatdir}/lib
336 %{_tomcatdir}/lib/annotations-api.jar
337 %{_tomcatdir}/lib/catalina-ant.jar
338 %{_tomcatdir}/lib/catalina-ha.jar
339 %{_tomcatdir}/lib/catalina.jar
340 %{_tomcatdir}/lib/catalina-tribes.jar
341 %{_tomcatdir}/lib/commons-dbcp-tomcat5.jar
342 %{_tomcatdir}/lib/commons-pool-tomcat5.jar
343 %{_tomcatdir}/lib/el-api.jar
344 %{_tomcatdir}/lib/jsp-api-2.1.jar
345 %{_tomcatdir}/lib/mysql-connector-java.jar
346 %{_tomcatdir}/lib/servlet-api-2.5.jar
347 %{_tomcatdir}/lib/tomcat-coyote.jar
348 %{_tomcatdir}/lib/tomcat-i18n-es.jar
349 %{_tomcatdir}/lib/tomcat-i18n-fr.jar
350 %{_tomcatdir}/lib/tomcat-i18n-ja.jar
351
352 %dir %{_tomcatdir}/webapps
353
354 %config(noreplace) %attr(664,root,tomcat) %verify(not md5 mtime size) %{_vardir}/conf/Catalina/localhost/ROOT.xml
355 %{_tomcatdir}/webapps/ROOT
356
357 %{_tomcatdir}/logs
358 %{_tomcatdir}/work
359 %dir %{_vardir}
360 # these directory has to be writeable because /admin need to modify config
361 # files and create temporary files
362 %dir %attr(775,root,tomcat) %{_vardir}/conf
363 %dir %attr(775,root,tomcat) %{_vardir}/conf/Catalina
364 %dir %{_vardir}/conf/Catalina/localhost
365 # tomcat config has to be writeable because of tomcat-users.xml file and Catalina dir
366 %config(noreplace) %attr(660,root,tomcat) %verify(not md5 mtime size) %{_vardir}/conf/catalina.policy
367 %config(noreplace) %attr(660,root,tomcat) %verify(not md5 mtime size) %{_vardir}/conf/*.properties*
368 %config(noreplace) %attr(660,root,tomcat) %verify(not md5 mtime size) %{_vardir}/conf/*.xml
369 %dir %attr(1730,root,tomcat) %{_vardir}/work
370 %dir %attr(775,root,tomcat) %{_vardir}/webapps
371 %dir %attr(775,root,tomcat) %{_vardir}/temp
372 %dir %attr(775,root,tomcat) %{_logdir}/tomcat
373 %{_vardir}/logs
374
375 %files webapp-docs
376 %defattr(644,root,root,755)
377 %config(noreplace) %attr(664,root,tomcat) %verify(not md5 mtime size) %{_vardir}/conf/Catalina/localhost/docs.xml
378 %{_tomcatdir}/webapps/docs
379
380 %files webapp-manager
381 %defattr(644,root,root,755)
382 %config(noreplace) %attr(664,root,tomcat) %verify(not md5 mtime size) %{_vardir}/conf/Catalina/localhost/manager.xml
383 %{_tomcatdir}/webapps/manager
384
385 %files webapp-host-manager
386 %defattr(644,root,root,755)
387 %config(noreplace) %attr(664,root,tomcat) %verify(not md5 mtime size) %{_vardir}/conf/Catalina/localhost/host-manager.xml
388 %{_tomcatdir}/webapps/host-manager
389
390 %files webapp-examples
391 %defattr(644,root,root,755)
392 %config(noreplace) %attr(664,root,tomcat) %verify(not md5 mtime size) %{_vardir}/conf/Catalina/localhost/examples.xml
393 %{_tomcatdir}/webapps/examples
394
395 %if %{with webservices}
396 %files webservices
397 %defattr(644,root,root,755)
398 %{_tomcatdir}/lib/catalina-ws.jar
399 %{_tomcatdir}/lib/jsr109.jar
400 %{_tomcatdir}/lib/jaxrpc.jar
401 %endif
402
403 %files jasper
404 %defattr(644,root,root,755)
405 %{_javadir}/jasper-el.jar
406 %{_javadir}/jasper.jar
407 %{_tomcatdir}/lib/jasper-el.jar
408 %{_tomcatdir}/lib/jasper.jar
409 %{_tomcatdir}/lib/org.eclipse.jdt.core.jar
410
411 %files -n java-servletapi
412 %defattr(644,root,root,755)
413 %{_javadir}/jsp-api*.jar
414 %{_javadir}/servlet-api*.jar
This page took 0.067439 seconds and 4 git commands to generate.