]>
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} |
0e16d960 | 8 | Version: 0.92 |
0f2aad26 | 9 | Release: 5 |
472fb15f | 10 | License: Apache v2.0 |
abe986cb | 11 | Group: Networking/Daemons/HTTP |
0e16d960 ER |
12 | Source0: http://ivn.cl/files/source/mod_bw-%{version}.tgz |
13 | # Source0-md5: 90f5e632dad5de8d49dcdb61453dcf97 | |
0511ec6d | 14 | Source1: %{name}.conf |
455f2602 | 15 | Source2: %{name}.tmpfiles |
0f2aad26 | 16 | Patch0: mod_bw-apache24.patch |
1dd6fe21 | 17 | URL: http://www.ivn.cl/apache/ |
d8882fd8 | 18 | BuildRequires: %{apxs} |
b9a8f100 | 19 | BuildRequires: apache-devel >= 2.0.0 |
b2f4d847 | 20 | BuildRequires: rpmbuild(macros) >= 1.268 |
6fc9aff3 ER |
21 | BuildRequires: sed >= 4.0 |
22 | Requires: apache(modules-api) = %apache_modules_api | |
348c5ac8 | 23 | Requires: crondaemon |
e44745e2 JB |
24 | Requires: procps |
25 | BuildRoot: %{tmpdir}/%{name}-%{version}-root-%(id -u -n) | |
26 | ||
6fc9aff3 | 27 | %define _pkglibdir %(%{apxs} -q LIBEXECDIR 2>/dev/null) |
e41f5619 | 28 | %define _sysconfdir %(%{apxs} -q SYSCONFDIR 2>/dev/null)/conf.d |
e44745e2 JB |
29 | |
30 | %description | |
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. | |
34 | ||
c944853d JR |
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. | |
e44745e2 JB |
38 | |
39 | %prep | |
0e16d960 | 40 | %setup -qc |
0f2aad26 | 41 | %patch0 -p1 |
ed6ddc97 ER |
42 | |
43 | %build | |
0e16d960 | 44 | %{apxs} -c mod_bw.c |
e44745e2 JB |
45 | |
46 | %install | |
47 | rm -rf $RPM_BUILD_ROOT | |
e41f5619 | 48 | install -d $RPM_BUILD_ROOT{%{_pkglibdir},%{_sysconfdir}} \ |
e44745e2 | 49 | $RPM_BUILD_ROOT%{_var}/run/%{name}/{link,master} \ |
455f2602 JR |
50 | $RPM_BUILD_ROOT{/etc/cron.d,%{_sbindir}} \ |
51 | $RPM_BUILD_ROOT/usr/lib/tmpfiles.d | |
e44745e2 | 52 | |
0e16d960 | 53 | install -p .libs/mod_bw.so $RPM_BUILD_ROOT%{_pkglibdir}/mod_%{mod_name}.so |
e41f5619 | 54 | cp -p %{SOURCE1} $RPM_BUILD_ROOT%{_sysconfdir}/97_mod_%{mod_name}.conf |
455f2602 | 55 | install %{SOURCE2} $RPM_BUILD_ROOT/usr/lib/tmpfiles.d/%{name}.conf |
e44745e2 JB |
56 | |
57 | %clean | |
58 | rm -rf $RPM_BUILD_ROOT | |
59 | ||
60 | %post | |
b2f4d847 | 61 | %service -q httpd restart |
e44745e2 | 62 | |
8d98470e | 63 | %postun |
e44745e2 | 64 | if [ "$1" = "0" ]; then |
b2f4d847 | 65 | %service -q httpd restart |
e44745e2 JB |
66 | fi |
67 | ||
68 | %files | |
69 | %defattr(644,root,root,755) | |
0e16d960 | 70 | %doc mod_bw.txt LICENSE ChangeLog |
e41f5619 | 71 | %attr(640,root,root) %config(noreplace) %verify(not md5 mtime size) %{_sysconfdir}/*_mod_%{mod_name}.conf |
c67d93f1 | 72 | %attr(755,root,root) %{_pkglibdir}/*.so |
0511ec6d MWP |
73 | #%config(noreplace) %verify(not size mtime md5) %attr(640,root,root) /etc/cron.d/%{name} |
74 | #%attr(755,root,root) %{_sbindir}/* | |
455f2602 | 75 | /usr/lib/tmpfiles.d/%{name}.conf |
e44745e2 JB |
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 |