]> git.pld-linux.org Git - packages/apache-mod_bw.git/blob - apache-mod_bw.spec
- reflect name change (mod_bandwidth -> mod_bw)
[packages/apache-mod_bw.git] / apache-mod_bw.spec
1 # TODO:
2 # - cron?
3 %define         mod_name        bw
4 %define         apxs            /usr/sbin/apxs
5 Summary:        Apache module: bandwidth limits
6 Summary(pl):    Modu³ do Apache: limity pasma
7 Name:           apache-mod_%{mod_name}
8 Version:        0.6
9 Release:        1
10 License:        Apache
11 Group:          Networking/Daemons
12 Source0:        http://www.ivn.cl/apache/bw_mod-%{version}.tgz
13 # Source0-md5:  0c92fa6344f487321291a592dbb49856
14 Source1:        %{name}.conf
15 Patch0:         %{name}-apr_1.0.patch
16 URL:            http://www.ivn.cl/apache/
17 BuildRequires:  apache-devel >= 2.0.0
18 BuildRequires:  %{apxs}
19 Requires(post,preun):   %{apxs}
20 Requires(post,preun):   grep
21 Requires(preun):        fileutils
22 Requires:       apache >= 2.0.0
23 Requires:       crondaemon
24 Requires:       procps
25 Obsoletes:      apache-mod_%{mod_name} <= %{version}
26 BuildRoot:      %{tmpdir}/%{name}-%{version}-root-%(id -u -n)
27
28 %define         _pkglibdir      %(%{apxs} -q LIBEXECDIR)
29 %define         _sysconfdir     %(%{apxs} -q SYSCONFDIR)
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 -n bw_mod-%{version}
42 %patch0 -p1
43
44 %build
45 perl -pi -e 's@include "apr@include "apr/apr@g' bw_mod-%{version}.c
46 perl -pi -e 's@^.*apr_buckets.h.*$@@'  bw_mod-%{version}.c
47 %{apxs} -c bw_mod-%{version}.c
48 mv .libs/bw_mod-%{version}.so mod_bw.so
49
50 %install
51 rm -rf $RPM_BUILD_ROOT
52 install -d $RPM_BUILD_ROOT{%{_pkglibdir},%{_sysconfdir}} \
53         $RPM_BUILD_ROOT%{_var}/run/%{name}/{link,master} \
54         $RPM_BUILD_ROOT{/etc/cron.d,%{_sbindir},%{_sysconfdir}/httpd.conf}
55
56 install mod_%{mod_name}.so $RPM_BUILD_ROOT%{_pkglibdir}
57 install %{SOURCE1} $RPM_BUILD_ROOT%{_sysconfdir}/httpd.conf/97_mod_%{mod_name}.conf
58
59 %clean
60 rm -rf $RPM_BUILD_ROOT
61
62 %post
63 if [ -f /var/lock/subsys/apache ]; then
64         /etc/rc.d/init.d/apache restart 1>&2
65 fi
66
67 %preun
68 if [ "$1" = "0" ]; then
69         umask 027
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 bw_mod-%{version}.txt LICENSE
78 %attr(640,root,root) %config(noreplace) %verify(not size mtime md5) %{_sysconfdir}/httpd.conf/*mod_*.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.031763 seconds and 3 git commands to generate.