]> git.pld-linux.org Git - packages/apache1-mod_bandwidth.git/blob - apache1-mod_bandwidth.spec
- obsoletes with constant version
[packages/apache1-mod_bandwidth.git] / apache1-mod_bandwidth.spec
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}
6 Version:        2.0.5
7 Release:        1.4
8 License:        Apache
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
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
19 BuildRequires:  %{apxs}
20 BuildRequires:  apache1-devel >= 1.3.33-2
21 BuildRequires:  rpmbuild(macros) >= 1.268
22 Requires:       apache1 >= 1.3.33-2
23 Requires:       crondaemon
24 Requires:       procps
25 Obsoletes:      apache-mod_bandwidth <= 2.0.5
26 BuildRoot:      %{tmpdir}/%{name}-%{version}-root-%(id -u -n)
27
28 %define         _pkglibdir      %(%{apxs} -q LIBEXECDIR 2>/dev/null)
29 %define         _sysconfdir     %(%{apxs} -q SYSCONFDIR 2>/dev/null)
30
31 %description
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.
35
36 %description -l pl
37 Modu³ pozwalaj±cy na ograniczanie pasma poprzez serwer Apache bazuj±c
38 na katalogu, wielko¶ci plików oraz zdalnym IP/domenie.
39
40 %prep
41 %setup -q -T -c
42 cp %{SOURCE0} .
43
44 %build
45 %{apxs} -c mod_%{mod_name}.c -o mod_%{mod_name}.so
46
47 %install
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}}
52
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
56 install %{SOURCE4} .
57
58 echo '* * * * * http %{_sbindir}/%{name}-cleanlink.pl' > \
59         $RPM_BUILD_ROOT/etc/cron.d/%{name}
60
61 %clean
62 rm -rf $RPM_BUILD_ROOT
63
64 %post
65 %service -q apache restart
66
67 %postun
68 if [ "$1" = "0" ]; then
69         %service -q apache restart
70 fi
71
72 %files
73 %defattr(644,root,root,755)
74 %doc *html
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
This page took 0.099789 seconds and 3 git commands to generate.