4 %define apxs /usr/sbin/apxs
5 Summary: Apache module: bandwidth limits
6 Summary(pl.UTF-8): Moduł do Apache: limity pasma
7 Name: apache-mod_%{mod_name}
11 Group: Networking/Daemons/HTTP
12 Source0: http://ivn.cl/files/source/mod_bw-%{version}.tgz
13 # Source0-md5: 90f5e632dad5de8d49dcdb61453dcf97
15 Source2: %{name}.tmpfiles
16 Patch0: mod_bw-apache24.patch
17 URL: http://www.ivn.cl/apache/
18 BuildRequires: %{apxs}
19 BuildRequires: apache-devel >= 2.0.0
20 BuildRequires: rpmbuild(macros) >= 1.268
21 BuildRequires: sed >= 4.0
22 Requires: apache(modules-api) = %apache_modules_api
25 BuildRoot: %{tmpdir}/%{name}-%{version}-root-%(id -u -n)
27 %define _pkglibdir %(%{apxs} -q LIBEXECDIR 2>/dev/null)
28 %define _sysconfdir %(%{apxs} -q SYSCONFDIR 2>/dev/null)/conf.d
31 "Mod_bandwidth" is a module for the Apache webserver that enable the
32 setting of server-wide or per connection bandwidth limits, based on
33 the directory, size of files and remote IP/domain.
35 %description -l pl.UTF-8
36 Moduł pozwalający na ograniczanie pasma serwera Apache bazując na
37 katalogu, wielkości plików lub zdalnym IP/domenie.
47 rm -rf $RPM_BUILD_ROOT
48 install -d $RPM_BUILD_ROOT{%{_pkglibdir},%{_sysconfdir}} \
49 $RPM_BUILD_ROOT%{_var}/run/%{name}/{link,master} \
50 $RPM_BUILD_ROOT{/etc/cron.d,%{_sbindir}} \
51 $RPM_BUILD_ROOT/usr/lib/tmpfiles.d
53 install -p .libs/mod_bw.so $RPM_BUILD_ROOT%{_pkglibdir}/mod_%{mod_name}.so
54 cp -p %{SOURCE1} $RPM_BUILD_ROOT%{_sysconfdir}/97_mod_%{mod_name}.conf
55 install %{SOURCE2} $RPM_BUILD_ROOT/usr/lib/tmpfiles.d/%{name}.conf
58 rm -rf $RPM_BUILD_ROOT
61 %service -q httpd restart
64 if [ "$1" = "0" ]; then
65 %service -q httpd restart
69 %defattr(644,root,root,755)
70 %doc mod_bw.txt LICENSE ChangeLog
71 %attr(640,root,root) %config(noreplace) %verify(not md5 mtime size) %{_sysconfdir}/*_mod_%{mod_name}.conf
72 %attr(755,root,root) %{_pkglibdir}/*.so
73 #%config(noreplace) %verify(not size mtime md5) %attr(640,root,root) /etc/cron.d/%{name}
74 #%attr(755,root,root) %{_sbindir}/*
75 /usr/lib/tmpfiles.d/%{name}.conf
76 %attr(750,http,root) %dir %{_var}/run/%{name}
77 %attr(750,http,root) %dir %{_var}/run/%{name}/link
78 %attr(750,http,root) %dir %{_var}/run/%{name}/master