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