]> git.pld-linux.org Git - packages/apache1-mod_bandwidth.git/blob - apache1-mod_bandwidth.spec
- massive attack: adding Source-md5
[packages/apache1-mod_bandwidth.git] / apache1-mod_bandwidth.spec
1 %define         mod_name        bandwidth
2 %define         apxs            /usr/sbin/apxs
3 Summary:        Apache module: bandwidth limits
4 Summary(pl):    Modu³ do apache: limity pasma
5 Name:           apache-mod_%{mod_name}
6 Version:        2.0.5
7 Release:        1
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:  apache(EAPI)-devel
20 Requires(post,preun):   %{apxs}
21 Requires(post,preun):   grep
22 Requires(preun):        fileutils
23 Requires:       apache(EAPI)
24 Requires:       procps
25 BuildRoot:      %{tmpdir}/%{name}-%{version}-root-%(id -u -n)
26
27 %define         _pkglibdir      %(%{apxs} -q LIBEXECDIR)
28 %define         _sysconfdir     /etc/httpd
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³ pozawlaj±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}} \
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}/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 %{apxs} -e -a -n %{mod_name} %{_pkglibdir}/mod_%{mod_name}.so 1>&2
65 if [ -f /etc/httpd/httpd.conf ] && ! grep -q "^Include.*mod_%{mod_name}.conf" /etc/httpd/httpd.conf; then
66         echo "Include /etc/httpd/mod_%{mod_name}.conf" >> /etc/httpd/httpd.conf
67 fi
68 if [ -f /var/lock/subsys/httpd ]; then
69         /etc/rc.d/init.d/httpd restart 1>&2
70 fi
71
72 %preun
73 if [ "$1" = "0" ]; then
74         %{apxs} -e -A -n %{mod_name} %{_pkglibdir}/mod_%{mod_name}.so 1>&2
75         umask 027
76         grep -v "^Include.*mod_%{mod_name}.conf" /etc/httpd/httpd.conf > \
77                 /etc/httpd/httpd.conf.tmp
78         mv -f /etc/httpd/httpd.conf.tmp /etc/httpd/httpd.conf
79         if [ -f /var/lock/subsys/httpd ]; then
80                 /etc/rc.d/init.d/httpd restart 1>&2
81         fi
82 fi
83
84 %files
85 %defattr(644,root,root,755)
86 %doc *html
87 %attr(640,root,root) %config(noreplace) %verify(not size mtime md5) %{_sysconfdir}/mod_*.conf
88 %config(noreplace) %verify(not size mtime md5) %attr(640,root,root) /etc/cron.d/%{name}
89 %attr(755,root,root) %{_sbindir}/*
90 %attr(755,root,root) %{_pkglibdir}/*
91 %attr(750,http,root) %dir %{_var}/run/%{name}
92 %attr(750,http,root) %dir %{_var}/run/%{name}/link
93 %attr(750,http,root) %dir %{_var}/run/%{name}/master
This page took 1.472825 seconds and 3 git commands to generate.