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