]>
Commit | Line | Data |
---|---|---|
600bb7f1 AM |
1 | %define mod_name limitipconn |
2 | %define apxs %{_sbindir}/apxs | |
3 | Summary: Apache module: Limit simultaneous connections by an IP address | |
4 | Name: apache-mod_%{mod_name} | |
5 | Version: 0.24 | |
c201c6a6 | 6 | Release: 3 |
600bb7f1 AM |
7 | License: Apache |
8 | Group: Networking/Daemons | |
9 | Source0: http://dominia.org/djao/limit/mod_limitipconn-%{version}.tar.bz2 | |
10 | # Source0-md5: 5cf6ddc6743931afef26c03de851279b | |
11 | Source1: apache.conf | |
12 | URL: http://dominia.org/djao/limitipconn2.html | |
b0c5821e AM |
13 | BuildRequires: %{apxs} |
14 | BuildRequires: apache-devel >= 2.0.0 | |
600bb7f1 | 15 | BuildRequires: rpmbuild(macros) >= 1.228 |
b0c5821e | 16 | Requires: apache(modules-api) = %apache_modules_api |
600bb7f1 AM |
17 | BuildRoot: %{tmpdir}/%{name}-%{version}-root-%(id -u -n) |
18 | ||
19 | %define _pkglibdir %(%{apxs} -q LIBEXECDIR 2>/dev/null) | |
20 | %define _sysconfdir %(%{apxs} -q SYSCONFDIR 2>/dev/null) | |
21 | ||
22 | %description | |
23 | The mod_limitipconn module lets you enforce limits on the number of | |
24 | simultaneous downloads allowed from a single IP address. You can also | |
25 | control which MIME types are affected by the limits. | |
26 | ||
27 | This module will not function unless mod_status is loaded and the | |
28 | "ExtendedStatus On" directive is set. | |
29 | ||
30 | %prep | |
31 | %setup -q -n mod_%{mod_name}-%{version} | |
32 | ||
33 | %build | |
34 | %{apxs} -c mod_%{mod_name}.c | |
35 | ||
36 | %install | |
37 | rm -rf $RPM_BUILD_ROOT | |
38 | install -d $RPM_BUILD_ROOT{%{_pkglibdir},%{_sysconfdir}/conf.d} | |
39 | install -p .libs/mod_%{mod_name}.so $RPM_BUILD_ROOT%{_pkglibdir} | |
40 | cp -a %{SOURCE1} $RPM_BUILD_ROOT%{_sysconfdir}/conf.d/90_mod_%{mod_name}.conf | |
41 | ||
42 | %clean | |
43 | rm -rf $RPM_BUILD_ROOT | |
44 | ||
45 | %post | |
a11d5885 | 46 | %service httpd restart |
600bb7f1 AM |
47 | |
48 | %postun | |
49 | if [ "$1" = "0" ]; then | |
a11d5885 | 50 | %service -q httpd restart |
600bb7f1 AM |
51 | fi |
52 | ||
53 | %files | |
54 | %defattr(644,root,root,755) | |
55 | %doc ChangeLog README | |
56 | %attr(640,root,root) %config(noreplace) %verify(not md5 mtime size) %{_sysconfdir}/conf.d/*_mod_%{mod_name}.conf | |
57 | %attr(755,root,root) %{_pkglibdir}/* |