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 (rêcznego).
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)
110 Configuration for automatic JServ startup from Apache.
112 %description auto -l pl
113 Konfiguracja do automatycznego uruchamiania JServa z Apache'a.
116 Summary: ApacheJServ documentation
117 Summary(pl): Dokumentacja do ApacheJServ
118 Group: Development/Languages/Java
121 ApacheJserv documentation.
123 %description doc -l pl
124 Dokumentacja do ApacheJServ.
133 s|@JSDK_CLASSES@|%{_javadir}/servlet-2.0.jar|g
134 ' conf/jserv.properties.in
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
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
144 if [ ! -f _autotools.done.1 ]; then
150 touch _autotools.done.1
153 # prepare compilation
154 if [ ! -f classpathx_servlet-%{jsdkversion}/servlet-2.0.jar ]; then
155 %{__make} -C classpathx_servlet-%{jsdkversion} jar_2_0
158 if [ ! -d jsdk-doc ]; then
159 %{__make} -C classpathx_servlet-%{jsdkversion}/apidoc
163 cp classpathx_servlet-%{jsdkversion}/{README,AUTHORS,COPYING.LIB} jsdk-doc
164 cp -r classpathx_servlet-%{jsdkversion}/apidoc jsdk-doc
168 CFLAGS="$(%{apxs} -q CFLAGS) %{rpmcflags}"
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
179 %{__make} %{!?with_gcj:OBJEXT=class JAVAC_OPT='-source 1.4'} \
184 rm -rf $RPM_BUILD_ROOT
185 install -d $RPM_BUILD_ROOT{/etc/rc.d/init.d,%{httpdconf}/conf.d,%{_javadir}}
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
193 DESTDIR=$RPM_BUILD_ROOT
195 # we removed java from SUBDIRS, so do it manually
197 %{!?with_gcj:OBJEXT=class JAVAC_OPT='-source 1.4'} \
199 DESTDIR=$RPM_BUILD_ROOT
201 echo "default - change on install" > $RPM_BUILD_ROOT%{_sysconfdir}/jserv.secret.key
204 install classpathx_servlet-%{jsdkversion}/servlet-2.0.jar $RPM_BUILD_ROOT%{_javadir}
206 find jsdk-doc -name 'Makefile*' | xargs rm -f
207 rm -rf jsdk-doc/{COPYING.LIB,CVS} jsdk-doc/apidoc/CVS
210 rm -f $RPM_BUILD_ROOT%{_sysconfdir}/jserv.conf
211 rm -rf $RPM_BUILD_ROOT/usr/docs
214 rm -rf $RPM_BUILD_ROOT
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
222 %post -n apache1-mod_jserv
223 %service apache restart
226 %postun -n apache1-mod_jserv
227 if [ "$1" = "0" ]; then
228 %service -q apache restart
233 %groupadd -P %{name}-init -g 154 jserv
234 %useradd -P %{name}-init -u 154 -g jserv -d /etc/jserv -c "JServ User" jserv
237 /sbin/chkconfig --add jserv
240 if [ "$1" = 0 ]; then
241 if [ -f /var/lock/subsys/jserv ]; then
242 /etc/rc.d/init.d/jserv stop 1>&2
244 /sbin/chkconfig --del jserv
248 if [ "$1" = "0" ]; then
254 %defattr(644,root,root,755)
257 %{_javadir}/ApacheJServ.jar
258 %{_javadir}/servlet-2.0.jar
262 %{servletdir}/Hello.java
263 %{servletdir}/Hello.class
264 %{servletdir}/IsItWorking.java
265 %{servletdir}/IsItWorking.class
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}
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
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
289 %defattr(644,root,root,755)