]>
Commit | Line | Data |
---|---|---|
a5cf0a09 AM |
1 | %define snapdate 20110824 |
2 | %define snap 59adb1a668f0a8504b1124cf0bb93d7e61b21b01 | |
3 | # | |
4 | %define apxs /usr/sbin/apxs | |
5 | %define mod_name cgroup | |
6 | Summary: Resource management per vhost | |
7 | Name: apache-mod_%{mod_name} | |
8 | Version: 0.%{snapdate}.1 | |
9 | Release: 1 | |
10 | License: GPL | |
11 | Group: Networking/Daemons/HTTP | |
12 | Source0: https://github.com/MatthewIfe/mod_cgroup/archive/59adb1a668f0a8504b1124cf0bb93d7e61b21b01.zip | |
13 | # Source0-md5: c960aec82d2edc2fb1ecd27b8dd97c69 | |
14 | URL: https://github.com/MatthewIfe/mod_cgroup | |
15 | BuildRequires: %{apxs} | |
16 | BuildRequires: apache-devel >= 2.0 | |
17 | BuildRequires: apr-devel >= 1:1.0 | |
18 | BuildRequires: apr-util-devel >= 1:1.0 | |
19 | BuildRequires: libcgroup-devel | |
20 | BuildRequires: rpmbuild(macros) >= 1.268 | |
21 | Requires: apache(modules-api) = %apache_modules_api | |
22 | BuildRoot: %{tmpdir}/%{name}-%{version}-root-%(id -u -n) | |
23 | ||
24 | %define _pkglibdir %(%{apxs} -q LIBEXECDIR 2>/dev/null) | |
25 | %define _sysconfdir %(%{apxs} -q SYSCONFDIR 2>/dev/null)/conf.d | |
26 | ||
27 | %description | |
28 | mod_cgroup provides a system administrator with the capability to provide predictable service levels for each virtual host declared in httpd. | |
29 | ||
30 | mod_cgroup can be used for: | |
31 | * Offering grades of service per virtual host or a group of virtual hosts. | |
32 | * Protecting other virtual hosts from problematic resource abuse in another vhost. | |
33 | * Penalizing a virtual host which fails to respect resouce limitations. | |
34 | * Ensuring a predictable capacity level is provided to all web services. | |
35 | ||
36 | mod_cgroup is an Apache 2 filter which scans the content delivered by | |
37 | the proxy module (mod_proxy) for viruses using the Clamav virus | |
38 | scanning engine. | |
39 | ||
40 | %prep | |
41 | %setup -q -n mod_%{mod_name}-%{snap} | |
42 | ||
43 | %build | |
44 | %{apxs} -c mod_%{mod_name}/mod_%{mod_name}.c -o mod_%{mod_name}.la | |
45 | ||
46 | %install | |
47 | rm -rf $RPM_BUILD_ROOT | |
48 | install -d $RPM_BUILD_ROOT{%{_pkglibdir},%{_sysconfdir}} | |
49 | ||
50 | install .libs/mod_%{mod_name}.so $RPM_BUILD_ROOT%{_pkglibdir}/mod_%{mod_name}.so | |
51 | install mod_%{mod_name}/mod_%{mod_name}.conf $RPM_BUILD_ROOT%{_sysconfdir}/33_mod_cgroup.conf | |
52 | ||
53 | %clean | |
54 | rm -rf $RPM_BUILD_ROOT | |
55 | ||
56 | %post | |
57 | %service -q httpd restart | |
58 | ||
59 | %postun | |
60 | if [ "$1" = "0" ]; then | |
61 | %service -q httpd restart | |
62 | fi | |
63 | ||
64 | %files | |
65 | %defattr(644,root,root,755) | |
66 | %doc README.md | |
67 | %attr(640,root,root) %config(noreplace) %verify(not md5 mtime size) %{_sysconfdir}/*_mod_%{mod_name}.conf | |
68 | %attr(755,root,root) %{_pkglibdir}/mod_cgroup.so |