diff options
author | Elan Ruusamäe | 2005-01-05 00:28:43 (GMT) |
---|---|---|
committer | cvs2git | 2012-06-24 12:13:13 (GMT) |
commit | 27c146b77fc386a09ceccf15b2f35b6d682f4e58 (patch) | |
tree | 99fae15bacd4acaf8816400cd3781f074040d34c | |
parent | 7f3845193d7d308467952696669a19bc5700b195 (diff) | |
download | apache1-mod_rpaf-27c146b77fc386a09ceccf15b2f35b6d682f4e58.zip apache1-mod_rpaf-27c146b77fc386a09ceccf15b2f35b6d682f4e58.tar.gz |
- new
Changed files:
apache1-mod_rpaf.spec -> 1.1
-rw-r--r-- | apache1-mod_rpaf.spec | 71 |
1 files changed, 71 insertions, 0 deletions
diff --git a/apache1-mod_rpaf.spec b/apache1-mod_rpaf.spec new file mode 100644 index 0000000..96c8dee --- /dev/null +++ b/apache1-mod_rpaf.spec @@ -0,0 +1,71 @@ +# TODO +# - compile fails when apache1 is compiled with ipv6 +%define mod_name rpaf +%define apxs %{_sbindir}/apxs1 +Summary: Apache module: record traffic statistics into a database +Name: apache1-mod_%{mod_name} +Version: 0.5 +Release: 0.3 +License: Apache +Group: Networking/Daemons +Source0: http://stderr.net/apache/rpaf/download/mod_%{mod_name}-%{version}.tar.gz +# Source0-md5: 471fb059d6223a394f319b7c8ab45c4d +Source1: %{name}.conf +URL: http://stderr.net/apache/rpaf/ +BuildRequires: apache1-devel +Requires(post,preun): %{apxs} +Requires(post,preun): grep +Requires: apache1 +BuildRoot: %{tmpdir}/%{name}-%{version}-root-%(id -u -n) + +%define _pkglibdir %(%{apxs} -q LIBEXECDIR 2>/dev/null) +%define _sysconfdir %(%{apxs} -q SYSCONFDIR 2>/dev/null) + +%description +rpaf is for backend Apache servers what mod_proxy_add_forward is for +frontend Apache servers. It does excactly the opposite of +mod_proxy_add_forward written by Ask Bjørn Hansen. It will also work +with mod_proxy in Apache starting with release 1.3.25 + +%prep +%setup -q -n mod_%{mod_name}-%{version} + +%build +%{apxs} -c mod_%{mod_name}.c -o mod_%{mod_name}.so + +%install +rm -rf $RPM_BUILD_ROOT +install -d $RPM_BUILD_ROOT{%{_pkglibdir},%{_sysconfdir}} + +install mod_%{mod_name}.so $RPM_BUILD_ROOT%{_pkglibdir} +install %{SOURCE1} $RPM_BUILD_ROOT%{_sysconfdir}/mod_%{mod_name}.conf + +%clean +rm -rf $RPM_BUILD_ROOT + +%post +%{apxs} -e -a -n %{mod_name} %{_pkglibdir}/mod_%{mod_name}.so 1>&2 +if [ -f /etc/apache/apache.conf ] && ! grep -q "^Include.*mod_%{mod_name}.conf" /etc/apache/apache.conf; then + echo "Include /etc/apache/mod_%{mod_name}.conf" >> /etc/apache/apache.conf +fi +if [ -f /var/lock/subsys/apache ]; then + /etc/rc.d/init.d/apache restart 1>&2 +fi + +%preun +if [ "$1" = "0" ]; then + %{apxs} -e -A -n %{mod_name} %{_pkglibdir}/mod_%{mod_name}.so 1>&2 + umask 027 + grep -v "^Include.*mod_%{mod_name}.conf" /etc/apache/apache.conf > \ + /etc/apache/apache.conf.tmp + mv -f /etc/apache/apache.conf.tmp /etc/apache/apache.conf + if [ -f /var/lock/subsys/apache ]; then + /etc/rc.d/init.d/apache restart 1>&2 + fi +fi + +%files +%defattr(644,root,root,755) +%doc README CHANGES test.pl +%attr(640,root,root) %config(noreplace) %verify(not size mtime md5) %{_sysconfdir}/mod_*.conf +%attr(755,root,root) %{_pkglibdir}/* |