1 %define mod_name bandwidth
2 %define apxs /usr/sbin/apxs1
3 Summary: Apache module: bandwidth limits
4 Summary(pl): Modu³ do Apache: limity pasma
5 Name: apache1-mod_%{mod_name}
9 Group: Networking/Daemons
10 Source0: ftp://ftp.cohprog.com/pub/apache/module/1.3.0/mod_bandwidth.c
11 # Source0-md5: 00f0905d777f79485beb428b53191ecf
12 # ftp://ftp.cohprog.com/pub/apache/module/cleanlink.pl
13 # modified to work from cron NOT as daemon!
14 Source1: %{name}-cleanlink.pl
16 # http://www.cohprog.com/v3/bandwidth/doc-en.html
17 Source4: %{name}-doc.html
18 URL: http://www.cohprog.com/v3/bandwidth/intro-en.html
19 BuildRequires: %{apxs}
20 BuildRequires: apache1-devel >= 1.3.33-2
21 BuildRequires: rpmbuild(macros) >= 1.268
22 Requires: apache1 >= 1.3.33-2
25 Obsoletes: apache-mod_bandwidth <= 2.0.5
26 BuildRoot: %{tmpdir}/%{name}-%{version}-root-%(id -u -n)
28 %define _pkglibdir %(%{apxs} -q LIBEXECDIR 2>/dev/null)
29 %define _sysconfdir %(%{apxs} -q SYSCONFDIR 2>/dev/null)
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.
45 %{apxs} -c mod_%{mod_name}.c -o mod_%{mod_name}.so
48 rm -rf $RPM_BUILD_ROOT
49 install -d $RPM_BUILD_ROOT{%{_pkglibdir},%{_sysconfdir}/conf.d} \
50 $RPM_BUILD_ROOT%{_var}/run/%{name}/{link,master} \
51 $RPM_BUILD_ROOT{/etc/cron.d,%{_sbindir}}
53 install mod_%{mod_name}.so $RPM_BUILD_ROOT%{_pkglibdir}
54 install %{SOURCE1} $RPM_BUILD_ROOT%{_sbindir}
55 install %{SOURCE2} $RPM_BUILD_ROOT%{_sysconfdir}/conf.d/90_mod_%{mod_name}.conf
58 echo '* * * * * http %{_sbindir}/%{name}-cleanlink.pl' > \
59 $RPM_BUILD_ROOT/etc/cron.d/%{name}
62 rm -rf $RPM_BUILD_ROOT
65 %service -q apache restart
68 if [ "$1" = "0" ]; then
69 %service -q apache restart
73 %defattr(644,root,root,755)
75 %attr(640,root,root) %config(noreplace) %verify(not md5 mtime size) %{_sysconfdir}/conf.d/*_mod_%{mod_name}.conf
76 %config(noreplace) %verify(not md5 mtime size) %attr(640,root,root) /etc/cron.d/%{name}
77 %attr(755,root,root) %{_sbindir}/*
78 %attr(755,root,root) %{_pkglibdir}/*
79 %attr(750,http,root) %dir %{_var}/run/%{name}
80 %attr(750,http,root) %dir %{_var}/run/%{name}/link
81 %attr(750,http,root) %dir %{_var}/run/%{name}/master