4 %define mod_name bandwidth
5 %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-%{_ver}.tgz
15 # Source0-md5: 0c92fa6344f487321291a592dbb49856
16 #Source0: http://www.ivn.cl/apache/mod_%{mod_name}-%{_version}.tgz
17 #Source1: %{name}.conf
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 mod_%{mod_name}-%{version}
44 %setup -q -n bw_mod-0.6
47 perl -pi -e 's@include "apr@include "apr/apr@g' bw_mod-%{_ver}.c
48 perl -pi -e 's@^.*apr_buckets.h.*$@@' bw_mod-%{_ver}.c
49 #%{apxs} -c mod_%{mod_name}-%{version}.c -o mod_%{mod_name}.so
50 %{apxs} -c bw_mod-%{_ver}.c
51 mv .libs/bw_mod-0.6.so mod_bandwidth.so
54 rm -rf $RPM_BUILD_ROOT
55 install -d $RPM_BUILD_ROOT{%{_pkglibdir},%{_sysconfdir}} \
56 $RPM_BUILD_ROOT%{_var}/run/%{name}/{link,master} \
57 $RPM_BUILD_ROOT{/etc/cron.d,%{_sbindir}}
59 install mod_%{mod_name}.so $RPM_BUILD_ROOT%{_pkglibdir}
60 #install %{SOURCE1} $RPM_BUILD_ROOT%{_sysconfdir}/mod_%{mod_name}.conf
63 rm -rf $RPM_BUILD_ROOT
66 if [ -f /var/lock/subsys/apache ]; then
67 /etc/rc.d/init.d/apache restart 1>&2
71 if [ "$1" = "0" ]; then
73 if [ -f /var/lock/subsys/apache ]; then
74 /etc/rc.d/init.d/apache restart 1>&2
79 %defattr(644,root,root,755)
82 #%attr(640,root,root) %config(noreplace) %verify(not size mtime md5) %{_sysconfdir}/mod_*.conf
83 %config(noreplace) %verify(not size mtime md5) %attr(640,root,root) /etc/cron.d/%{name}
84 %attr(755,root,root) %{_sbindir}/*
85 %attr(755,root,root) %{_pkglibdir}/*
86 %attr(750,http,root) %dir %{_var}/run/%{name}
87 %attr(750,http,root) %dir %{_var}/run/%{name}/link
88 %attr(750,http,root) %dir %{_var}/run/%{name}/master