]> git.pld-linux.org Git - packages/apache1-mod_accounting.git/blob - apache1-mod_accounting.spec
831beafdad62299261c4dcf7ee6b57121f97c85b
[packages/apache1-mod_accounting.git] / apache1-mod_accounting.spec
1 %define         mod_name        accounting
2 %define         apxs            %{_sbindir}/apxs
3 Summary:        Apache module: record traffic statistics into a database
4 Summary(pl):    Modu³ do apache: zapisuje statystyki ruchu do bazy danych
5 Name:           apache-mod_%{mod_name}
6 Version:        0.4
7 Release:        2
8 License:        BSD
9 Group:          Networking/Daemons
10 Source0:        http://prdownloads.sourceforge.net/mod-acct/mod_accounting-%{version}.tar.gz
11 Source1:        %{name}.conf
12 URL:            http://sourceforge.net/projects/mod-acct/
13 BuildRequires:  apache(EAPI)-devel
14 BuildRequires:  mysql-devel
15 BuildRequires:  postgresql-devel
16 Prereq:         %{_sbindir}/apxs
17 Requires:       apache(EAPI)
18 BuildRoot:      %{tmpdir}/%{name}-%{version}-root-%(id -u -n)
19
20 %define         _pkglibdir      %(%{apxs} -q LIBEXECDIR)
21 %define         _sysconfdir     /etc/httpd
22
23 %description
24 mod_accounting is a simple Apache module that can record traffic
25 statistics into a database (bytes in/out per http request)
26
27 %description -l pl
28 mod_accounting to prosty modu³ Apache pozwalaj±cy na zapisywanie
29 informacji o ruchu http do bazy danych (bajty
30 przychodz±ce/wychodz±ce).
31
32 %prep
33 %setup -q -n mod_%{mod_name}-%{version}
34
35 %build
36 PATH=$PATH:%{_sbindir}
37 %{__make}
38
39 %install
40 rm -rf $RPM_BUILD_ROOT
41 install -d $RPM_BUILD_ROOT{%{_pkglibdir},%{_sysconfdir}}
42
43 install mod_%{mod_name}.so $RPM_BUILD_ROOT%{_pkglibdir}
44 install %{SOURCE1} $RPM_BUILD_ROOT%{_sysconfdir}/mod_accounting.conf
45
46 gzip -9nf README ChangeLog
47
48 %post
49 %{_sbindir}/apxs -e -a -n %{mod_name} %{_pkglibdir}/mod_%{mod_name}.so 1>&2
50 if [ -f /etc/httpd/httpd.conf ] && ! grep -q "^Include.*mod_accounting.conf" /etc/httpd/httpd.conf; then
51         echo "Include /etc/httpd/mod_accounting.conf" >> /etc/httpd/httpd.conf
52 fi
53 if [ -f /var/lock/subsys/httpd ]; then
54         /etc/rc.d/init.d/httpd restart 1>&2
55 fi
56
57 %preun
58 if [ "$1" = "0" ]; then
59         %{_sbindir}/apxs -e -A -n %{mod_name} %{_pkglibdir}/mod_%{mod_name}.so 1>&2
60         grep -v "^Include.*mod_accounting.conf" /etc/httpd/httpd.conf > \
61                 /etc/httpd/httpd.conf.tmp
62         mv -f /etc/httpd/httpd.conf.tmp /etc/httpd/httpd.conf
63         if [ -f /var/lock/subsys/httpd ]; then
64                 /etc/rc.d/init.d/httpd restart 1>&2
65         fi
66 fi
67
68 %clean
69 rm -rf $RPM_BUILD_ROOT
70
71 %files
72 %defattr(644,root,root,755)
73 %doc *.gz
74 %attr(755,root,root) %{_pkglibdir}/*
This page took 0.030846 seconds and 3 git commands to generate.