]> git.pld-linux.org Git - packages/ApacheJServ.git/blame_incremental - ApacheJServ.spec
- R: jpackage-utils for %{_javadir}
[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: 5
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
21URL: http://archive.apache.org/dist/java/jserv/
22BuildRequires: apache1-devel >= 1.3.9-8
23BuildRequires: autoconf
24BuildRequires: automake
25BuildRequires: gettext-devel
26BuildRequires: jdk
27BuildRequires: jpackage-utils
28BuildRequires: rpm-javaprov
29BuildRequires: rpmbuild(macros) >= 1.300
30BuildRequires: sed >= 4.0
31BuildRequires: servlet = 2.0
32Requires(post,preun): rc-scripts
33Requires(pre): /bin/id
34Requires(pre): /usr/bin/getgid
35Requires(pre): /usr/sbin/groupadd
36Requires(pre): /usr/sbin/useradd
37Requires: jpackage-utils
38Requires: jre
39Requires: rc-scripts >= 0.4.0.19
40Requires: servlet = 2.0
41Provides: group(jserv)
42Provides: user(jserv)
43Obsoletes: ApacheJServ-doc
44Obsoletes: ApacheJServ-init
45Obsoletes: jserv
46BuildRoot: %{tmpdir}/%{name}-%{version}-root-%(id -u -n)
47
48%define _pkglibdir %(%{apxs} -q LIBEXECDIR 2>/dev/null)
49%define httpdconf %(%{apxs} -q SYSCONFDIR 2>/dev/null)
50%define _sysconfdir /etc/jserv
51%define _noautocompressdoc package-list
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
87# servlet-2.0 is the highest version the jserv code compiles with
88sed -i -e "
89 s|@JSDK_CLASSES@|$(find-jar servlet-2.0)|g
90 s|@JAVA@|%java|g
91" conf/jserv.properties.in
92
93# do not load module in provided jserv.conf; we do this in httpd.conf
94sed -i -e 's|@LOAD_OR_NOT@|#|g' conf/jserv.conf.in
95
96# we don't want gcj related deps
97sed -i -e '/^SUBDIRS/s,java,,' src/Makefile.am
98sed -i -e '/^SUBDIRS/s,example,,' Makefile.am
99
100%build
101export JAVA_HOME="%{java_home}"
102if [ ! -f _autotools.stamp ]; then
103 %{__gettextize}
104 %{__libtoolize}
105 %{__aclocal}
106 %{__autoconf}
107 %{__automake}
108 touch _autotools.stamp
109fi
110
111### JSERV
112CFLAGS="$(%{apxs} -q CFLAGS) %{rpmcflags}"
113dir=$(pwd)
114%configure \
115 %{!?debug:--disable-debugging} \
116 --with-apxs=%{apxs} \
117 --with-logdir=/var/log/jserv \
118 --with-servlets=%{_datadir}/jserv/servlets \
119 --with-java-platform=1.4 \
120 --with-JSDK=$(find-jar servlet-2.0) \
121 %{!?with_gcj:GCJ=javac GCJFLAGS= CLASSPATH=$dir JAVAC_OPT="-source 1.4"} \
122 %{!?with_gcj:--with-javac=%{javac} --with-java=%{java} --with-jdk-home=$JAVA_HOME} \
123 %{?with_gcj:--with-javac=%{_bindir}/gcj --with-jar=%{_bindir}/fastjar} \
124
125%{__make} %{!?with_gcj:OBJEXT=class JAVAC_OPT='-source 1.4'} \
126 -C src/java
127%{__make}
128
129%install
130rm -rf $RPM_BUILD_ROOT
131install -d $RPM_BUILD_ROOT{/etc/{sysconfig,rc.d/init.d},%{httpdconf}/conf.d,%{_javadir},%{_sbindir}}
132
133install %{SOURCE2} $RPM_BUILD_ROOT%{httpdconf}/conf.d/80_mod_jserv.conf
134install %{SOURCE3} $RPM_BUILD_ROOT/etc/rc.d/init.d/jserv
135install %{SOURCE4} $RPM_BUILD_ROOT/etc/sysconfig/jserv
136install %{SOURCE5} $RPM_BUILD_ROOT%{_sbindir}
137
138%{__make} install \
139 DESTDIR=$RPM_BUILD_ROOT
140
141# we removed java from SUBDIRS, so do it manually
142%{__make} install \
143 %{!?with_gcj:OBJEXT=class JAVAC_OPT='-source 1.4'} \
144 -C src/java \
145 DESTDIR=$RPM_BUILD_ROOT
146
147> $RPM_BUILD_ROOT%{httpdconf}/jserv.secret.key
148> $RPM_BUILD_ROOT%{_sysconfdir}/jserv.secret.key
149
150install -d $RPM_BUILD_ROOT%{_datadir}/jserv/servlets
151
152# duplicate
153rm -f $RPM_BUILD_ROOT%{_sysconfdir}/jserv.conf
154rm -rf $RPM_BUILD_ROOT%{_prefix}/docs
155
156%clean
157rm -rf $RPM_BUILD_ROOT
158
159%pre
160%groupadd -g 154 jserv
161%useradd -u 154 -g jserv -d /etc/jserv -c "JServ User" jserv
162
163%post
164if [ ! -s %{_sysconfdir}/jserv.secret.key ]; then
165 if [ -s %{httpdconf}/jserv.secret.key ]; then
166 cat %{httpdconf}/jserv.secret.key > %{_sysconfdir}/jserv.secret.key
167 else
168 dd if=/dev/urandom bs=1 count=42 2>/dev/null \
169 | (md5sum 2>/dev/null || cat) > %{_sysconfdir}/jserv.secret.key
170 fi
171fi
172/sbin/chkconfig --add jserv
173%service jserv restart "Apache JServ Daemon"
174
175%preun
176if [ "$1" = 0 ]; then
177 %service jserv stop
178 /sbin/chkconfig --del jserv
179fi
180
181%postun
182if [ "$1" = "0" ]; then
183 %userremove jserv
184 %groupremove jserv
185fi
186
187%post -n apache1-mod_jserv
188if [ ! -s %{httpdconf}/jserv.secret.key ]; then
189 if [ -s %{_sysconfdir}/jserv.secret.key ]; then
190 cat %{_sysconfdir}/jserv.secret.key > %{httpdconf}/jserv.secret.key
191 else
192 dd if=/dev/urandom bs=1 count=42 2>/dev/null \
193 | (md5sum 2>/dev/null || cat) > %{httpdconf}/jserv.secret.key
194 fi
195fi
196%service -q apache restart
197
198%postun -n apache1-mod_jserv
199if [ "$1" = "0" ]; then
200 %service -q apache restart
201fi
202
203%files
204%defattr(644,root,root,755)
205%doc LICENSE README
206%doc index.html docs
207%dir %attr(750,root,jserv) %{_sysconfdir}
208%attr(640,root,jserv) %config(noreplace) %verify(not md5 mtime size) %{_sysconfdir}/jserv.secret.key
209%attr(640,root,jserv) %config(noreplace) %verify(not md5 mtime size) %{_sysconfdir}/jserv.properties
210%attr(640,root,jserv) %config(noreplace) %verify(not md5 mtime size) %{_sysconfdir}/zone.properties
211%attr(754,root,root) /etc/rc.d/init.d/jserv
212%attr(755,root,root) %{_sbindir}/runjserv
213%config(noreplace) %verify(not md5 mtime size) /etc/sysconfig/jserv
214%{_javadir}/ApacheJServ.jar
215%dir %{_datadir}/jserv
216%dir %attr(750,root,jserv) %{_datadir}/jserv/servlets
217%attr(770,root,jserv) %dir /var/log/jserv
218
219%files -n apache1-mod_jserv
220%defattr(644,root,root,755)
221%attr(755,root,root) %{_pkglibdir}/mod_jserv.so
222%attr(640,root,root) %config(noreplace) %verify(not md5 mtime size) %{httpdconf}/conf.d/80_mod_jserv.conf
223%attr(640,root,http) %config(noreplace) %verify(not md5 mtime size) %{httpdconf}/jserv.secret.key
This page took 0.104624 seconds and 4 git commands to generate.