]>
Commit | Line | Data |
---|---|---|
1 | # TODO | |
2 | # - ipv6 patch not implemented | |
3 | %bcond_without ipv6 # disable IPv6 support | |
4 | ||
5 | %define mod_name accounting | |
6 | %define apxs %{_sbindir}/apxs1 | |
7 | Summary: Apache module: record traffic statistics into a database | |
8 | Summary(pl.UTF-8): Moduł do apache: zapisuje statystyki ruchu do bazy danych | |
9 | Name: apache1-mod_%{mod_name} | |
10 | Version: 0.5 | |
11 | Release: 0.5 | |
12 | License: BSD | |
13 | Group: Networking/Daemons | |
14 | Source0: http://dl.sourceforge.net/mod-acct/mod_accounting-%{version}.tar.gz | |
15 | # Source0-md5: fc045bbdc5ae32241765fea2967a63fb | |
16 | Source1: %{name}.conf | |
17 | URL: http://sourceforge.net/projects/mod-acct/ | |
18 | %{?with_ipv6:BuildRequires: apache1(ipv6)-devel} | |
19 | BuildRequires: apache1-devel >= 1.3.39 | |
20 | BuildRequires: mysql-devel | |
21 | BuildRequires: postgresql-devel | |
22 | BuildRequires: rpmbuild(macros) >= 1.268 | |
23 | %{!?with_ipv6:BuildConflicts: apache1(ipv6)-devel} | |
24 | Requires: apache1 >= 1.3.33-2 | |
25 | Obsoletes: apache-mod_accounting <= 0.5 | |
26 | BuildRoot: %{tmpdir}/%{name}-%{version}-root-%(id -u -n) | |
27 | ||
28 | %define _pkglibdir %(%{apxs} -q LIBEXECDIR 2>/dev/null) | |
29 | %define _sysconfdir %(%{apxs} -q SYSCONFDIR 2>/dev/null) | |
30 | ||
31 | %description | |
32 | mod_accounting is a simple Apache module that can record traffic | |
33 | statistics into a database (bytes in/out per HTTP request) | |
34 | ||
35 | %description -l pl.UTF-8 | |
36 | mod_accounting to prosty moduł Apache pozwalający na zapisywanie | |
37 | informacji o ruchu HTTP do bazy danych (bajty | |
38 | przychodzące/wychodzące). | |
39 | ||
40 | %prep | |
41 | %setup -q -n mod_%{mod_name}-%{version} | |
42 | ||
43 | %build | |
44 | PATH=$PATH:%{_sbindir} | |
45 | %{__make} \ | |
46 | APXS=%{apxs} \ | |
47 | LIB="-L%{_includedir}/postgresql -L%{_includedir}/mysql -lpq -lmysqlclient" | |
48 | ||
49 | %install | |
50 | rm -rf $RPM_BUILD_ROOT | |
51 | install -d $RPM_BUILD_ROOT{%{_pkglibdir},%{_sysconfdir}/conf.d} | |
52 | ||
53 | install mod_%{mod_name}.so $RPM_BUILD_ROOT%{_pkglibdir} | |
54 | install %{SOURCE1} $RPM_BUILD_ROOT%{_sysconfdir}/conf.d/90_mod_%{mod_name}.conf | |
55 | ||
56 | %clean | |
57 | rm -rf $RPM_BUILD_ROOT | |
58 | ||
59 | %post | |
60 | %service -q apache restart | |
61 | ||
62 | %postun | |
63 | if [ "$1" = "0" ]; then | |
64 | %service -q apache restart | |
65 | fi | |
66 | ||
67 | %files | |
68 | %defattr(644,root,root,755) | |
69 | %doc README ChangeLog | |
70 | %attr(640,root,root) %config(noreplace) %verify(not md5 mtime size) %{_sysconfdir}/conf.d/*_mod_%{mod_name}.conf | |
71 | %attr(755,root,root) %{_pkglibdir}/* |