]>
Commit | Line | Data |
---|---|---|
304532fb AM |
1 | %define apxs /usr/sbin/apxs |
2 | %define mod_name cgroupmin | |
3 | Summary: Resource management per vhost | |
4 | Name: apache-mod_%{mod_name} | |
9fd1dfef | 5 | Version: 0.0.2 |
304532fb AM |
6 | Release: 1 |
7 | License: GPL | |
8 | Group: Networking/Daemons/HTTP | |
9fd1dfef AM |
9 | Source0: https://github.com/arekm/mod_cgroupmin/archive/v%{version}.tar.gz |
10 | # Source0-md5: 8bdbd52c596389297df5af7e4ab0398d | |
304532fb AM |
11 | BuildRequires: %{apxs} |
12 | BuildRequires: apache-devel >= 2.0 | |
13 | BuildRequires: apr-devel >= 1:1.0 | |
14 | BuildRequires: apr-util-devel >= 1:1.0 | |
15 | BuildRequires: rpmbuild(macros) >= 1.268 | |
16 | Requires: apache(modules-api) = %apache_modules_api | |
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)/conf.d | |
21 | ||
22 | %description | |
23 | mod_cgroupmin provides a system administrator with the capability to | |
24 | provide predictable service levels for each virtual host declared in | |
25 | httpd. | |
26 | ||
27 | mod_cgroup can be used for: | |
28 | - Offering grades of service per virtual host or a group of virtual | |
29 | hosts. | |
30 | - Protecting other virtual hosts from problematic resource abuse in | |
31 | another vhost. | |
32 | - Penalizing a virtual host which fails to respect resouce | |
33 | limitations. | |
34 | - Ensuring a predictable capacity level is provided to all web | |
35 | services. | |
36 | ||
37 | %prep | |
38 | %setup -q -n mod_%{mod_name}-%{version} | |
39 | ||
40 | %build | |
41 | %{apxs} -c mod_%{mod_name}.c -o mod_%{mod_name}.la | |
42 | ||
43 | %install | |
44 | rm -rf $RPM_BUILD_ROOT | |
45 | install -d $RPM_BUILD_ROOT{%{_pkglibdir},%{_sysconfdir}} | |
46 | ||
47 | install .libs/mod_%{mod_name}.so $RPM_BUILD_ROOT%{_pkglibdir}/mod_%{mod_name}.so | |
48 | install mod_%{mod_name}.conf $RPM_BUILD_ROOT%{_sysconfdir}/00_mod_cgroupmin.conf | |
49 | ||
50 | %clean | |
51 | rm -rf $RPM_BUILD_ROOT | |
52 | ||
53 | %post | |
54 | %service -q httpd restart | |
55 | ||
56 | %postun | |
57 | if [ "$1" = "0" ]; then | |
58 | %service -q httpd restart | |
59 | fi | |
60 | ||
61 | %files | |
62 | %defattr(644,root,root,755) | |
63 | %doc README.md | |
64 | %attr(640,root,root) %config(noreplace) %verify(not md5 mtime size) %{_sysconfdir}/*_mod_%{mod_name}.conf | |
65 | %attr(755,root,root) %{_pkglibdir}/mod_%{mod_name}.so |