1 %define mod_name bandwidth
2 %define apxs /usr/sbin/apxs
4 Summary: Apache module: bandwidth limits
5 Summary(pl): Modu³ do Apache: limity pasma
6 Name: apache-mod_%{mod_name}
10 Group: Networking/Daemons
11 Source0: http://www.ivn.cl/apache/bw_mod-%{_ver}.tgz
12 # Source0-md5: 0c92fa6344f487321291a592dbb49856
13 #Source0: http://www.ivn.cl/apache/mod_%{mod_name}-%{_version}.tgz
14 #Source1: %{name}.conf
15 URL: http://www.ivn.cl/apache/
16 BuildRequires: apache-devel >= 2.0.0
17 BuildRequires: %{apxs}
18 Requires(post,preun): %{apxs}
19 Requires(post,preun): grep
20 Requires(preun): fileutils
21 Requires: apache >= 2.0.0
24 Obsoletes: apache-mod_%{mod_name} <= %{version}
25 BuildRoot: %{tmpdir}/%{name}-%{version}-root-%(id -u -n)
27 %define _pkglibdir %(%{apxs} -q LIBEXECDIR)
28 %define _sysconfdir %(%{apxs} -q SYSCONFDIR)
31 "Mod_bandwidth" is a module for the Apache webserver that enable the
32 setting of server-wide or per connection bandwidth limits, based on
33 the directory, size of files and remote IP/domain.
36 Modu³ pozwalaj±cy na ograniczanie pasma poprzez serwer Apache bazuj±c
37 na katalogu, wielko¶ci plików oraz zdalnym IP/domenie.
40 #%setup -q -n mod_%{mod_name}-%{version}
41 %setup -q -n bw_mod-0.6
44 perl -pi -e 's@include "apr@include "apr/apr@g' bw_mod-%{_ver}.c
45 perl -pi -e 's@^.*apr_buckets.h.*$@@' bw_mod-%{_ver}.c
46 #%{apxs} -c mod_%{mod_name}-%{version}.c -o mod_%{mod_name}.so
47 %{apxs} -c bw_mod-%{_ver}.c -o mod_%{mod_name}.so
50 rm -rf $RPM_BUILD_ROOT
51 install -d $RPM_BUILD_ROOT{%{_pkglibdir},%{_sysconfdir}} \
52 $RPM_BUILD_ROOT%{_var}/run/%{name}/{link,master} \
53 $RPM_BUILD_ROOT{/etc/cron.d,%{_sbindir}}
55 install mod_%{mod_name}.so $RPM_BUILD_ROOT%{_pkglibdir}
56 #install %{SOURCE1} $RPM_BUILD_ROOT%{_sysconfdir}/mod_%{mod_name}.conf
59 rm -rf $RPM_BUILD_ROOT
62 if [ -f /var/lock/subsys/apache ]; then
63 /etc/rc.d/init.d/apache restart 1>&2
67 if [ "$1" = "0" ]; then
69 if [ -f /var/lock/subsys/apache ]; then
70 /etc/rc.d/init.d/apache restart 1>&2
75 %defattr(644,root,root,755)
77 %attr(640,root,root) %config(noreplace) %verify(not size mtime md5) %{_sysconfdir}/mod_*.conf
78 %config(noreplace) %verify(not size mtime md5) %attr(640,root,root) /etc/cron.d/%{name}
79 %attr(755,root,root) %{_sbindir}/*
80 %attr(755,root,root) %{_pkglibdir}/*
81 %attr(750,http,root) %dir %{_var}/run/%{name}
82 %attr(750,http,root) %dir %{_var}/run/%{name}/link
83 %attr(750,http,root) %dir %{_var}/run/%{name}/master