4 %define apxs /usr/sbin/apxs
5 Summary: Apache module: bandwidth limits
6 Summary(pl): Modu³ do Apache: limity pasma
7 Name: apache-mod_%{mod_name}
11 Group: Networking/Daemons
12 Source0: http://www.ivn.cl/apache/bw_mod-%{version}.tgz
13 # Source0-md5: 0c92fa6344f487321291a592dbb49856
15 Patch0: %{name}-apr_1.0.patch
16 URL: http://www.ivn.cl/apache/
17 BuildRequires: %{apxs}
18 BuildRequires: apache-devel >= 2.0.0
19 BuildRequires: sed >= 4.0
20 Requires: apache(modules-api) = %apache_modules_api
23 BuildRoot: %{tmpdir}/%{name}-%{version}-root-%(id -u -n)
25 %define _pkglibdir %(%{apxs} -q LIBEXECDIR 2>/dev/null)
26 %define _sysconfdir %(%{apxs} -q SYSCONFDIR 2>/dev/null)
29 "Mod_bandwidth" is a module for the Apache webserver that enable the
30 setting of server-wide or per connection bandwidth limits, based on
31 the directory, size of files and remote IP/domain.
34 Modu³ pozwalaj±cy na ograniczanie pasma serwera Apache bazuj±c na
35 katalogu, wielko¶ci plików lub zdalnym IP/domenie.
38 %setup -q -n bw_mod-%{version}
40 sed -i -e 's@include "apr@include "apr/apr@g' bw_mod-%{version}.c
41 sed -i -e 's@^.*apr_buckets.h.*$@@' bw_mod-%{version}.c
44 %{apxs} -c bw_mod-%{version}.c
47 rm -rf $RPM_BUILD_ROOT
48 install -d $RPM_BUILD_ROOT{%{_pkglibdir},%{_sysconfdir}/httpd.conf} \
49 $RPM_BUILD_ROOT%{_var}/run/%{name}/{link,master} \
50 $RPM_BUILD_ROOT{/etc/cron.d,%{_sbindir}}
52 install .libs/bw_mod-%{version}.so $RPM_BUILD_ROOT%{_pkglibdir}/mod_%{mod_name}.so
53 install %{SOURCE1} $RPM_BUILD_ROOT%{_sysconfdir}/httpd.conf/97_mod_%{mod_name}.conf
56 rm -rf $RPM_BUILD_ROOT
59 if [ -f /var/lock/subsys/httpd ]; then
60 /etc/rc.d/init.d/httpd restart 1>&2
64 if [ "$1" = "0" ]; then
65 if [ -f /var/lock/subsys/httpd ]; then
66 /etc/rc.d/init.d/httpd restart 1>&2
71 %defattr(644,root,root,755)
72 %doc bw_mod-%{version}.txt LICENSE
73 %attr(640,root,root) %config(noreplace) %verify(not md5 mtime size) %{_sysconfdir}/httpd.conf/*_mod_%{mod_name}.conf
74 %attr(755,root,root) %{_pkglibdir}/*.so
75 #%config(noreplace) %verify(not size mtime md5) %attr(640,root,root) /etc/cron.d/%{name}
76 #%attr(755,root,root) %{_sbindir}/*
77 %attr(750,http,root) %dir %{_var}/run/%{name}
78 %attr(750,http,root) %dir %{_var}/run/%{name}/link
79 %attr(750,http,root) %dir %{_var}/run/%{name}/master