]> git.pld-linux.org Git - packages/apache1-mod_accounting.git/blob - apache1-mod_accounting.spec
- renamed to apache1-*
[packages/apache1-mod_accounting.git] / apache1-mod_accounting.spec
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}
6 Version:        0.5
7 Release:        0.1
8 License:        BSD
9 Group:          Networking/Daemons
10 Source0:        http://dl.sourceforge.net/mod-acct/mod_accounting-%{version}.tar.gz
11 # Source0-md5:  fc045bbdc5ae32241765fea2967a63fb
12 Source1:        %{name}.conf
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
20 Requires:       apache1
21 Obsoletes:      apache-mod_%{mod_name} <= %{version}
22 BuildRoot:      %{tmpdir}/%{name}-%{version}-root-%(id -u -n)
23
24 %define         _pkglibdir      %(%{apxs} -q LIBEXECDIR)
25 %define         _sysconfdir     /etc/apache
26
27 %description
28 mod_accounting is a simple Apache module that can record traffic
29 statistics into a database (bytes in/out per http request)
30
31 %description -l pl
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).
35
36 %prep
37 %setup -q -n mod_%{mod_name}-%{version}
38
39 %build
40 PATH=$PATH:%{_sbindir}
41 %{__make} \
42         APXS=%{apxs} \
43         LIB="%{_includedir}/postgresql %{_includedir}/mysql -lpq -lmysqlclient"
44
45 %install
46 rm -rf $RPM_BUILD_ROOT
47 install -d $RPM_BUILD_ROOT{%{_pkglibdir},%{_sysconfdir}}
48
49 install mod_%{mod_name}.so $RPM_BUILD_ROOT%{_pkglibdir}
50 install %{SOURCE1} $RPM_BUILD_ROOT%{_sysconfdir}/mod_accounting.conf
51
52 %clean
53 rm -rf $RPM_BUILD_ROOT
54
55 %post
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
59 fi
60 if [ -f /var/lock/subsys/apache ]; then
61         /etc/rc.d/init.d/apache restart 1>&2
62 fi
63
64 %preun
65 if [ "$1" = "0" ]; then
66         %{apxs} -e -A -n %{mod_name} %{_pkglibdir}/mod_%{mod_name}.so 1>&2
67         umask 027
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
73         fi
74 fi
75
76 %files
77 %defattr(644,root,root,755)
78 %doc README ChangeLog
79 %attr(755,root,root) %{_pkglibdir}/*
This page took 0.068742 seconds and 3 git commands to generate.