1 %define mod_name accounting
2 %define apxs %{_sbindir}/apxs1
3 Summary: Apache module: record traffic statistics into a database
4 Summary(pl): Modu³ do apache: zapisuje statystyki ruchu do bazy danych
5 Name: apache1-mod_%{mod_name}
9 Group: Networking/Daemons
10 Source0: http://dl.sourceforge.net/mod-acct/mod_accounting-%{version}.tar.gz
11 # Source0-md5: fc045bbdc5ae32241765fea2967a63fb
13 URL: http://sourceforge.net/projects/mod-acct/
14 BuildRequires: apache1-devel
15 BuildRequires: mysql-devel
16 BuildRequires: postgresql-devel
17 Requires(post,preun): %{apxs}
18 Requires(post,preun): grep
19 Requires(preun): fileutils
21 Obsoletes: apache-mod_%{mod_name} <= %{version}
22 BuildRoot: %{tmpdir}/%{name}-%{version}-root-%(id -u -n)
24 %define _pkglibdir %(%{apxs} -q LIBEXECDIR)
25 %define _sysconfdir /etc/apache
28 mod_accounting is a simple Apache module that can record traffic
29 statistics into a database (bytes in/out per http request)
32 mod_accounting to prosty modu³ Apache pozwalaj±cy na zapisywanie
33 informacji o ruchu http do bazy danych (bajty
34 przychodz±ce/wychodz±ce).
37 %setup -q -n mod_%{mod_name}-%{version}
40 PATH=$PATH:%{_sbindir}
43 LIB="%{_includedir}/postgresql %{_includedir}/mysql -lpq -lmysqlclient"
46 rm -rf $RPM_BUILD_ROOT
47 install -d $RPM_BUILD_ROOT{%{_pkglibdir},%{_sysconfdir}}
49 install mod_%{mod_name}.so $RPM_BUILD_ROOT%{_pkglibdir}
50 install %{SOURCE1} $RPM_BUILD_ROOT%{_sysconfdir}/mod_accounting.conf
53 rm -rf $RPM_BUILD_ROOT
56 %{apxs} -e -a -n %{mod_name} %{_pkglibdir}/mod_%{mod_name}.so 1>&2
57 if [ -f /etc/apache/apache.conf ] && ! grep -q "^Include.*mod_accounting.conf" /etc/apache/apache.conf; then
58 echo "Include /etc/apache/mod_accounting.conf" >> /etc/apache/apache.conf
60 if [ -f /var/lock/subsys/apache ]; then
61 /etc/rc.d/init.d/apache restart 1>&2
65 if [ "$1" = "0" ]; then
66 %{apxs} -e -A -n %{mod_name} %{_pkglibdir}/mod_%{mod_name}.so 1>&2
68 grep -v "^Include.*mod_accounting.conf" /etc/apache/apache.conf > \
69 /etc/apache/apache.conf.tmp
70 mv -f /etc/apache/apache.conf.tmp /etc/apache/apache.conf
71 if [ -f /var/lock/subsys/apache ]; then
72 /etc/rc.d/init.d/apache restart 1>&2
77 %defattr(644,root,root,755)
79 %attr(755,root,root) %{_pkglibdir}/*