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
33 Requires: /usr/bin/gij
35 BuildRequires: java-sun
36 Requires: java-sun-jre
40 BuildRoot: %{tmpdir}/%{name}-%{version}-root-%(id -u -n)
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
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/>.
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/>.
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
75 %description -n apache1-mod_jserv
76 JServ module for Apache.
78 %description -n apache1-mod_jserv -l pl
79 Modu³ JServ dla Apache'a.
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
92 Provides: %{name}(config)
93 Obsoletes: %{name}(config)
96 JServ initscript for standalone (manual) mode.
98 %description init -l pl
99 Skrypt startowy JServ dla trybu samodzielnego.
102 Summary: ApacheJServ initscript
103 Group: Development/Languages/Java
104 Requires: %{name} = %{version}-%{release}
105 Provides: %{name}(config)
106 Obsoletes: %{name}(config)
109 Configuration for automatic JServ startup from Apache.
112 Summary: ApacheJServ documentation
113 Summary(pl): Dokumentacja do ApacheJServ
114 Group: Development/Languages/Java
117 ApacheJserv documentation.
119 %description doc -l pl
120 Dokumentacja do ApacheJServ.
129 s|@JSDK_CLASSES@|%{_javadir}/servlet-2.0.jar|g
130 ' conf/jserv.properties.in
132 # do not load module in provided jserv.conf; we do this in httpd.conf
133 sed -i -e 's|@LOAD_OR_NOT@|#|g' conf/jserv.conf.in
135 # we don't want gcj related deps
136 sed -i -e '/^SUBDIRS/s,java,,' src/Makefile.am
137 sed -i -e '/^SUBDIRS/s,example,,' Makefile.am
140 if [ ! -f _autotools.done.1 ]; then
146 touch _autotools.done.1
149 # prepare compilation
150 if [ ! -f classpathx_servlet-%{jsdkversion}/servlet-2.0.jar ]; then
151 %{__make} -C classpathx_servlet-%{jsdkversion} jar_2_0
154 if [ ! -d jsdk-doc ]; then
155 %{__make} -C classpathx_servlet-%{jsdkversion}/apidoc
159 cp classpathx_servlet-%{jsdkversion}/{README,AUTHORS,COPYING.LIB} jsdk-doc
160 cp -r classpathx_servlet-%{jsdkversion}/apidoc jsdk-doc
164 CFLAGS="$(%{apxs} -q CFLAGS) %{rpmcflags}"
166 %{!?debug:--disable-debugging} \
167 --with-apxs=%{apxs} \
168 --with-logdir=%{logdir} \
169 --with-servlets=%{servletdir} \
170 %{!?with_gcj:GCJ=javac GCJFLAGS= CLASSPATH=`pwd` JAVAC_OPT="-source 1.4"} \
171 %{!?with_gcj:--with-javac=%{_bindir}/javac --with-java=%{_bindir}/java --with-jdk-home=%{_libdir}/java} \
172 %{?with_gcj:--with-javac=%{_bindir}/gcj --with-jar=%{_bindir}/fastjar} \
173 --with-JSDK=`pwd`/classpathx_servlet-%{jsdkversion}/servlet-2.0.jar
175 %{__make} %{!?with_gcj:OBJEXT=class JAVAC_OPT='-source 1.4'} \
180 rm -rf $RPM_BUILD_ROOT
181 install -d $RPM_BUILD_ROOT{/etc/rc.d/init.d,%{httpdconf}/conf.d,%{_javadir}}
183 install %{SOURCE2} $RPM_BUILD_ROOT%{httpdconf}/conf.d/81_mod_jserv.conf
184 sed -e '/^[ ]*ApJServManual[ ]\+/s/off/on/i' %{SOURCE2} \
185 > $RPM_BUILD_ROOT%{httpdconf}/conf.d/82_mod_jserv.conf
186 install %{SOURCE3} $RPM_BUILD_ROOT/etc/rc.d/init.d/jserv
189 DESTDIR=$RPM_BUILD_ROOT
191 # we removed java from SUBDIRS, so do it manually
193 %{!?with_gcj:OBJEXT=class JAVAC_OPT='-source 1.4'} \
195 DESTDIR=$RPM_BUILD_ROOT
197 echo "default - change on install" > $RPM_BUILD_ROOT%{_sysconfdir}/jserv.secret.key
200 install classpathx_servlet-%{jsdkversion}/servlet-2.0.jar $RPM_BUILD_ROOT%{_javadir}
202 find jsdk-doc -name 'Makefile*' | xargs rm -f
203 rm -rf jsdk-doc/{COPYING.LIB,CVS} jsdk-doc/apidoc/CVS
206 rm -f $RPM_BUILD_ROOT%{_sysconfdir}/jserv.conf
207 rm -rf $RPM_BUILD_ROOT/usr/docs
210 rm -rf $RPM_BUILD_ROOT
213 if [ "$1" = 1 ]; then
214 dd if=/dev/urandom bs=1 count=42 2>/dev/null \
215 | (md5sum 2>/dev/null || cat) > %{_sysconfdir}/jserv.secret.key
218 %post -n apache1-mod_jserv
219 %service apache restart
222 %postun -n apache1-mod_jserv
223 if [ "$1" = "0" ]; then
224 %service -q apache restart
229 %groupadd -P %{name}-init -g 154 jserv
230 %useradd -P %{name}-init -u 154 -g jserv -d /etc/jserv -c "JServ User" jserv
233 /sbin/chkconfig --add jserv
236 if [ "$1" = 0 ]; then
237 if [ -f /var/lock/subsys/jserv ]; then
238 /etc/rc.d/init.d/jserv stop 1>&2
240 /sbin/chkconfig --del jserv
244 if [ "$1" = "0" ]; then
250 %defattr(644,root,root,755)
253 %{_javadir}/ApacheJServ.jar
254 %{_javadir}/servlet-2.0.jar
258 %{servletdir}/Hello.java
259 %{servletdir}/Hello.class
260 %{servletdir}/IsItWorking.java
261 %{servletdir}/IsItWorking.class
264 %files -n apache1-mod_jserv
265 %defattr(644,root,root,755)
266 %attr(755,root,root) %{_pkglibdir}/mod_jserv.so
267 %attr(770,root,http) %dir %{logdir}
270 %defattr(644,root,root,755)
271 %attr(640,root,root) %config(noreplace) %verify(not md5 mtime size) %{httpdconf}/conf.d/82_mod_jserv.conf
272 %attr(640,root,jserv) %config(noreplace) %verify(not md5 mtime size) %{_sysconfdir}/jserv.properties
273 %attr(640,root,jserv) %config(noreplace) %verify(not md5 mtime size) %{_sysconfdir}/zone.properties
274 %attr(640,root,jserv) %config(noreplace) %verify(not md5 mtime size) %{_sysconfdir}/jserv.secret.key
275 %attr(754,root,root) /etc/rc.d/init.d/jserv
278 %defattr(644,root,root,755)
279 %attr(640,root,root) %config(noreplace) %verify(not md5 mtime size) %{httpdconf}/conf.d/81_mod_jserv.conf
280 %attr(640,root,http) %config(noreplace) %verify(not md5 mtime size) %{_sysconfdir}/jserv.properties
281 %attr(640,root,http) %config(noreplace) %verify(not md5 mtime size) %{_sysconfdir}/zone.properties
282 %attr(640,root,http) %config(noreplace) %verify(not md5 mtime size) %{_sysconfdir}/jserv.secret.key
285 %defattr(644,root,root,755)