]>
Commit | Line | Data |
---|---|---|
8b8d7a94 | 1 | %define mod_name bandwidth |
3d01cd87 | 2 | %define apxs /usr/sbin/apxs1 |
8b8d7a94 | 3 | Summary: Apache module: bandwidth limits |
ed302e87 | 4 | Summary(pl.UTF-8): Moduł do Apache: limity pasma |
3d01cd87 | 5 | Name: apache1-mod_%{mod_name} |
66da1140 | 6 | Version: 2.0.5 |
7e2c15b0 | 7 | Release: 1.5 |
8b8d7a94 JB |
8 | License: Apache |
9 | Group: Networking/Daemons | |
10 | Source0: ftp://ftp.cohprog.com/pub/apache/module/1.3.0/mod_bandwidth.c | |
255adf52 | 11 | # Source0-md5: 00f0905d777f79485beb428b53191ecf |
8b8d7a94 JB |
12 | # ftp://ftp.cohprog.com/pub/apache/module/cleanlink.pl |
13 | # modified to work from cron NOT as daemon! | |
14 | Source1: %{name}-cleanlink.pl | |
15 | Source2: %{name}.conf | |
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 | |
fc5a2091 | 19 | BuildRequires: apache1-devel >= 1.3.39 |
dcfc3b6e | 20 | BuildRequires: rpmbuild(macros) >= 1.268 |
7e2c15b0 | 21 | Requires: apache1(EAPI) |
a750f5bb | 22 | Requires: crondaemon |
8b8d7a94 | 23 | Requires: procps |
ec5c398d | 24 | Obsoletes: apache-mod_bandwidth <= 2.0.5 |
8b8d7a94 JB |
25 | BuildRoot: %{tmpdir}/%{name}-%{version}-root-%(id -u -n) |
26 | ||
3701610a ER |
27 | %define _pkglibdir %(%{apxs} -q LIBEXECDIR 2>/dev/null) |
28 | %define _sysconfdir %(%{apxs} -q SYSCONFDIR 2>/dev/null) | |
8b8d7a94 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 | ||
a5c3ce13 JR |
35 | %description -l pl.UTF-8 |
36 | Moduł pozwalający na ograniczanie pasma poprzez serwer Apache bazując | |
37 | na katalogu, wielkości plików oraz zdalnym IP/domenie. | |
8b8d7a94 JB |
38 | |
39 | %prep | |
40 | %setup -q -T -c | |
41 | cp %{SOURCE0} . | |
42 | ||
43 | %build | |
44 | %{apxs} -c mod_%{mod_name}.c -o mod_%{mod_name}.so | |
45 | ||
46 | %install | |
47 | rm -rf $RPM_BUILD_ROOT | |
3701610a | 48 | install -d $RPM_BUILD_ROOT{%{_pkglibdir},%{_sysconfdir}/conf.d} \ |
8b8d7a94 JB |
49 | $RPM_BUILD_ROOT%{_var}/run/%{name}/{link,master} \ |
50 | $RPM_BUILD_ROOT{/etc/cron.d,%{_sbindir}} | |
51 | ||
52 | install mod_%{mod_name}.so $RPM_BUILD_ROOT%{_pkglibdir} | |
53 | install %{SOURCE1} $RPM_BUILD_ROOT%{_sbindir} | |
3701610a | 54 | install %{SOURCE2} $RPM_BUILD_ROOT%{_sysconfdir}/conf.d/90_mod_%{mod_name}.conf |
8b8d7a94 JB |
55 | install %{SOURCE4} . |
56 | ||
57 | echo '* * * * * http %{_sbindir}/%{name}-cleanlink.pl' > \ | |
58 | $RPM_BUILD_ROOT/etc/cron.d/%{name} | |
59 | ||
60 | %clean | |
61 | rm -rf $RPM_BUILD_ROOT | |
62 | ||
63 | %post | |
dcfc3b6e | 64 | %service -q apache restart |
8b8d7a94 | 65 | |
7637c8ea | 66 | %postun |
8b8d7a94 | 67 | if [ "$1" = "0" ]; then |
dcfc3b6e | 68 | %service -q apache restart |
8b8d7a94 JB |
69 | fi |
70 | ||
71 | %files | |
72 | %defattr(644,root,root,755) | |
73 | %doc *html | |
51a61d6f ER |
74 | %attr(640,root,root) %config(noreplace) %verify(not md5 mtime size) %{_sysconfdir}/conf.d/*_mod_%{mod_name}.conf |
75 | %config(noreplace) %verify(not md5 mtime size) %attr(640,root,root) /etc/cron.d/%{name} | |
8b8d7a94 JB |
76 | %attr(755,root,root) %{_sbindir}/* |
77 | %attr(755,root,root) %{_pkglibdir}/* | |
78 | %attr(750,http,root) %dir %{_var}/run/%{name} | |
79 | %attr(750,http,root) %dir %{_var}/run/%{name}/link | |
80 | %attr(750,http,root) %dir %{_var}/run/%{name}/master |