]> git.pld-linux.org Git - packages/apache1-mod_rpaf.git/blob - apache1-mod_rpaf.spec
- new
[packages/apache1-mod_rpaf.git] / apache1-mod_rpaf.spec
1 # TODO
2 # - compile fails when apache1 is compiled with ipv6
3 %define         mod_name        rpaf
4 %define         apxs            %{_sbindir}/apxs1
5 Summary:        Apache module: record traffic statistics into a database
6 Name:           apache1-mod_%{mod_name}
7 Version:        0.5
8 Release:        0.3
9 License:        Apache
10 Group:          Networking/Daemons
11 Source0:        http://stderr.net/apache/rpaf/download/mod_%{mod_name}-%{version}.tar.gz
12 # Source0-md5:  471fb059d6223a394f319b7c8ab45c4d
13 Source1:        %{name}.conf
14 URL:            http://stderr.net/apache/rpaf/
15 BuildRequires:  apache1-devel
16 Requires(post,preun):   %{apxs}
17 Requires(post,preun):   grep
18 Requires:       apache1
19 BuildRoot:      %{tmpdir}/%{name}-%{version}-root-%(id -u -n)
20
21 %define         _pkglibdir      %(%{apxs} -q LIBEXECDIR 2>/dev/null)
22 %define         _sysconfdir     %(%{apxs} -q SYSCONFDIR 2>/dev/null)
23
24 %description
25 rpaf is for backend Apache servers what mod_proxy_add_forward is for
26 frontend Apache servers. It does excactly the opposite of
27 mod_proxy_add_forward written by Ask Bjørn Hansen. It will also work
28 with mod_proxy in Apache starting with release 1.3.25
29
30 %prep
31 %setup -q -n mod_%{mod_name}-%{version}
32
33 %build
34 %{apxs} -c mod_%{mod_name}.c -o mod_%{mod_name}.so
35
36 %install
37 rm -rf $RPM_BUILD_ROOT
38 install -d $RPM_BUILD_ROOT{%{_pkglibdir},%{_sysconfdir}}
39
40 install mod_%{mod_name}.so $RPM_BUILD_ROOT%{_pkglibdir}
41 install %{SOURCE1} $RPM_BUILD_ROOT%{_sysconfdir}/mod_%{mod_name}.conf
42
43 %clean
44 rm -rf $RPM_BUILD_ROOT
45
46 %post
47 %{apxs} -e -a -n %{mod_name} %{_pkglibdir}/mod_%{mod_name}.so 1>&2
48 if [ -f /etc/apache/apache.conf ] && ! grep -q "^Include.*mod_%{mod_name}.conf" /etc/apache/apache.conf; then
49         echo "Include /etc/apache/mod_%{mod_name}.conf" >> /etc/apache/apache.conf
50 fi
51 if [ -f /var/lock/subsys/apache ]; then
52         /etc/rc.d/init.d/apache restart 1>&2
53 fi
54
55 %preun
56 if [ "$1" = "0" ]; then
57         %{apxs} -e -A -n %{mod_name} %{_pkglibdir}/mod_%{mod_name}.so 1>&2
58         umask 027
59         grep -v "^Include.*mod_%{mod_name}.conf" /etc/apache/apache.conf > \
60                 /etc/apache/apache.conf.tmp
61         mv -f /etc/apache/apache.conf.tmp /etc/apache/apache.conf
62         if [ -f /var/lock/subsys/apache ]; then
63                 /etc/rc.d/init.d/apache restart 1>&2
64         fi
65 fi
66
67 %files
68 %defattr(644,root,root,755)
69 %doc README CHANGES test.pl
70 %attr(640,root,root) %config(noreplace) %verify(not size mtime md5) %{_sysconfdir}/mod_*.conf
71 %attr(755,root,root) %{_pkglibdir}/*
This page took 0.06254 seconds and 3 git commands to generate.