1 %define apxs /usr/sbin/apxs1
3 Summary: Servlet engine with support for the leading web server
4 Summary(pl.UTF-8): Silnik serwletów ze wsparciem dla wiodącego serwera WWW
8 License: freely distributable & usable
9 Group: Networking/Daemons
10 Source0: http://java.apache.org/jserv/dist/%{name}-%{version}.tar.gz
11 # Source0-md5: 6d48a1b9fcc5eea4dfebaae29ba5a485
14 Source4: %{name}.sysconfig
16 Patch0: %{name}-enable-secret.patch
17 Patch1: %{name}-ac.patch
18 Patch2: %{name}-jre-env.patch
19 Patch3: %{name}-config.patch
20 Patch4: doc-overwrite.patch
21 URL: http://archive.apache.org/dist/java/jserv/
22 BuildRequires: apache1-devel >= 1.3.9-8
23 BuildRequires: autoconf
24 BuildRequires: automake
25 BuildRequires: gettext-tools
27 BuildRequires: jpackage-utils
28 BuildRequires: rpm-javaprov
29 BuildRequires: rpmbuild(macros) >= 1.300
30 BuildRequires: sed >= 4.0
31 BuildRequires: servlet = 2.0
32 Requires(post,preun): rc-scripts
33 Requires(pre): /bin/id
34 Requires(pre): /usr/bin/getgid
35 Requires(pre): /usr/sbin/groupadd
36 Requires(pre): /usr/sbin/useradd
37 Requires: jpackage-utils
39 Requires: rc-scripts >= 0.4.0.19
40 Requires: servlet = 2.0
41 Provides: group(jserv)
43 Obsoletes: ApacheJServ-doc
44 Obsoletes: ApacheJServ-init
46 BuildRoot: %{tmpdir}/%{name}-%{version}-root-%(id -u -n)
48 %define _pkglibdir %(%{apxs} -q LIBEXECDIR 2>/dev/null)
49 %define httpdconf %(%{apxs} -q SYSCONFDIR 2>/dev/null)
50 %define _sysconfdir /etc/jserv
53 Apache JServ is a servlet engine, developed by the Java Apache Project
54 <http://java.apache.org/>. The Apache JServ servlet engine is written
55 in 100pc Java application, and listens for servlet requests using the
56 Apache Java protocol (AJp). Typically, these requests will originate
57 from the mod_jserv Apache module (DSO included).
59 %description -l pl.UTF-8
60 Apache JServ jest silnikiem serwletowym, rozwijanym przez Java Apache
61 Project <http://java.apache.org/>. Silnik serwletowy Apache JServ
62 został napisany od początku do końca w Javie; nasłuchuje wywołań
63 serwletu wykorzystując protokół Apache Java (AJp). Zazwyczaj wywołania
64 te pochodzą z modułu Apache mod_jservmodule (łącznie z DSO).
66 %package -n apache1-mod_jserv
67 Summary: JServ module for Apache
68 Summary(pl.UTF-8): Moduł JServ dla Apache'a
69 Group: Networking/Daemons
70 Requires: apache1-base >= 1.3.33-2
71 Obsoletes: ApacheJServ-auto
73 %description -n apache1-mod_jserv
74 JServ module for Apache.
76 %description -n apache1-mod_jserv -l pl.UTF-8
77 Moduł JServ dla Apache'a.
87 # servlet-2.0 is the highest version the jserv code compiles with
88 servlet_jar=$(find-jar servlet-2.0)
90 s|@JSDK_CLASSES@|$servlet_jar|g
92 " conf/jserv.properties.in
94 # do not load module in provided jserv.conf; we do this in httpd.conf
95 %{__sed} -i -e 's|@LOAD_OR_NOT@|#|g' conf/jserv.conf.in
97 # we don't want gcj related deps
98 %{__sed} -i -e '/^SUBDIRS/s,java,,' src/Makefile.am
99 %{__sed} -i -e '/^SUBDIRS/s,example,,' Makefile.am
102 export JAVA_HOME="%{java_home}"
103 if [ ! -f _autotools.stamp ]; then
109 touch _autotools.stamp
113 CFLAGS="$(%{apxs} -q CFLAGS) %{rpmcflags}"
116 %{!?debug:--disable-debugging} \
117 --with-apxs=%{apxs} \
118 --with-logdir=/var/log/jserv \
119 --with-servlets=%{_datadir}/jserv/servlets \
120 --with-java-platform=1.4 \
121 --with-JSDK=$(find-jar servlet-2.0) \
122 %{!?with_gcj:GCJ=javac GCJFLAGS= CLASSPATH=$dir JAVAC_OPT="-source 1.4"} \
123 %{!?with_gcj:--with-javac=%{javac} --with-java=%{java} --with-jdk-home=$JAVA_HOME} \
124 %{?with_gcj:--with-javac=%{_bindir}/gcj --with-jar=%{_bindir}/fastjar} \
126 %{__make} %{!?with_gcj:OBJEXT=class JAVAC_OPT='-source 1.4'} \
131 rm -rf $RPM_BUILD_ROOT
132 install -d $RPM_BUILD_ROOT{/etc/{sysconfig,rc.d/init.d},%{httpdconf}/conf.d,%{_javadir},%{_sbindir}}
134 install %{SOURCE2} $RPM_BUILD_ROOT%{httpdconf}/conf.d/80_mod_jserv.conf
135 install %{SOURCE3} $RPM_BUILD_ROOT/etc/rc.d/init.d/jserv
136 install %{SOURCE4} $RPM_BUILD_ROOT/etc/sysconfig/jserv
137 install %{SOURCE5} $RPM_BUILD_ROOT%{_sbindir}
140 DESTDIR=$RPM_BUILD_ROOT
142 # we removed java from SUBDIRS, so do it manually
144 %{!?with_gcj:OBJEXT=class JAVAC_OPT='-source 1.4'} \
146 DESTDIR=$RPM_BUILD_ROOT
148 > $RPM_BUILD_ROOT%{httpdconf}/jserv.secret.key
149 > $RPM_BUILD_ROOT%{_sysconfdir}/jserv.secret.key
151 install -d $RPM_BUILD_ROOT%{_datadir}/jserv/servlets
154 rm -f $RPM_BUILD_ROOT%{_sysconfdir}/jserv.conf
155 rm -rf $RPM_BUILD_ROOT%{_prefix}/docs
158 rm -rf $RPM_BUILD_ROOT
161 %groupadd -g 154 jserv
162 %useradd -u 154 -g jserv -d /etc/jserv -c "JServ User" jserv
165 if [ ! -s %{_sysconfdir}/jserv.secret.key ]; then
166 if [ -s %{httpdconf}/jserv.secret.key ]; then
167 cat %{httpdconf}/jserv.secret.key > %{_sysconfdir}/jserv.secret.key
169 dd if=/dev/urandom bs=1 count=42 2>/dev/null \
170 | (md5sum 2>/dev/null || cat) > %{_sysconfdir}/jserv.secret.key
173 /sbin/chkconfig --add jserv
174 %service jserv restart "Apache JServ Daemon"
177 if [ "$1" = 0 ]; then
179 /sbin/chkconfig --del jserv
183 if [ "$1" = "0" ]; then
188 %post -n apache1-mod_jserv
189 if [ ! -s %{httpdconf}/jserv.secret.key ]; then
190 if [ -s %{_sysconfdir}/jserv.secret.key ]; then
191 cat %{_sysconfdir}/jserv.secret.key > %{httpdconf}/jserv.secret.key
193 dd if=/dev/urandom bs=1 count=42 2>/dev/null \
194 | (md5sum 2>/dev/null || cat) > %{httpdconf}/jserv.secret.key
197 %service -q apache restart
199 %postun -n apache1-mod_jserv
200 if [ "$1" = "0" ]; then
201 %service -q apache restart
205 %defattr(644,root,root,755)
208 %dir %attr(750,root,jserv) %{_sysconfdir}
209 %attr(640,root,jserv) %config(noreplace) %verify(not md5 mtime size) %{_sysconfdir}/jserv.secret.key
210 %attr(640,root,jserv) %config(noreplace) %verify(not md5 mtime size) %{_sysconfdir}/jserv.properties
211 %attr(640,root,jserv) %config(noreplace) %verify(not md5 mtime size) %{_sysconfdir}/zone.properties
212 %attr(754,root,root) /etc/rc.d/init.d/jserv
213 %attr(755,root,root) %{_sbindir}/runjserv
214 %config(noreplace) %verify(not md5 mtime size) /etc/sysconfig/jserv
215 %{_javadir}/ApacheJServ.jar
216 %dir %{_datadir}/jserv
217 %dir %attr(750,root,jserv) %{_datadir}/jserv/servlets
218 %attr(770,root,jserv) %dir /var/log/jserv
220 %files -n apache1-mod_jserv
221 %defattr(644,root,root,755)
222 %attr(755,root,root) %{_pkglibdir}/mod_jserv.so
223 %attr(640,root,root) %config(noreplace) %verify(not md5 mtime size) %{httpdconf}/conf.d/80_mod_jserv.conf
224 %attr(640,root,http) %config(noreplace) %verify(not md5 mtime size) %{httpdconf}/jserv.secret.key