]> git.pld-linux.org Git - packages/apache1-mod_bandwidth.git/blob - apache1-mod_bandwidth.spec
- for confdir enabled apache1
[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.3
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:  apache1-devel >= 1.3.33-2
20 BuildRequires:  %{apxs}
21 Requires:       apache1 >= 1.3.33-2
22 Requires:       crondaemon
23 Requires:       procps
24 Obsoletes:      apache-mod_%{mod_name} <= %{version}
25 BuildRoot:      %{tmpdir}/%{name}-%{version}-root-%(id -u -n)
26
27 %define         _pkglibdir      %(%{apxs} -q LIBEXECDIR 2>/dev/null)
28 %define         _sysconfdir     %(%{apxs} -q SYSCONFDIR 2>/dev/null)
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
35 %description -l pl
36 Modu³ pozwalaj±cy na ograniczanie pasma poprzez serwer Apache bazuj±c
37 na katalogu, wielko¶ci plików oraz zdalnym IP/domenie.
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
48 install -d $RPM_BUILD_ROOT{%{_pkglibdir},%{_sysconfdir}/conf.d} \
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}
54 install %{SOURCE2} $RPM_BUILD_ROOT%{_sysconfdir}/conf.d/90_mod_%{mod_name}.conf
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
64 if [ -f /var/lock/subsys/apache ]; then
65         /etc/rc.d/init.d/apache restart 1>&2
66 fi
67
68 %preun
69 if [ "$1" = "0" ]; then
70         if [ -f /var/lock/subsys/apache ]; then
71                 /etc/rc.d/init.d/apache restart 1>&2
72         fi
73 fi
74
75 %files
76 %defattr(644,root,root,755)
77 %doc *html
78 %attr(640,root,root) %config(noreplace) %verify(not size mtime md5) %{_sysconfdir}/conf.d/*_mod_%{mod_name}.conf
79 %config(noreplace) %verify(not size mtime md5) %attr(640,root,root) /etc/cron.d/%{name}
80 %attr(755,root,root) %{_sbindir}/*
81 %attr(755,root,root) %{_pkglibdir}/*
82 %attr(750,http,root) %dir %{_var}/run/%{name}
83 %attr(750,http,root) %dir %{_var}/run/%{name}/link
84 %attr(750,http,root) %dir %{_var}/run/%{name}/master
This page took 0.077116 seconds and 4 git commands to generate.