]> git.pld-linux.org Git - packages/ApacheJServ.git/blame_incremental - ApacheJServ.spec
- release 11 (by relup.sh)
[packages/ApacheJServ.git] / ApacheJServ.spec
... / ...
CommitLineData
1%define apxs /usr/sbin/apxs1
2%define mod_name jserv
3%include /usr/lib/rpm/macros.java
4Summary: Servlet engine with support for the leading web server
5Summary(pl.UTF-8): Silnik serwletów ze wsparciem dla wiodącego serwera WWW
6Name: ApacheJServ
7Version: 1.1.2
8Release: 11
9License: freely distributable & usable
10Group: Networking/Daemons
11Source0: http://java.apache.org/jserv/dist/%{name}-%{version}.tar.gz
12# Source0-md5: 6d48a1b9fcc5eea4dfebaae29ba5a485
13Source2: %{name}.conf
14Source3: %{name}.init
15Source4: %{name}.sysconfig
16Source5: runjserv
17Patch0: %{name}-enable-secret.patch
18Patch1: %{name}-ac.patch
19Patch2: %{name}-jre-env.patch
20Patch3: %{name}-config.patch
21Patch4: doc-overwrite.patch
22URL: http://archive.apache.org/dist/java/jserv/
23BuildRequires: apache1-devel >= 1.3.9-8
24BuildRequires: autoconf
25BuildRequires: automake
26BuildRequires: gettext-tools
27BuildRequires: jdk
28BuildRequires: jpackage-utils
29BuildRequires: rpm-javaprov
30BuildRequires: rpmbuild(macros) >= 1.300
31BuildRequires: sed >= 4.0
32BuildRequires: servlet = 2.0
33Requires(post,preun): rc-scripts
34Requires(pre): /bin/id
35Requires(pre): /usr/bin/getgid
36Requires(pre): /usr/sbin/groupadd
37Requires(pre): /usr/sbin/useradd
38Requires: jpackage-utils
39Requires: jre
40Requires: rc-scripts >= 0.4.0.19
41Requires: servlet = 2.0
42Provides: group(jserv)
43Provides: user(jserv)
44Obsoletes: ApacheJServ-doc
45Obsoletes: ApacheJServ-init
46Obsoletes: jserv
47BuildRoot: %{tmpdir}/%{name}-%{version}-root-%(id -u -n)
48
49%define _pkglibdir %(%{apxs} -q LIBEXECDIR 2>/dev/null)
50%define httpdconf %(%{apxs} -q SYSCONFDIR 2>/dev/null)
51%define _sysconfdir /etc/jserv
52
53%description
54Apache JServ is a servlet engine, developed by the Java Apache Project
55<http://java.apache.org/>. The Apache JServ servlet engine is written
56in 100pc Java application, and listens for servlet requests using the
57Apache Java protocol (AJp). Typically, these requests will originate
58from the mod_jserv Apache module (DSO included).
59
60%description -l pl.UTF-8
61Apache JServ jest silnikiem serwletowym, rozwijanym przez Java Apache
62Project <http://java.apache.org/>. Silnik serwletowy Apache JServ
63został napisany od początku do końca w Javie; nasłuchuje wywołań
64serwletu wykorzystując protokół Apache Java (AJp). Zazwyczaj wywołania
65te pochodzą z modułu Apache mod_jservmodule (łącznie z DSO).
66
67%package -n apache1-mod_jserv
68Summary: JServ module for Apache
69Summary(pl.UTF-8): Moduł JServ dla Apache'a
70Group: Networking/Daemons
71Requires: apache1-base >= 1.3.33-2
72Obsoletes: ApacheJServ-auto
73
74%description -n apache1-mod_jserv
75JServ module for Apache.
76
77%description -n apache1-mod_jserv -l pl.UTF-8
78Moduł JServ dla Apache'a.
79
80%prep
81%setup -q
82%patch0 -p0
83%patch1 -p0
84%patch2 -p1
85%patch3 -p1
86%patch4 -p1
87
88# servlet-2.0 is the highest version the jserv code compiles with
89servlet_jar=$(find-jar servlet-2.0)
90%{__sed} -i -e "
91 s|@JSDK_CLASSES@|$servlet_jar|g
92 s|@JAVA@|%java|g
93" conf/jserv.properties.in
94
95# do not load module in provided jserv.conf; we do this in httpd.conf
96%{__sed} -i -e 's|@LOAD_OR_NOT@|#|g' conf/jserv.conf.in
97
98# we don't want gcj related deps
99%{__sed} -i -e '/^SUBDIRS/s,java,,' src/Makefile.am
100%{__sed} -i -e '/^SUBDIRS/s,example,,' Makefile.am
101
102%build
103export JAVA_HOME="%{java_home}"
104if [ ! -f _autotools.stamp ]; then
105 %{__gettextize}
106 %{__libtoolize}
107 %{__aclocal}
108 %{__autoconf}
109 %{__automake}
110 touch _autotools.stamp
111fi
112
113### JSERV
114CFLAGS="$(%{apxs} -q CFLAGS) %{rpmcflags}"
115dir=$(pwd)
116%configure \
117 %{!?debug:--disable-debugging} \
118 --with-apxs=%{apxs} \
119 --with-logdir=/var/log/jserv \
120 --with-servlets=%{_datadir}/jserv/servlets \
121 --with-java-platform=1.4 \
122 --with-JSDK=$(find-jar servlet-2.0) \
123 %{!?with_gcj:GCJ=javac GCJFLAGS= CLASSPATH=$dir JAVAC_OPT="-source 1.4"} \
124 %{!?with_gcj:--with-javac=%{javac} --with-java=%{java} --with-jdk-home=$JAVA_HOME} \
125 %{?with_gcj:--with-javac=%{_bindir}/gcj --with-jar=%{_bindir}/fastjar} \
126
127%{__make} %{!?with_gcj:OBJEXT=class JAVAC_OPT='-source 1.4'} \
128 -C src/java
129%{__make}
130
131%install
132rm -rf $RPM_BUILD_ROOT
133install -d $RPM_BUILD_ROOT{/etc/{sysconfig,rc.d/init.d},%{httpdconf}/conf.d,%{_javadir},%{_sbindir}}
134
135install %{SOURCE2} $RPM_BUILD_ROOT%{httpdconf}/conf.d/80_mod_jserv.conf
136install %{SOURCE3} $RPM_BUILD_ROOT/etc/rc.d/init.d/jserv
137install %{SOURCE4} $RPM_BUILD_ROOT/etc/sysconfig/jserv
138install %{SOURCE5} $RPM_BUILD_ROOT%{_sbindir}
139
140%{__make} install \
141 DESTDIR=$RPM_BUILD_ROOT
142
143# we removed java from SUBDIRS, so do it manually
144%{__make} install \
145 %{!?with_gcj:OBJEXT=class JAVAC_OPT='-source 1.4'} \
146 -C src/java \
147 DESTDIR=$RPM_BUILD_ROOT
148
149> $RPM_BUILD_ROOT%{httpdconf}/jserv.secret.key
150> $RPM_BUILD_ROOT%{_sysconfdir}/jserv.secret.key
151
152install -d $RPM_BUILD_ROOT%{_datadir}/jserv/servlets
153
154# duplicate
155rm -f $RPM_BUILD_ROOT%{_sysconfdir}/jserv.conf
156rm -rf $RPM_BUILD_ROOT%{_prefix}/docs
157
158%clean
159rm -rf $RPM_BUILD_ROOT
160
161%pre
162%groupadd -g 154 jserv
163%useradd -u 154 -g jserv -d /etc/jserv -c "JServ User" jserv
164
165%post
166if [ ! -s %{_sysconfdir}/jserv.secret.key ]; then
167 if [ -s %{httpdconf}/jserv.secret.key ]; then
168 cat %{httpdconf}/jserv.secret.key > %{_sysconfdir}/jserv.secret.key
169 else
170 dd if=/dev/urandom bs=1 count=42 2>/dev/null \
171 | (md5sum 2>/dev/null || cat) > %{_sysconfdir}/jserv.secret.key
172 fi
173fi
174/sbin/chkconfig --add jserv
175%service jserv restart "Apache JServ Daemon"
176
177%preun
178if [ "$1" = 0 ]; then
179 %service jserv stop
180 /sbin/chkconfig --del jserv
181fi
182
183%postun
184if [ "$1" = "0" ]; then
185 %userremove jserv
186 %groupremove jserv
187fi
188
189%post -n apache1-mod_jserv
190if [ ! -s %{httpdconf}/jserv.secret.key ]; then
191 if [ -s %{_sysconfdir}/jserv.secret.key ]; then
192 cat %{_sysconfdir}/jserv.secret.key > %{httpdconf}/jserv.secret.key
193 else
194 dd if=/dev/urandom bs=1 count=42 2>/dev/null \
195 | (md5sum 2>/dev/null || cat) > %{httpdconf}/jserv.secret.key
196 fi
197fi
198%service -q apache restart
199
200%postun -n apache1-mod_jserv
201if [ "$1" = "0" ]; then
202 %service -q apache restart
203fi
204
205%files
206%defattr(644,root,root,755)
207%doc LICENSE README
208%doc index.html docs
209%dir %attr(750,root,jserv) %{_sysconfdir}
210%attr(640,root,jserv) %config(noreplace) %verify(not md5 mtime size) %{_sysconfdir}/jserv.secret.key
211%attr(640,root,jserv) %config(noreplace) %verify(not md5 mtime size) %{_sysconfdir}/jserv.properties
212%attr(640,root,jserv) %config(noreplace) %verify(not md5 mtime size) %{_sysconfdir}/zone.properties
213%attr(754,root,root) /etc/rc.d/init.d/jserv
214%attr(755,root,root) %{_sbindir}/runjserv
215%config(noreplace) %verify(not md5 mtime size) /etc/sysconfig/jserv
216%{_javadir}/ApacheJServ.jar
217%dir %{_datadir}/jserv
218%dir %attr(750,root,jserv) %{_datadir}/jserv/servlets
219%attr(770,root,jserv) %dir /var/log/jserv
220
221%files -n apache1-mod_jserv
222%defattr(644,root,root,755)
223%attr(755,root,root) %{_pkglibdir}/mod_jserv.so
224%attr(640,root,root) %config(noreplace) %verify(not md5 mtime size) %{httpdconf}/conf.d/80_mod_jserv.conf
225%attr(640,root,http) %config(noreplace) %verify(not md5 mtime size) %{httpdconf}/jserv.secret.key
This page took 0.033231 seconds and 4 git commands to generate.