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: apache-devel >= 2.0.0
18 BuildRequires: %{apxs}
19 Requires(post,preun): %{apxs}
20 Requires(post,preun): grep
21 Requires(preun): fileutils
22 Requires: apache >= 2.0.0
25 Obsoletes: apache-mod_%{mod_name} <= %{version}
26 BuildRoot: %{tmpdir}/%{name}-%{version}-root-%(id -u -n)
28 %define _pkglibdir %(%{apxs} -q LIBEXECDIR)
29 %define _sysconfdir %(%{apxs} -q SYSCONFDIR)
32 "Mod_bandwidth" is a module for the Apache webserver that enable the
33 setting of server-wide or per connection bandwidth limits, based on
34 the directory, size of files and remote IP/domain.
37 Modu³ pozwalaj±cy na ograniczanie pasma poprzez serwer Apache bazuj±c
38 na katalogu, wielko¶ci plików oraz zdalnym IP/domenie.
41 %setup -q -n bw_mod-%{version}
45 perl -pi -e 's@include "apr@include "apr/apr@g' bw_mod-%{version}.c
46 perl -pi -e 's@^.*apr_buckets.h.*$@@' bw_mod-%{version}.c
47 %{apxs} -c bw_mod-%{version}.c
48 mv .libs/bw_mod-%{version}.so mod_bw.so
51 rm -rf $RPM_BUILD_ROOT
52 install -d $RPM_BUILD_ROOT{%{_pkglibdir},%{_sysconfdir}} \
53 $RPM_BUILD_ROOT%{_var}/run/%{name}/{link,master} \
54 $RPM_BUILD_ROOT{/etc/cron.d,%{_sbindir},%{_sysconfdir}/httpd.conf}
56 install mod_%{mod_name}.so $RPM_BUILD_ROOT%{_pkglibdir}
57 install %{SOURCE1} $RPM_BUILD_ROOT%{_sysconfdir}/httpd.conf/97_mod_%{mod_name}.conf
60 rm -rf $RPM_BUILD_ROOT
63 if [ -f /var/lock/subsys/apache ]; then
64 /etc/rc.d/init.d/apache restart 1>&2
68 if [ "$1" = "0" ]; then
70 if [ -f /var/lock/subsys/apache ]; then
71 /etc/rc.d/init.d/apache restart 1>&2
76 %defattr(644,root,root,755)
77 %doc bw_mod-%{version}.txt LICENSE
78 %attr(640,root,root) %config(noreplace) %verify(not size mtime md5) %{_sysconfdir}/httpd.conf/*mod_*.conf
79 #%config(noreplace) %verify(not size mtime md5) %attr(640,root,root) /etc/cron.d/%{name}
80 #%attr(755,root,root) %{_sbindir}/*
81 %attr(755,root,root) %{_pkglibdir}/*
82 %attr(750,http,root) %dir %{_var}/run/%{name}
83 %attr(750,http,root) %dir %{_var}/run/%{name}/link
84 %attr(750,http,root) %dir %{_var}/run/%{name}/master