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