]> git.pld-linux.org Git - packages/apache-mod_bw.git/blob - apache-mod_bw.spec
- rebuild with new apache
[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:        2
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:  %{apxs}
18 BuildRequires:  apache-devel >= 2.0.0
19 BuildRequires:  sed >= 4.0
20 Requires:       apache(modules-api) = %apache_modules_api
21 Requires:       apache >= 2.0.0
22 Requires:       crondaemon
23 Requires:       procps
24 BuildRoot:      %{tmpdir}/%{name}-%{version}-root-%(id -u -n)
25
26 %define         _pkglibdir      %(%{apxs} -q LIBEXECDIR 2>/dev/null)
27 %define         _sysconfdir     %(%{apxs} -q SYSCONFDIR 2>/dev/null)
28
29 %description
30 "Mod_bandwidth" is a module for the Apache webserver that enable the
31 setting of server-wide or per connection bandwidth limits, based on
32 the directory, size of files and remote IP/domain.
33
34 %description -l pl
35 Modu³ pozwalaj±cy na ograniczanie pasma serwera Apache bazuj±c na
36 katalogu, wielko¶ci plików lub zdalnym IP/domenie.
37
38 %prep
39 %setup -q -n bw_mod-%{version}
40 %patch0 -p1
41
42 %build
43 sed -i -e 's@include "apr@include "apr/apr@g' bw_mod-%{version}.c
44 sed -i -e 's@^.*apr_buckets.h.*$@@' bw_mod-%{version}.c
45 %{apxs} -c bw_mod-%{version}.c
46 mv .libs/bw_mod-%{version}.so mod_bw.so
47
48 %install
49 rm -rf $RPM_BUILD_ROOT
50 install -d $RPM_BUILD_ROOT{%{_pkglibdir},%{_sysconfdir}} \
51         $RPM_BUILD_ROOT%{_var}/run/%{name}/{link,master} \
52         $RPM_BUILD_ROOT{/etc/cron.d,%{_sbindir},%{_sysconfdir}/httpd.conf}
53
54 install mod_%{mod_name}.so $RPM_BUILD_ROOT%{_pkglibdir}
55 install %{SOURCE1} $RPM_BUILD_ROOT%{_sysconfdir}/httpd.conf/97_mod_%{mod_name}.conf
56
57 %clean
58 rm -rf $RPM_BUILD_ROOT
59
60 %post
61 if [ -f /var/lock/subsys/httpd ]; then
62         /etc/rc.d/init.d/httpd restart 1>&2
63 fi
64
65 %preun
66 if [ "$1" = "0" ]; then
67         if [ -f /var/lock/subsys/httpd ]; then
68                 /etc/rc.d/init.d/httpd restart 1>&2
69         fi
70 fi
71
72 %files
73 %defattr(644,root,root,755)
74 %doc bw_mod-%{version}.txt LICENSE
75 %attr(640,root,root) %config(noreplace) %verify(not md5 mtime size) %{_sysconfdir}/httpd.conf/*mod_*.conf
76 #%config(noreplace) %verify(not size mtime md5) %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.048013 seconds and 3 git commands to generate.