]> git.pld-linux.org Git - packages/apache-mod_bw.git/blob - apache-mod_bw.spec
ec15452d9933aa22c30521eeb800ee170f6c8f02
[packages/apache-mod_bw.git] / apache-mod_bw.spec
1 # TODO:
2 # - cron?
3 # - rename to apache-mod_bw (it is not the same as apache1-mod_bandwidth)
4
5 %define         mod_name        bandwidth
6 %define         apxs            /usr/sbin/apxs
7 Summary:        Apache module: bandwidth limits
8 Summary(pl):    Modu³ do Apache: limity pasma
9 Name:           apache-mod_%{mod_name}
10 Version:        0.6
11 Release:        0.3
12 License:        Apache
13 Group:          Networking/Daemons
14 Source0:        http://www.ivn.cl/apache/bw_mod-%{version}.tgz
15 # Source0-md5:  0c92fa6344f487321291a592dbb49856
16 Source1:        %{name}.conf
17 Patch0:         %{name}-apr_1.0.patch
18 URL:            http://www.ivn.cl/apache/
19 BuildRequires:  apache-devel >= 2.0.0
20 BuildRequires:  %{apxs}
21 Requires(post,preun):   %{apxs}
22 Requires(post,preun):   grep
23 Requires(preun):        fileutils
24 Requires:       apache >= 2.0.0
25 Requires:       crondaemon
26 Requires:       procps
27 Obsoletes:      apache-mod_%{mod_name} <= %{version}
28 BuildRoot:      %{tmpdir}/%{name}-%{version}-root-%(id -u -n)
29
30 %define         _pkglibdir      %(%{apxs} -q LIBEXECDIR)
31 %define         _sysconfdir     %(%{apxs} -q SYSCONFDIR)
32
33 %description
34 "Mod_bandwidth" is a module for the Apache webserver that enable the
35 setting of server-wide or per connection bandwidth limits, based on
36 the directory, size of files and remote IP/domain.
37
38 %description -l pl
39 Modu³ pozwalaj±cy na ograniczanie pasma poprzez serwer Apache bazuj±c
40 na katalogu, wielko¶ci plików oraz zdalnym IP/domenie.
41
42 %prep
43 %setup -q -n bw_mod-%{version}
44 %patch0 -p1
45
46 %build
47 perl -pi -e 's@include "apr@include "apr/apr@g' bw_mod-%{version}.c
48 perl -pi -e 's@^.*apr_buckets.h.*$@@'  bw_mod-%{version}.c
49 %{apxs} -c bw_mod-%{version}.c
50 mv .libs/bw_mod-%{version}.so mod_bandwidth.so
51
52 %install
53 rm -rf $RPM_BUILD_ROOT
54 install -d $RPM_BUILD_ROOT{%{_pkglibdir},%{_sysconfdir}} \
55         $RPM_BUILD_ROOT%{_var}/run/%{name}/{link,master} \
56         $RPM_BUILD_ROOT{/etc/cron.d,%{_sbindir},%{_sysconfdir}/httpd.conf}
57
58 install mod_%{mod_name}.so $RPM_BUILD_ROOT%{_pkglibdir}
59 install %{SOURCE1} $RPM_BUILD_ROOT%{_sysconfdir}/httpd.conf/97_mod_%{mod_name}.conf
60
61 %clean
62 rm -rf $RPM_BUILD_ROOT
63
64 %post
65 if [ -f /var/lock/subsys/apache ]; then
66         /etc/rc.d/init.d/apache restart 1>&2
67 fi
68
69 %preun
70 if [ "$1" = "0" ]; then
71         umask 027
72         if [ -f /var/lock/subsys/apache ]; then
73                 /etc/rc.d/init.d/apache restart 1>&2
74         fi
75 fi
76
77 %files
78 %defattr(644,root,root,755)
79 %doc bw_mod-%{version}.txt LICENSE
80 %attr(640,root,root) %config(noreplace) %verify(not size mtime md5) %{_sysconfdir}/httpd.conf/*mod_*.conf
81 #%config(noreplace) %verify(not size mtime md5) %attr(640,root,root) /etc/cron.d/%{name}
82 #%attr(755,root,root) %{_sbindir}/*
83 %attr(755,root,root) %{_pkglibdir}/*
84 %attr(750,http,root) %dir %{_var}/run/%{name}
85 %attr(750,http,root) %dir %{_var}/run/%{name}/link
86 %attr(750,http,root) %dir %{_var}/run/%{name}/master
This page took 0.089321 seconds and 2 git commands to generate.