3 # - rename to apache-mod_bw (it is not the same as apache1-mod_bandwidth)
5 %define mod_name bandwidth
6 %define apxs /usr/sbin/apxs
7 Summary: Apache module: bandwidth limits
8 Summary(pl): Modu³ do Apache: limity pasma
9 Name: apache-mod_%{mod_name}
13 Group: Networking/Daemons
14 Source0: http://www.ivn.cl/apache/bw_mod-%{version}.tgz
15 # Source0-md5: 0c92fa6344f487321291a592dbb49856
17 Patch0: %{name}-apr_1.0.patch
18 URL: http://www.ivn.cl/apache/
19 BuildRequires: apache-devel >= 2.0.0
20 BuildRequires: %{apxs}
21 Requires(post,preun): %{apxs}
22 Requires(post,preun): grep
23 Requires(preun): fileutils
24 Requires: apache >= 2.0.0
27 Obsoletes: apache-mod_%{mod_name} <= %{version}
28 BuildRoot: %{tmpdir}/%{name}-%{version}-root-%(id -u -n)
30 %define _pkglibdir %(%{apxs} -q LIBEXECDIR)
31 %define _sysconfdir %(%{apxs} -q SYSCONFDIR)
34 "Mod_bandwidth" is a module for the Apache webserver that enable the
35 setting of server-wide or per connection bandwidth limits, based on
36 the directory, size of files and remote IP/domain.
39 Modu³ pozwalaj±cy na ograniczanie pasma poprzez serwer Apache bazuj±c
40 na katalogu, wielko¶ci plików oraz zdalnym IP/domenie.
43 %setup -q -n bw_mod-%{version}
47 perl -pi -e 's@include "apr@include "apr/apr@g' bw_mod-%{version}.c
48 perl -pi -e 's@^.*apr_buckets.h.*$@@' bw_mod-%{version}.c
49 %{apxs} -c bw_mod-%{version}.c
50 mv .libs/bw_mod-%{version}.so mod_bandwidth.so
53 rm -rf $RPM_BUILD_ROOT
54 install -d $RPM_BUILD_ROOT{%{_pkglibdir},%{_sysconfdir}} \
55 $RPM_BUILD_ROOT%{_var}/run/%{name}/{link,master} \
56 $RPM_BUILD_ROOT{/etc/cron.d,%{_sbindir},%{_sysconfdir}/httpd.conf}
58 install mod_%{mod_name}.so $RPM_BUILD_ROOT%{_pkglibdir}
59 install %{SOURCE1} $RPM_BUILD_ROOT%{_sysconfdir}/httpd.conf/97_mod_%{mod_name}.conf
62 rm -rf $RPM_BUILD_ROOT
65 if [ -f /var/lock/subsys/apache ]; then
66 /etc/rc.d/init.d/apache restart 1>&2
70 if [ "$1" = "0" ]; then
72 if [ -f /var/lock/subsys/apache ]; then
73 /etc/rc.d/init.d/apache restart 1>&2
78 %defattr(644,root,root,755)
79 %doc bw_mod-%{version}.txt LICENSE
80 %attr(640,root,root) %config(noreplace) %verify(not size mtime md5) %{_sysconfdir}/httpd.conf/*mod_*.conf
81 #%config(noreplace) %verify(not size mtime md5) %attr(640,root,root) /etc/cron.d/%{name}
82 #%attr(755,root,root) %{_sbindir}/*
83 %attr(755,root,root) %{_pkglibdir}/*
84 %attr(750,http,root) %dir %{_var}/run/%{name}
85 %attr(750,http,root) %dir %{_var}/run/%{name}/link
86 %attr(750,http,root) %dir %{_var}/run/%{name}/master