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