BuildRequires: apache(EAPI)-devel
BuildRequires: mysql-devel
BuildRequires: postgresql-devel
-Prereq: %{_sbindir}/apxs
+Requires(post,preun): %{apxs}
+Requires(post,preun): grep
+Requires(preun): fileutils
Requires: apache(EAPI)
BuildRoot: %{tmpdir}/%{name}-%{version}-root-%(id -u -n)
install mod_%{mod_name}.so $RPM_BUILD_ROOT%{_pkglibdir}
install %{SOURCE1} $RPM_BUILD_ROOT%{_sysconfdir}/mod_accounting.conf
+%clean
+rm -rf $RPM_BUILD_ROOT
+
%post
%{apxs} -e -a -n %{mod_name} %{_pkglibdir}/mod_%{mod_name}.so 1>&2
if [ -f /etc/httpd/httpd.conf ] && ! grep -q "^Include.*mod_accounting.conf" /etc/httpd/httpd.conf; then
%preun
if [ "$1" = "0" ]; then
%{apxs} -e -A -n %{mod_name} %{_pkglibdir}/mod_%{mod_name}.so 1>&2
+ umask 027
grep -v "^Include.*mod_accounting.conf" /etc/httpd/httpd.conf > \
/etc/httpd/httpd.conf.tmp
mv -f /etc/httpd/httpd.conf.tmp /etc/httpd/httpd.conf
fi
fi
-%clean
-rm -rf $RPM_BUILD_ROOT
-
%files
%defattr(644,root,root,755)
%doc README ChangeLog