2 # - separate package for jsdk?
5 %bcond_with gcj # use GCJ instead of javac
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
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
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
30 BuildRequires: gcc-java
31 BuildRequires: fastjar
32 Requires: /usr/bin/gij
38 BuildRoot: %{tmpdir}/%{name}-%{version}-root-%(id -u -n)
40 %define _pkglibdir %(%{apxs} -q LIBEXECDIR 2>/dev/null)
41 %define httpdconf %(%{apxs} -q SYSCONFDIR 2>/dev/null)
42 %define _sysconfdir /etc/jserv
43 %define logdir /var/log/jserv
44 %define servletdir %{_datadir}/jserv/servlets
45 %define _noautocompressdoc package-list
48 Apache JServ is a servlet engine, developed by the Java Apache Project
49 <http://java.apache.org/>. The Apache JServ servlet engine is written
50 in 100pc Java application, and listens for servlet requests using the
51 Apache Java protocol (AJp). Typically, these requests will originate
52 from the mod_jserv Apache module (DSO included). This package contains
53 a LGPL'ed implementation of Sun's Java Servlet API version 2.0 by Paul
54 Siegmann <http://www.euronet.nl/~pauls/java/servlet/>.
57 Apache JServ jest silnikiem serwletowym, rozwijanym przez Java Apache
58 Project <http://java.apache.org/>. Silnik serwletowy Apache JServ
59 zosta³ napisany od pocz±tku do koñca w Javie; nas³uchuje wywo³añ
60 serwletu wykorzystuj±c protokó³ Apache Java (AJp). Zazwyczaj wywo³ania
61 te pochodz± z modu³u Apache mod_jservmodule (³±cznie z DSO). Pakiet
62 ten zawiera implementacjê Java Servlet API Suna w wersji 2.0 napisan±
63 przez Paula Siegmanna (na licencji LGPL)
64 <http://www.euronet.nl/~pauls/java/servlet/>.
66 %package -n apache1-mod_jserv
67 Summary: JServ module for Apache
68 Group: Networking/Daemons
69 Requires: %{name} = %{version}-%{release}
70 Requires: apache1 >= 1.3.33-2
72 %description -n apache1-mod_jserv
73 Apache JServ apache module.
76 Summary: ApacheJServ initscript
77 Summary(pl): Skrypt startowy ApacheJServ
78 Group: Development/Languages/Java
79 Requires: %{name} = %{version}-%{release}
80 Requires(pre): /bin/id
81 Requires(pre): /usr/bin/getgid
82 Requires(pre): /usr/sbin/useradd
83 Requires(pre): /usr/sbin/groupadd
84 Requires(post,preun): rc-scripts
87 JServ initscript for standalone mode.
89 %description init -l pl
90 Skrypt startowy JServ dla trybu samodzielnego.
93 Summary: ApacheJServ documentation
94 Summary(pl): Dokumentacja do ApacheJServ
95 Group: Development/Languages/Java
98 ApacheJserv documentation.
100 %description doc -l pl
101 Dokumentacja do ApacheJServ.
110 s|@JSDK_CLASSES@|%{_javadir}/servlet-2.0.jar|g
111 ' conf/jserv.properties.in
113 # do not load module in provided jserv.conf; we do this in httpd.conf
114 sed -i -e 's|@LOAD_OR_NOT@|#|g' conf/jserv.conf.in
116 # we don't want gcj related deps
117 sed -i -e '/^SUBDIRS/s,java,,' src/Makefile.am
118 sed -i -e '/^SUBDIRS/s,example,,' Makefile.am
121 if [ ! -f _autotools.done.1 ]; then
127 touch _autotools.done.1
130 # prepare compilation
131 if [ ! -f classpathx_servlet-%{jsdkversion}/servlet-2.0.jar ]; then
132 %{__make} -C classpathx_servlet-%{jsdkversion} jar_2_0
135 if [ ! -d jsdk-doc ]; then
136 %{__make} -C classpathx_servlet-%{jsdkversion}/apidoc
140 cp classpathx_servlet-%{jsdkversion}/{README,AUTHORS,COPYING.LIB} jsdk-doc
141 cp -r classpathx_servlet-%{jsdkversion}/apidoc jsdk-doc
145 CFLAGS="$(%{apxs} -q CFLAGS) %{rpmcflags}"
147 %{!?debug:--disable-debugging} \
148 --with-apxs=%{apxs} \
149 --with-logdir=%{logdir} \
150 --with-servlets=%{servletdir} \
151 %{!?with_gcj:GCJ=javac GCJFLAGS= CLASSPATH=`pwd` JAVAC_OPT="-source 1.4"} \
152 %{!?with_gcj:--with-javac=%{_bindir}/javac --with-java=%{_bindir}/java --with-jdk-home=%{_libdir}/java} \
153 %{?with_gcj:--with-javac=%{_bindir}/gcj --with-jar=%{_bindir}/fastjar} \
154 --with-JSDK=`pwd`/classpathx_servlet-%{jsdkversion}/servlet-2.0.jar
156 %{__make} %{!?with_gcj:OBJEXT=class JAVAC_OPT='-source 1.4'} \
161 rm -rf $RPM_BUILD_ROOT
162 install -d $RPM_BUILD_ROOT{/etc/rc.d/init.d,%{httpdconf}/conf.d,%{_javadir}}
164 install %{SOURCE2} $RPM_BUILD_ROOT%{httpdconf}/conf.d/81_mod_jserv.conf
165 install %{SOURCE3} $RPM_BUILD_ROOT/etc/rc.d/init.d/jserv
168 DESTDIR=$RPM_BUILD_ROOT
170 # we removed java from SUBDIRS, so do it manually
172 %{!?with_gcj:OBJEXT=class JAVAC_OPT='-source 1.4'} \
174 DESTDIR=$RPM_BUILD_ROOT
176 echo "default - change on install" > $RPM_BUILD_ROOT%{_sysconfdir}/jserv.secret.key
179 install classpathx_servlet-%{jsdkversion}/servlet-2.0.jar $RPM_BUILD_ROOT%{_javadir}
181 find jsdk-doc -name 'Makefile*' | xargs rm -f
182 rm -rf jsdk-doc/{COPYING.LIB,CVS} jsdk-doc/apidoc/CVS
185 rm -f $RPM_BUILD_ROOT%{_sysconfdir}/jserv.conf
188 rm -rf $RPM_BUILD_ROOT
191 if [ "$1" = 1 ]; then
192 dd if=/dev/urandom bs=1 count=42 2>/dev/null \
193 | (md5sum 2>/dev/null || cat) > %{_sysconfdir}/jserv.secret.key
196 %post -n apache1-mod_jserv
197 %service apache restart
199 %postun -n apache1-mod_jserv
200 if [ "$1" = "0" ]; then
201 %service -q apache restart
205 %groupadd -P %{name}-init -g 154 jserv
206 %useradd -P %{name}-init -u 154 -g jserv -d /etc/jserv -c "JServ User" jserv
209 /sbin/chkconfig --add jserv
212 if [ "$1" = 0 ]; then
213 if [ -f /var/lock/subsys/jserv ]; then
214 /etc/rc.d/init.d/jserv stop 1>&2
216 /sbin/chkconfig --del jserv
220 if [ "$1" = "0" ]; then
226 %defattr(644,root,root,755)
229 %attr(640,root,root) %config(noreplace) %verify(not md5 mtime size) %{_sysconfdir}/jserv.properties
230 %attr(640,root,root) %config(noreplace) %verify(not md5 mtime size) %{_sysconfdir}/zone.properties
231 %attr(640,root,root) %config(noreplace) %verify(not md5 mtime size) %{_sysconfdir}/jserv.secret.key
232 %{_javadir}/ApacheJServ.jar
233 %{_javadir}/servlet-2.0.jar
237 %{servletdir}/Hello.java
238 %{servletdir}/Hello.class
239 %{servletdir}/IsItWorking.java
240 %{servletdir}/IsItWorking.class
243 %files -n apache1-mod_jserv
244 %defattr(644,root,root,755)
245 %attr(640,root,root) %config(noreplace) %verify(not md5 mtime size) %{httpdconf}/conf.d/*_mod_jserv.conf
246 %attr(755,root,root) %{_pkglibdir}/mod_jserv.so
247 %attr(770,root,http) %dir %{logdir}
250 %defattr(644,root,root,755)
251 %attr(754,root,root) /etc/rc.d/init.d/jserv
254 %defattr(644,root,root,755)