]> git.pld-linux.org Git - packages/apache-mod_bw.git/blob - apache-mod_bw.spec
- builds,
[packages/apache-mod_bw.git] / apache-mod_bw.spec
1 # TODO:
2 # - confs, cleanups
3
4 %define         mod_name        bandwidth
5 %define         apxs            /usr/sbin/apxs
6 %define         _ver    0.6
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.1
12 License:        Apache
13 Group:          Networking/Daemons
14 Source0:        http://www.ivn.cl/apache/bw_mod-%{_ver}.tgz
15 # Source0-md5:  0c92fa6344f487321291a592dbb49856
16 #Source0:       http://www.ivn.cl/apache/mod_%{mod_name}-%{_version}.tgz
17 #Source1:       %{name}.conf
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 mod_%{mod_name}-%{version}
44 %setup -q -n bw_mod-0.6
45
46 %build
47 perl -pi -e 's@include "apr@include "apr/apr@g' bw_mod-%{_ver}.c
48 perl -pi -e 's@^.*apr_buckets.h.*$@@'  bw_mod-%{_ver}.c
49 #%{apxs} -c mod_%{mod_name}-%{version}.c -o mod_%{mod_name}.so
50 %{apxs} -c bw_mod-%{_ver}.c
51 mv .libs/bw_mod-0.6.so mod_bandwidth.so
52
53 %install
54 rm -rf $RPM_BUILD_ROOT
55 install -d $RPM_BUILD_ROOT{%{_pkglibdir},%{_sysconfdir}} \
56         $RPM_BUILD_ROOT%{_var}/run/%{name}/{link,master} \
57         $RPM_BUILD_ROOT{/etc/cron.d,%{_sbindir}}
58
59 install mod_%{mod_name}.so $RPM_BUILD_ROOT%{_pkglibdir}
60 #install %{SOURCE1} $RPM_BUILD_ROOT%{_sysconfdir}/mod_%{mod_name}.conf
61
62 %clean
63 rm -rf $RPM_BUILD_ROOT
64
65 %post
66 if [ -f /var/lock/subsys/apache ]; then
67         /etc/rc.d/init.d/apache restart 1>&2
68 fi
69
70 %preun
71 if [ "$1" = "0" ]; then
72         umask 027
73         if [ -f /var/lock/subsys/apache ]; then
74                 /etc/rc.d/init.d/apache restart 1>&2
75         fi
76 fi
77
78 %files
79 %defattr(644,root,root,755)
80 %doc bw_mod-0.6.txt
81 #TODO
82 #%attr(640,root,root) %config(noreplace) %verify(not size mtime md5) %{_sysconfdir}/mod_*.conf
83 %config(noreplace) %verify(not size mtime md5) %attr(640,root,root) /etc/cron.d/%{name}
84 %attr(755,root,root) %{_sbindir}/*
85 %attr(755,root,root) %{_pkglibdir}/*
86 %attr(750,http,root) %dir %{_var}/run/%{name}
87 %attr(750,http,root) %dir %{_var}/run/%{name}/link
88 %attr(750,http,root) %dir %{_var}/run/%{name}/master
This page took 0.090504 seconds and 3 git commands to generate.