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