]> git.pld-linux.org Git - packages/apache-mod_bw.git/blob - apache-mod_bw.spec
- updated to 0.6, NFY
[packages/apache-mod_bw.git] / apache-mod_bw.spec
1 %define         mod_name        bandwidth
2 %define         apxs            /usr/sbin/apxs
3 %define         _ver    0.6
4 Summary:        Apache module: bandwidth limits
5 Summary(pl):    Modu³ do Apache: limity pasma
6 Name:           apache-mod_%{mod_name}
7 Version:        0.6
8 Release:        0.1
9 License:        Apache
10 Group:          Networking/Daemons
11 Source0:        http://www.ivn.cl/apache/bw_mod-%{_ver}.tgz
12 # Source0-md5:  0c92fa6344f487321291a592dbb49856
13 #Source0:       http://www.ivn.cl/apache/mod_%{mod_name}-%{_version}.tgz
14 #Source1:       %{name}.conf
15 URL:            http://www.ivn.cl/apache/
16 BuildRequires:  apache-devel >= 2.0.0
17 BuildRequires:  %{apxs}
18 Requires(post,preun):   %{apxs}
19 Requires(post,preun):   grep
20 Requires(preun):        fileutils
21 Requires:       apache >= 2.0.0
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)
28 %define         _sysconfdir     %(%{apxs} -q SYSCONFDIR)
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 -n mod_%{mod_name}-%{version}
41 %setup -q -n bw_mod-0.6
42
43 %build
44 perl -pi -e 's@include "apr@include "apr/apr@g' bw_mod-%{_ver}.c
45 perl -pi -e 's@^.*apr_buckets.h.*$@@'  bw_mod-%{_ver}.c
46 #%{apxs} -c mod_%{mod_name}-%{version}.c -o mod_%{mod_name}.so
47 %{apxs} -c bw_mod-%{_ver}.c -o mod_%{mod_name}.so
48
49 %install
50 rm -rf $RPM_BUILD_ROOT
51 install -d $RPM_BUILD_ROOT{%{_pkglibdir},%{_sysconfdir}} \
52         $RPM_BUILD_ROOT%{_var}/run/%{name}/{link,master} \
53         $RPM_BUILD_ROOT{/etc/cron.d,%{_sbindir}}
54
55 install mod_%{mod_name}.so $RPM_BUILD_ROOT%{_pkglibdir}
56 #install %{SOURCE1} $RPM_BUILD_ROOT%{_sysconfdir}/mod_%{mod_name}.conf
57
58 %clean
59 rm -rf $RPM_BUILD_ROOT
60
61 %post
62 if [ -f /var/lock/subsys/apache ]; then
63         /etc/rc.d/init.d/apache restart 1>&2
64 fi
65
66 %preun
67 if [ "$1" = "0" ]; then
68         umask 027
69         if [ -f /var/lock/subsys/apache ]; then
70                 /etc/rc.d/init.d/apache restart 1>&2
71         fi
72 fi
73
74 %files
75 %defattr(644,root,root,755)
76 %doc *html
77 %attr(640,root,root) %config(noreplace) %verify(not size mtime md5) %{_sysconfdir}/mod_*.conf
78 %config(noreplace) %verify(not size mtime md5) %attr(640,root,root) /etc/cron.d/%{name}
79 %attr(755,root,root) %{_sbindir}/*
80 %attr(755,root,root) %{_pkglibdir}/*
81 %attr(750,http,root) %dir %{_var}/run/%{name}
82 %attr(750,http,root) %dir %{_var}/run/%{name}/link
83 %attr(750,http,root) %dir %{_var}/run/%{name}/master
This page took 0.039872 seconds and 3 git commands to generate.