]>
Commit | Line | Data |
---|---|---|
a5de1fd2 | 1 | # TODO: |
5d474532 | 2 | # - cron? |
ac0fe2df | 3 | %define mod_name bw |
1dd6fe21 | 4 | %define apxs /usr/sbin/apxs |
e44745e2 | 5 | Summary: Apache module: bandwidth limits |
d5c887ee | 6 | Summary(pl.UTF-8): Moduł do Apache: limity pasma |
1dd6fe21 | 7 | Name: apache-mod_%{mod_name} |
435796e2 | 8 | Version: 0.6 |
9da792dd | 9 | Release: 3 |
e44745e2 JB |
10 | License: Apache |
11 | Group: Networking/Daemons | |
cd77293e | 12 | Source0: http://www.ivn.cl/apache/bw_mod-%{version}.tgz |
435796e2 | 13 | # Source0-md5: 0c92fa6344f487321291a592dbb49856 |
0511ec6d | 14 | Source1: %{name}.conf |
e339b99b | 15 | Patch0: %{name}-apr_1.0.patch |
1dd6fe21 | 16 | URL: http://www.ivn.cl/apache/ |
91c4c31e | 17 | BuildRequires: apache-apxs >= 2.0 |
b9a8f100 | 18 | BuildRequires: apache-devel >= 2.0.0 |
b2f4d847 | 19 | BuildRequires: rpmbuild(macros) >= 1.268 |
6fc9aff3 ER |
20 | BuildRequires: sed >= 4.0 |
21 | Requires: apache(modules-api) = %apache_modules_api | |
348c5ac8 | 22 | Requires: crondaemon |
e44745e2 JB |
23 | Requires: procps |
24 | BuildRoot: %{tmpdir}/%{name}-%{version}-root-%(id -u -n) | |
25 | ||
6fc9aff3 ER |
26 | %define _pkglibdir %(%{apxs} -q LIBEXECDIR 2>/dev/null) |
27 | %define _sysconfdir %(%{apxs} -q SYSCONFDIR 2>/dev/null) | |
e44745e2 JB |
28 | |
29 | %description | |
30 | "Mod_bandwidth" is a module for the Apache webserver that enable the | |
31 | setting of server-wide or per connection bandwidth limits, based on | |
32 | the directory, size of files and remote IP/domain. | |
33 | ||
c944853d JR |
34 | %description -l pl.UTF-8 |
35 | Moduł pozwalający na ograniczanie pasma serwera Apache bazując na | |
36 | katalogu, wielkości plików lub zdalnym IP/domenie. | |
e44745e2 JB |
37 | |
38 | %prep | |
cd77293e | 39 | %setup -q -n bw_mod-%{version} |
e339b99b | 40 | %patch0 -p1 |
6fc9aff3 ER |
41 | sed -i -e 's@include "apr@include "apr/apr@g' bw_mod-%{version}.c |
42 | sed -i -e 's@^.*apr_buckets.h.*$@@' bw_mod-%{version}.c | |
ed6ddc97 ER |
43 | |
44 | %build | |
cd77293e | 45 | %{apxs} -c bw_mod-%{version}.c |
e44745e2 JB |
46 | |
47 | %install | |
48 | rm -rf $RPM_BUILD_ROOT | |
ed6ddc97 | 49 | install -d $RPM_BUILD_ROOT{%{_pkglibdir},%{_sysconfdir}/httpd.conf} \ |
e44745e2 | 50 | $RPM_BUILD_ROOT%{_var}/run/%{name}/{link,master} \ |
ed6ddc97 | 51 | $RPM_BUILD_ROOT{/etc/cron.d,%{_sbindir}} |
e44745e2 | 52 | |
ed6ddc97 | 53 | install .libs/bw_mod-%{version}.so $RPM_BUILD_ROOT%{_pkglibdir}/mod_%{mod_name}.so |
0511ec6d | 54 | install %{SOURCE1} $RPM_BUILD_ROOT%{_sysconfdir}/httpd.conf/97_mod_%{mod_name}.conf |
e44745e2 JB |
55 | |
56 | %clean | |
57 | rm -rf $RPM_BUILD_ROOT | |
58 | ||
59 | %post | |
b2f4d847 | 60 | %service -q httpd restart |
e44745e2 | 61 | |
8d98470e | 62 | %postun |
e44745e2 | 63 | if [ "$1" = "0" ]; then |
b2f4d847 | 64 | %service -q httpd restart |
e44745e2 JB |
65 | fi |
66 | ||
67 | %files | |
68 | %defattr(644,root,root,755) | |
cd77293e | 69 | %doc bw_mod-%{version}.txt LICENSE |
ed6ddc97 | 70 | %attr(640,root,root) %config(noreplace) %verify(not md5 mtime size) %{_sysconfdir}/httpd.conf/*_mod_%{mod_name}.conf |
c67d93f1 | 71 | %attr(755,root,root) %{_pkglibdir}/*.so |
0511ec6d MWP |
72 | #%config(noreplace) %verify(not size mtime md5) %attr(640,root,root) /etc/cron.d/%{name} |
73 | #%attr(755,root,root) %{_sbindir}/* | |
e44745e2 JB |
74 | %attr(750,http,root) %dir %{_var}/run/%{name} |
75 | %attr(750,http,root) %dir %{_var}/run/%{name}/link | |
76 | %attr(750,http,root) %dir %{_var}/run/%{name}/master |