2 # - separate package for jsdk?
5 %bcond_with gcj # use javac instead of GCJ
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
36 Requires(post,preun): rc-scripts
37 Requires: apache1 >= 1.3.33-2
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/>.
69 Summary: ApacheJServ initscript
70 Summary(pl): Skrypt startowy ApacheJServ
71 Group: Development/Languages/Java
72 Requires: %{name} = %{version}-%{release}
73 Requires(pre): /bin/id
74 Requires(pre): /usr/bin/getgid
75 Requires(pre): /usr/sbin/useradd
76 Requires(pre): /usr/sbin/groupadd
79 JServ initscript for standalone mode.
81 %description init -l pl
82 Skrypt startowy JServ dla trybu samodzielnego.
85 Summary: ApacheJServ documentation
86 Summary(pl): Dokumentacja do ApacheJServ
87 Group: Development/Languages/Java
90 ApacheJserv documentation.
92 %description doc -l pl
93 Dokumentacja do ApacheJServ.
102 s|@JSDK_CLASSES@|%{_javadir}/servlet-2.0.jar|g
103 ' conf/jserv.properties.in
105 # do not load module in provided jserv.conf; we do this in httpd.conf
106 sed -i -e 's|@LOAD_OR_NOT@|#|g' conf/jserv.conf.in
108 # we don't want gcj related deps
109 sed -i -e '/^SUBDIRS/s,java,,' src/Makefile.am
110 sed -i -e '/^SUBDIRS/s,example,,' Makefile.am
113 if [ ! -f _autotools.done.1 ]; then
119 touch _autotools.done.1
122 # prepare compilation
123 if [ ! -f classpathx_servlet-%{jsdkversion}/servlet-2.0.jar ]; then
124 %{__make} -C classpathx_servlet-%{jsdkversion} jar_2_0
127 if [ ! -d jsdk-doc ]; then
128 %{__make} -C classpathx_servlet-%{jsdkversion}/apidoc
132 cp classpathx_servlet-%{jsdkversion}/{README,AUTHORS,COPYING.LIB} jsdk-doc
133 cp -r classpathx_servlet-%{jsdkversion}/apidoc jsdk-doc
137 CFLAGS="$(%{apxs} -q CFLAGS) %{rpmcflags}"
139 %{!?debug:--disable-debugging} \
140 --with-apxs=%{apxs} \
141 --with-logdir=%{logdir} \
142 --with-servlets=%{servletdir} \
143 %{!?with_gcj:GCJ=javac GCJFLAGS= CLASSPATH=`pwd` JAVAC_OPT="-source 1.4"} \
144 %{!?with_gcj:--with-javac=%{_bindir}/javac --with-java=%{_bindir}/java --with-jdk-home=%{_libdir}/java} \
145 %{?with_gcj:--with-javac=%{_bindir}/gcj --with-jar=%{_bindir}/fastjar} \
146 --with-JSDK=`pwd`/classpathx_servlet-%{jsdkversion}/servlet-2.0.jar
148 %{__make} %{!?with_gcj:OBJEXT=class JAVAC_OPT='-source 1.4'} \
153 rm -rf $RPM_BUILD_ROOT
154 install -d $RPM_BUILD_ROOT%{_javadir}
155 install -d $RPM_BUILD_ROOT/etc/apache/conf.d
156 install -d $RPM_BUILD_ROOT/etc/{rc.d/init.d,profile.d,logrotate.d}
157 install %{SOURCE2} $RPM_BUILD_ROOT/etc/apache/conf.d/81_mod_jserv.conf
158 install %{SOURCE3} $RPM_BUILD_ROOT/etc/rc.d/init.d/jserv
161 DESTDIR=$RPM_BUILD_ROOT
163 # we removed java, so do it manually
165 %{!?with_gcj:OBJEXT=class JAVAC_OPT='-source 1.4'} \
167 DESTDIR=$RPM_BUILD_ROOT
169 echo "default - change on install `date`" > $RPM_BUILD_ROOT%{_sysconfdir}/jserv.secret.key
172 #install src/scripts/package/rpm/jserv.init $RPM_BUILD_ROOT/etc/rc.d/init.d/jserv
173 #install src/scripts/package/rpm/jserv.sh $RPM_BUILD_ROOT/etc/profile.d
174 #install src/scripts/package/rpm/jserv.logrotate $RPM_BUILD_ROOT/etc/logrotate.d/jserv
177 install classpathx_servlet-%{jsdkversion}/servlet-2.0.jar $RPM_BUILD_ROOT%{_javadir}
179 find jsdk-doc -name 'Makefile*' | xargs rm -f
180 rm -rf jsdk-doc/{COPYING.LIB,CVS} jsdk-doc/apidoc/CVS
183 rm -f $RPM_BUILD_ROOT%{_sysconfdir}/jserv.conf
186 rm -rf $RPM_BUILD_ROOT
189 if [ "$1" = 1 ]; then
190 dd if=/dev/urandom bs=1 count=42 2>/dev/null \
191 | (md5sum 2>/dev/null || cat) > %{_sysconfdir}/jserv.secret.key
193 %service apache restart
196 if [ "$1" = "0" ]; then
197 %service -q apache restart
202 %groupadd -P %{name}-init -g 154 jserv
203 %useradd -P %{name}-init -u 154 -g jserv -d /etc/jserv -c "JServ User" jserv
206 /sbin/chkconfig --add jserv
209 if [ "$1" = 0 ]; then
210 if [ -f /var/lock/subsys/jserv ]; then
211 /etc/rc.d/init.d/jserv stop 1>&2
213 /sbin/chkconfig --del jserv
217 if [ "$1" = "0" ]; then
223 %defattr(644,root,root,755)
226 %attr(640,root,root) %config(noreplace) %verify(not md5 mtime size) %{httpdconf}/conf.d/*_mod_jserv.conf
227 %attr(640,root,http) %config(noreplace) %verify(not md5 mtime size) %{_sysconfdir}/jserv.properties
228 %attr(640,root,http) %config(noreplace) %verify(not md5 mtime size) %{_sysconfdir}/zone.properties
229 %attr(640,root,http) %config(noreplace) %verify(not md5 mtime size) %{_sysconfdir}/jserv.secret.key
230 #%attr(640,root,root) %config(noreplace) %verify(not size mtime md5) /etc/logrotate.d/jserv
231 #%config /etc/profile.d/jserv.sh
233 %attr(755,root,root) %{_pkglibdir}/mod_jserv.so
235 %{_javadir}/ApacheJServ.jar
236 %{_javadir}/servlet-2.0.jar
240 %{servletdir}/Hello.java
241 %{servletdir}/Hello.class
242 %{servletdir}/IsItWorking.java
243 %{servletdir}/IsItWorking.class
246 %attr(770,root,http) %dir %{logdir}
249 %defattr(644,root,root,755)
250 %attr(754,root,root) /etc/rc.d/init.d/jserv
253 %defattr(644,root,root,755)