]> git.pld-linux.org Git - packages/ApacheJServ.git/blob - ApacheJServ.spec
- pl for -auto
[packages/ApacheJServ.git] / ApacheJServ.spec
1 # TODO
2 # - separate package for jsdk?
3 #
4 # Conditional build:
5 %bcond_with     gcj     # use GCJ instead of javac
6 #
7 %define         apxs            /usr/sbin/apxs1
8 %define         jsdkversion     20000924
9 Summary:        Servlet engine with support for the leading web server
10 Summary(pl):    Silnik serwletów ze wsparciem dla wiod±cego serwera WWW
11 Name:           ApacheJServ
12 Version:        1.1.2
13 Release:        0.56
14 License:        freely distributable & usable (JServ), LGPL (JSDK)
15 Group:          Networking/Daemons
16 Source0:        http://java.apache.org/jserv/dist/%{name}-%{version}.tar.gz
17 # Source0-md5:  6d48a1b9fcc5eea4dfebaae29ba5a485
18 Source1:        http://www.euronet.nl/~pauls/java/servlet/download/classpathx_servlet-%{jsdkversion}.tar.gz
19 # Source1-md5:  a81feddb91b1358f9aaed94e83eddb54
20 Source2:        %{name}.conf
21 Source3:        %{name}.init
22 Patch0:         %{name}-enable-secret.patch
23 Patch1:         %{name}-ac.patch
24 Patch2:         %{name}-jre-env.patch
25 URL:            http://java.apache.org/
26 BuildRequires:  apache1-devel >= 1.3.9-8
27 BuildRequires:  rpmbuild(macros) >= 1.228
28 BuildRequires:  sed >= 4.0
29 %if %{with gcj}
30 BuildRequires:  gcc-java
31 BuildRequires:  fastjar
32 BuildRequires:  jdkgcj
33 Requires:       /usr/bin/gij
34 %else
35 BuildRequires:  java-sun
36 Requires:       java-sun-jre
37 %endif
38 Provides:       jserv
39 Provides:       jsdk20
40 BuildRoot:      %{tmpdir}/%{name}-%{version}-root-%(id -u -n)
41
42 %define         _pkglibdir      %(%{apxs} -q LIBEXECDIR 2>/dev/null)
43 %define         httpdconf       %(%{apxs} -q SYSCONFDIR 2>/dev/null)
44 %define         _sysconfdir     /etc/jserv
45 %define         logdir          /var/log/jserv
46 %define         servletdir      %{_datadir}/jserv/servlets
47 %define         _noautocompressdoc  package-list
48
49 %description
50 Apache JServ is a servlet engine, developed by the Java Apache Project
51 <http://java.apache.org/>. The Apache JServ servlet engine is written
52 in 100pc Java application, and listens for servlet requests using the
53 Apache Java protocol (AJp). Typically, these requests will originate
54 from the mod_jserv Apache module (DSO included). This package contains
55 a LGPL'ed implementation of Sun's Java Servlet API version 2.0 by Paul
56 Siegmann <http://www.euronet.nl/~pauls/java/servlet/>.
57
58 %description -l pl
59 Apache JServ jest silnikiem serwletowym, rozwijanym przez Java Apache
60 Project <http://java.apache.org/>. Silnik serwletowy Apache JServ
61 zosta³ napisany od pocz±tku do koñca w Javie; nas³uchuje wywo³añ
62 serwletu wykorzystuj±c protokó³ Apache Java (AJp). Zazwyczaj wywo³ania
63 te pochodz± z modu³u Apache mod_jservmodule (³±cznie z DSO). Pakiet
64 ten zawiera implementacjê Java Servlet API Suna w wersji 2.0 napisan±
65 przez Paula Siegmanna (na licencji LGPL)
66 <http://www.euronet.nl/~pauls/java/servlet/>.
67
68 %package -n apache1-mod_jserv
69 Summary:        JServ module for Apache
70 Summary(pl):    Modu³ JServ dla Apache'a
71 Group:          Networking/Daemons
72 Requires:       %{name} = %{version}-%{release}
73 Requires:       apache1 >= 1.3.33-2
74
75 %description -n apache1-mod_jserv
76 JServ module for Apache.
77
78 %description -n apache1-mod_jserv -l pl
79 Modu³ JServ dla Apache'a.
80
81 %package init
82 Summary:        ApacheJServ initscript
83 Summary(pl):    Skrypt startowy ApacheJServ
84 Group:          Development/Languages/Java
85 Requires:       %{name} = %{version}-%{release}
86 Requires(pre):  /bin/id
87 Requires(pre):  /usr/bin/getgid
88 Requires(pre):  /usr/sbin/useradd
89 Requires(pre):  /usr/sbin/groupadd
90 Requires(post,preun):   rc-scripts
91 Requires:       rc-scripts
92 Provides:       %{name}(config)
93 Obsoletes:      %{name}(config)
94
95 %description init
96 JServ initscript for standalone (manual) mode.
97
98 %description init -l pl
99 Skrypt startowy JServ dla trybu samodzielnego (rêcznego).
100
101 %package auto
102 Summary:        ApacheJServ initscript
103 Summary(pl):    Skrypt startowy ApacheJServ
104 Group:          Development/Languages/Java
105 Requires:       %{name} = %{version}-%{release}
106 Provides:       %{name}(config)
107 Obsoletes:      %{name}(config)
108
109 %description auto
110 Configuration for automatic JServ startup from Apache.
111
112 %description auto -l pl
113 Konfiguracja do automatycznego uruchamiania JServa z Apache'a.
114
115 %package doc
116 Summary:        ApacheJServ documentation
117 Summary(pl):    Dokumentacja do ApacheJServ
118 Group:          Development/Languages/Java
119
120 %description doc
121 ApacheJserv documentation.
122
123 %description doc -l pl
124 Dokumentacja do ApacheJServ.
125
126 %prep
127 %setup -q -a1
128 %patch0 -p0
129 %patch1 -p0
130 %patch2 -p1
131
132 sed -i -e '
133         s|@JSDK_CLASSES@|%{_javadir}/servlet-2.0.jar|g
134 ' conf/jserv.properties.in
135
136 # do not load module in provided jserv.conf; we do this in httpd.conf
137 sed -i -e 's|@LOAD_OR_NOT@|#|g' conf/jserv.conf.in
138
139 # we don't want gcj related deps
140 sed -i -e '/^SUBDIRS/s,java,,' src/Makefile.am
141 sed -i -e '/^SUBDIRS/s,example,,' Makefile.am
142
143 %build
144 if [ ! -f _autotools.done.1 ]; then
145         %{__gettextize}
146         %{__libtoolize}
147         %{__aclocal}
148         %{__autoconf}
149         %{__automake}
150         touch _autotools.done.1
151 fi
152
153 # prepare compilation
154 if [ ! -f classpathx_servlet-%{jsdkversion}/servlet-2.0.jar ]; then
155         %{__make} -C classpathx_servlet-%{jsdkversion} jar_2_0
156 fi
157
158 if [ ! -d jsdk-doc ]; then
159         %{__make} -C classpathx_servlet-%{jsdkversion}/apidoc
160
161         # copy API-doc
162         mkdir jsdk-doc
163         cp classpathx_servlet-%{jsdkversion}/{README,AUTHORS,COPYING.LIB} jsdk-doc
164         cp -r classpathx_servlet-%{jsdkversion}/apidoc jsdk-doc
165 fi
166
167 ### JSERV
168 CFLAGS="$(%{apxs} -q CFLAGS) %{rpmcflags}"
169 %configure \
170         %{!?debug:--disable-debugging} \
171         --with-apxs=%{apxs} \
172         --with-logdir=%{logdir} \
173         --with-servlets=%{servletdir} \
174         %{!?with_gcj:GCJ=javac GCJFLAGS= CLASSPATH=`pwd` JAVAC_OPT="-source 1.4"} \
175     %{!?with_gcj:--with-javac=%{_bindir}/javac --with-java=%{_bindir}/java --with-jdk-home=%{_libdir}/java} \
176     %{?with_gcj:--with-javac=%{_bindir}/gcj --with-jar=%{_bindir}/fastjar} \
177         --with-JSDK=`pwd`/classpathx_servlet-%{jsdkversion}/servlet-2.0.jar
178
179 %{__make} %{!?with_gcj:OBJEXT=class JAVAC_OPT='-source 1.4'} \
180         -C src/java
181 %{__make}
182
183 %install
184 rm -rf $RPM_BUILD_ROOT
185 install -d $RPM_BUILD_ROOT{/etc/rc.d/init.d,%{httpdconf}/conf.d,%{_javadir}}
186
187 install %{SOURCE2} $RPM_BUILD_ROOT%{httpdconf}/conf.d/81_mod_jserv.conf
188 sed -e '/^[      ]*ApJServManual[        ]\+/s/off/on/i' %{SOURCE2} \
189         > $RPM_BUILD_ROOT%{httpdconf}/conf.d/82_mod_jserv.conf
190 install %{SOURCE3} $RPM_BUILD_ROOT/etc/rc.d/init.d/jserv
191
192 %{__make} install \
193         DESTDIR=$RPM_BUILD_ROOT
194
195 # we removed java from SUBDIRS, so do it manually
196 %{__make} install \
197         %{!?with_gcj:OBJEXT=class JAVAC_OPT='-source 1.4'} \
198         -C src/java \
199         DESTDIR=$RPM_BUILD_ROOT
200
201 echo "default - change on install" > $RPM_BUILD_ROOT%{_sysconfdir}/jserv.secret.key
202
203 ### GNU JSDK-classes
204 install classpathx_servlet-%{jsdkversion}/servlet-2.0.jar $RPM_BUILD_ROOT%{_javadir}
205
206 find jsdk-doc -name 'Makefile*' | xargs rm -f
207 rm -rf jsdk-doc/{COPYING.LIB,CVS} jsdk-doc/apidoc/CVS
208
209 # duplicate
210 rm -f $RPM_BUILD_ROOT%{_sysconfdir}/jserv.conf
211 rm -rf $RPM_BUILD_ROOT/usr/docs
212
213 %clean
214 rm -rf $RPM_BUILD_ROOT
215
216 %post
217 if [ "$1" = 1 ]; then
218         dd if=/dev/urandom bs=1 count=42 2>/dev/null \
219                 | (md5sum 2>/dev/null || cat) > %{_sysconfdir}/jserv.secret.key
220 fi
221
222 %post -n apache1-mod_jserv
223 %service apache restart
224 exit 0
225
226 %postun -n apache1-mod_jserv
227 if [ "$1" = "0" ]; then
228         %service -q apache restart
229 fi
230 exit 0
231
232 %pre init
233 %groupadd -P %{name}-init -g 154 jserv
234 %useradd -P %{name}-init -u 154 -g jserv -d /etc/jserv -c "JServ User" jserv
235
236 %post init
237 /sbin/chkconfig --add jserv
238
239 %preun init
240 if [ "$1" = 0 ]; then
241         if [ -f /var/lock/subsys/jserv ]; then
242                 /etc/rc.d/init.d/jserv stop 1>&2
243         fi
244         /sbin/chkconfig --del jserv
245 fi
246
247 %postun init
248 if [ "$1" = "0" ]; then
249         %userremove jserv
250         %groupremove jserv
251 fi
252
253 %files
254 %defattr(644,root,root,755)
255 %doc LICENSE README
256 %dir %{_sysconfdir}
257 %{_javadir}/ApacheJServ.jar
258 %{_javadir}/servlet-2.0.jar
259
260 %if 0
261 %dir %{servletdir}
262 %{servletdir}/Hello.java
263 %{servletdir}/Hello.class
264 %{servletdir}/IsItWorking.java
265 %{servletdir}/IsItWorking.class
266 %endif
267
268 %files -n apache1-mod_jserv
269 %defattr(644,root,root,755)
270 %attr(755,root,root) %{_pkglibdir}/mod_jserv.so
271 %attr(770,root,http) %dir %{logdir}
272
273 %files init
274 %defattr(644,root,root,755)
275 %attr(640,root,root) %config(noreplace) %verify(not md5 mtime size) %{httpdconf}/conf.d/82_mod_jserv.conf
276 %attr(640,root,jserv) %config(noreplace) %verify(not md5 mtime size) %{_sysconfdir}/jserv.properties
277 %attr(640,root,jserv) %config(noreplace) %verify(not md5 mtime size) %{_sysconfdir}/zone.properties
278 %attr(640,root,jserv) %config(noreplace) %verify(not md5 mtime size) %{_sysconfdir}/jserv.secret.key
279 %attr(754,root,root) /etc/rc.d/init.d/jserv
280
281 %files auto
282 %defattr(644,root,root,755)
283 %attr(640,root,root) %config(noreplace) %verify(not md5 mtime size) %{httpdconf}/conf.d/81_mod_jserv.conf
284 %attr(640,root,http) %config(noreplace) %verify(not md5 mtime size) %{_sysconfdir}/jserv.properties
285 %attr(640,root,http) %config(noreplace) %verify(not md5 mtime size) %{_sysconfdir}/zone.properties
286 %attr(640,root,http) %config(noreplace) %verify(not md5 mtime size) %{_sysconfdir}/jserv.secret.key
287
288 %files doc
289 %defattr(644,root,root,755)
290 %doc index.html docs
291 %doc jsdk-doc
This page took 0.064559 seconds and 3 git commands to generate.