2 # - compile fails when apache1 is compiled with ipv6
4 %define apxs %{_sbindir}/apxs1
5 Summary: Apache module: record traffic statistics into a database
6 Name: apache1-mod_%{mod_name}
10 Group: Networking/Daemons
11 Source0: http://stderr.net/apache/rpaf/download/mod_%{mod_name}-%{version}.tar.gz
12 # Source0-md5: 471fb059d6223a394f319b7c8ab45c4d
14 URL: http://stderr.net/apache/rpaf/
15 BuildRequires: apache1-devel
16 Requires(post,preun): %{apxs}
17 Requires(post,preun): grep
19 BuildRoot: %{tmpdir}/%{name}-%{version}-root-%(id -u -n)
21 %define _pkglibdir %(%{apxs} -q LIBEXECDIR 2>/dev/null)
22 %define _sysconfdir %(%{apxs} -q SYSCONFDIR 2>/dev/null)
25 rpaf is for backend Apache servers what mod_proxy_add_forward is for
26 frontend Apache servers. It does excactly the opposite of
27 mod_proxy_add_forward written by Ask Bjørn Hansen. It will also work
28 with mod_proxy in Apache starting with release 1.3.25
31 %setup -q -n mod_%{mod_name}-%{version}
34 %{apxs} -c mod_%{mod_name}.c -o mod_%{mod_name}.so
37 rm -rf $RPM_BUILD_ROOT
38 install -d $RPM_BUILD_ROOT{%{_pkglibdir},%{_sysconfdir}}
40 install mod_%{mod_name}.so $RPM_BUILD_ROOT%{_pkglibdir}
41 install %{SOURCE1} $RPM_BUILD_ROOT%{_sysconfdir}/mod_%{mod_name}.conf
44 rm -rf $RPM_BUILD_ROOT
47 %{apxs} -e -a -n %{mod_name} %{_pkglibdir}/mod_%{mod_name}.so 1>&2
48 if [ -f /etc/apache/apache.conf ] && ! grep -q "^Include.*mod_%{mod_name}.conf" /etc/apache/apache.conf; then
49 echo "Include /etc/apache/mod_%{mod_name}.conf" >> /etc/apache/apache.conf
51 if [ -f /var/lock/subsys/apache ]; then
52 /etc/rc.d/init.d/apache restart 1>&2
56 if [ "$1" = "0" ]; then
57 %{apxs} -e -A -n %{mod_name} %{_pkglibdir}/mod_%{mod_name}.so 1>&2
59 grep -v "^Include.*mod_%{mod_name}.conf" /etc/apache/apache.conf > \
60 /etc/apache/apache.conf.tmp
61 mv -f /etc/apache/apache.conf.tmp /etc/apache/apache.conf
62 if [ -f /var/lock/subsys/apache ]; then
63 /etc/rc.d/init.d/apache restart 1>&2
68 %defattr(644,root,root,755)
69 %doc README CHANGES test.pl
70 %attr(640,root,root) %config(noreplace) %verify(not size mtime md5) %{_sysconfdir}/mod_*.conf
71 %attr(755,root,root) %{_pkglibdir}/*