]> git.pld-linux.org Git - SPECS.git/blob - resin.spec
SPECS updated Wed 28 Jul 14:48:01 CEST 2021
[SPECS.git] / resin.spec
1
2 # TODO:
3 #   - test the Apache module
4 #   - review by PLD Java and Apache specialists
5
6 %define         apxs            /usr/sbin/apxs
7 %define         _pkglibdir      %(%{apxs} -q LIBEXECDIR)
8 Summary:        A fast servlet and JSP engine
9 Summary(pl.UTF-8):      Szybki silnik servletów i JSP
10 Name:           resin
11 Version:        3.0.13
12 Release:        0.1
13 License:        GPL
14 Group:          Networking/Daemons
15 Source0:        http://www.caucho.com/download/%{name}-%{version}.tar.gz
16 # Source0-md5:  4e5a07b29b6b8ed86630c169bf62aba2
17 Source1:        %{name}-mod_caucho.conf
18 Source2:        %{name}.init
19 Source3:        %{name}.sysconfig
20 Patch0:         %{name}-configure-test-httpd.conf.patch
21 Patch1:         %{name}-apache2-test.patch
22 Patch2:         %{name}-paths.patch
23 URL:            http://www.caucho.com/resin/
24 BuildRequires:  apache-devel
25 BuildRequires:  jdk >= 1.2
26 Requires(post,preun):   /sbin/chkconfig
27 Requires(postun):       /usr/sbin/groupdel
28 Requires(postun):       /usr/sbin/userdel
29 Requires(pre):  /bin/id
30 Requires(pre):  /usr/bin/getgid
31 Requires(pre):  /usr/sbin/groupadd
32 Requires(pre):  /usr/sbin/useradd
33 # for running even kaffe should be enough, since it's java 1.1
34 Requires:       jre >= 1.1
35 # Provides:     webserver
36 Provides:       group(http)
37 Provides:       jsp
38 Provides:       servlet
39 Provides:       user(http)
40 BuildRoot:      %{tmpdir}/%{name}-%{version}-root-%(id -u -n)
41
42 %description
43 Resin is a fast servlet and JSP engine supporting load balancing for
44 increased reliability. Resin encourages separation of content from
45 style with its XSL support. Servlets can generate simple XML and use
46 an XSL filter to format results for each client's capability, from
47 palm pilots to Mozilla.
48
49 This package provides the standalone Resin webserver only. Install
50 "apache-mod_caucho" package to use Resin with apache.
51
52 %description -l pl.UTF-8
53 Resin to szybki silnik servletowy i JSP, obsługujący load balancing
54 aby osiągnąć większą niezawodność. Resin wspiera oddzielenie treści od
55 stylu poprzez obsługę XSL-a. Servlety mogą generować prosty XML i
56 używać filtra XSL do formatowania wyników zależnie od możliwości
57 klienta, od Palm Pilotów do Mozilli.
58
59 Ten pakiet zawiera jedynie samodzielny serwer WWW Resina. Aby użyć
60 Resin z Apache należy zainstalować dodatkowo pakiet
61 "apache-mod_caucho".
62
63 %package -n apache-mod_caucho
64 Summary:        An Apache module for Resin servlet and JSP engine
65 Summary(pl.UTF-8):      Moduł Apache dla silnika servletów i JSP
66 Group:          Networking/Daemons
67 Requires(post,preun):   /usr/sbin/apxs
68 Requires:       apache
69 Requires:       resin = %{epoch}:%{version}-%{release}
70
71 %description -n apache-mod_caucho
72 An Apache module for Resin servlet and JSP engine.
73
74 %description -n apache-mod_caucho -l pl.UTF-8
75 Moduł Apache dla silnika servletów i JSP.
76
77 %package doc
78 Summary:        Resin online documentation
79 Summary(pl.UTF-8):      Dokumentacja online dla Resina
80 Group:          Networking/Daemons
81 Requires:       %{name} = %{epoch}:%{version}-%{release}
82
83 %description doc
84 Provides Resin documentation as http://localhost:8080/resin-doc/
85 (assuming default Resin configuration).
86
87 %description doc -l pl.UTF-8
88 Udostępnia dokumentację Resina jako http://localhost:8080/resin-doc/
89 (zakładając domyślną konfigurację Resina).
90
91 %prep
92 %setup -q
93 %patch0 -p1
94 %patch1 -p1
95 %patch2 -p1
96
97 %build
98 # this are available in the -src tarball only, which is harder to build
99 #rm -f configure # to get permissions right
100 #aclocal
101 #autoconf
102
103 cp -f /usr/share/automake/config.* automake
104 %configure \
105         --with-apxs=%{_sbindir}/apxs \
106         --with-apache \
107         --with-jni-include="-I/usr/%{_lib}/java/include -I/usr/%{_lib}/java/include/linux" \
108         CFLAGS="%{rpmcflags} `/usr/bin/apr-1-config --includes --cppflags` `/usr/bin/apu-1-config --includes`"
109 # should be found depending on location of `java' binary
110 # and/or JAVA_HOME
111 #        --with-java-home=%{_libdir}/java \
112
113 %{__make}
114
115 %install
116 rm -rf $RPM_BUILD_ROOT
117 install -d $RPM_BUILD_ROOT%{_pkglibdir} \
118           $RPM_BUILD_ROOT%{_sysconfdir}/{resin,httpd/httpd.conf,rc.d/init.d,sysconfig} \
119           $RPM_BUILD_ROOT%{_datadir}/resin/{lib,bin,webapps} \
120           $RPM_BUILD_ROOT%{_libdir}/resin \
121           $RPM_BUILD_ROOT/var/{run,log}/resin \
122           $RPM_BUILD_ROOT/var/lib/resin/{cache,work,tmp,webapps}
123
124 libtool --mode=install install modules/c/src/apache2/mod_caucho.la $RPM_BUILD_ROOT%{_pkglibdir}/wtf
125
126 cp -R bin/*{.sh,.pl} $RPM_BUILD_ROOT%{_datadir}/resin/bin
127 cp -R conf/* $RPM_BUILD_ROOT%{_sysconfdir}/resin
128 cp -R lib/* $RPM_BUILD_ROOT%{_datadir}/resin/lib
129 cp -R webapps/* $RPM_BUILD_ROOT%{_datadir}/resin/webapps
130
131 install modules/c/src/resin_os/libresin_os.so $RPM_BUILD_ROOT%{_libdir}/resin
132
133 install %{SOURCE1} $RPM_BUILD_ROOT/etc/httpd/httpd.conf/70_mod_caucho.conf
134 install %{SOURCE2} $RPM_BUILD_ROOT/etc/rc.d/init.d/resin
135 install %{SOURCE3} $RPM_BUILD_ROOT/etc/sysconfig/resin
136
137 %clean
138 rm -rf $RPM_BUILD_ROOT
139
140 %pre
141 %groupadd -g 51 http
142 %useradd -u 51 -r -d /home/services/httpd -s /bin/false -c "HTTP User" -g http http
143
144 %postun
145 if [ "$1" = "0" ]; then
146         %userremove http
147         %groupremove http
148 fi
149
150 %preun
151 if [ "$1" = "0" ]; then
152         if [ -f /var/lock/subsys/resin ]; then
153                 /etc/rc.d/init.d/resin stop 1>&2
154         fi
155         /sbin/chkconfig --del resin
156 fi
157
158 %post
159 /sbin/chkconfig --add resin
160 if [ -f /var/lock/subsys/resin ]; then
161         /etc/rc.d/init.d/resin restart 1>&2
162 else
163         echo "Run \"/etc/rc.d/init.d/resin start\" to start resin daemon."
164 fi
165
166 %preun -n apache-mod_caucho
167 if [ "$1" = "0" ]; then
168         if [ -f /var/lock/subsys/httpd ]; then
169                 /etc/rc.d/init.d/httpd restart 1>&2
170         fi
171 fi
172
173 %post -n apache-mod_caucho
174 if [ -f /var/lock/subsys/httpd ]; then
175         /etc/rc.d/init.d/httpd restart 1>&2
176 else
177         echo "Run \"/etc/rc.d/init.d/httpd start\" to start apache HTTP daemon."
178 fi
179
180 %post doc
181 if [ -f /var/lock/subsys/resin ]; then
182         /etc/rc.d/init.d/resin restart 1>&2
183 fi
184
185 %postun doc
186 if [ -f /var/lock/subsys/resin ]; then
187         /etc/rc.d/init.d/resin restart 1>&2
188         rm -f /var/lib/resin/webapps/resin-doc 2>/dev/null
189 fi
190
191
192 %files
193 %defattr(644,root,root,755)
194 %doc README
195 %attr(660,root,http) %config(noreplace) %verify(not md5 mtime size) %{_sysconfdir}/resin/*
196 %attr(640,root,root) %config(noreplace) %verify(not md5 mtime size) /etc/sysconfig/resin
197 %attr(754,root,root) /etc/rc.d/init.d/resin
198
199 %dir %{_libdir}/resin
200 %attr(755,root,root) %{_libdir}/resin/*
201
202 %dir %{_datadir}/resin
203 %dir %{_datadir}/resin/bin
204 %attr(755,root,root) %{_datadir}/resin/bin/*
205 %dir %{_datadir}/resin/lib
206 %{_datadir}/resin/lib/*
207 %dir %{_datadir}/resin/webapps
208 %{_datadir}/resin/webapps/ROOT
209
210 %dir /var/lib/resin
211 %attr(770,root,http) /var/lib/resin/*
212 %attr(770,root,http) %dir /var/log/resin
213 %attr(770,root,http) %dir /var/run/resin
214
215 %files -n apache-mod_caucho
216 %defattr(644,root,root,755)
217 %attr(640,root,root) %config(noreplace) %verify(not md5 mtime size) /etc/httpd/httpd.conf/70_mod_caucho.conf
218 %attr(755,root,root) %{_pkglibdir}/mod_caucho.so
219
220 %files doc
221 %defattr(644,root,root,755)
222 %{_datadir}/resin/webapps/resin-doc*
This page took 0.935281 seconds and 3 git commands to generate.