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