-
Notifications
You must be signed in to change notification settings - Fork 2
/
reaper.spec
111 lines (92 loc) · 3.1 KB
/
reaper.spec
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
%{!?python_sitelib: %global python_sitelib %(%{__python} -c "from distutils.sysconfig import get_python_lib; print (get_python_lib())")}
Name: reaper
Version: 1.5.3
Release: 1%{?dist}
Summary: Shared resources controller
License: Apache
URL: http://github.com/lviana/reaper
Source0: reaper-%{version}.tar.bz2
%if 0%{?fedora} < 17 && 0%{?rhel} < 7
Requires (post): chkconfig
%else
Requires (post): systemd
%endif
BuildRequires: python, python-devel, python-setuptools
Requires: python, libcgroup, PyYAML, daemon
%description
Reaper is a resource controller for shared hosting environments, it
supports both native implementations of application servers or
Cpanel based shared hosting infrastructure.
It is easy to be extended or adapted to run on other platforms.
%prep
%setup -q -n reaper
%build
%{__python} setup.py build
%pre
%if 0%{?fedora} < 17 && 0%{?rhel} < 7
if [ -e "/etc/init.d/reaperd" ]; then
/usr/sbin/service reaperd stop
fi
%else
if [ -e "/usr/lib/systemd/system/reaperd.service" ]; then
/usr/bin/systemctl stop reaperd
fi
%endif
%preun
%if 0%{?fedora} < 17 && 0%{?rhel} < 7
#Check if it is an uninstall or an upgrade
if [ $1 -eq 0 ]; then
#package removal
/sbin/chkconfig --del reaperd
fi
%else
/usr/bin/systemctl disable reaperd
%endif
%post
%if 0%{?fedora} < 17 && 0%{?rhel} < 7
/sbin/chkconfig --add reaperd
/etc/init.d/reaperd restart
%else
/usr/bin/systemctl enable reaperd
/usr/bin/systemctl start reaperd
%endif
%install
%{__python} setup.py install --skip-build --root $RPM_BUILD_ROOT
%if 0%{?fedora} < 17 && 0%{?rhel} < 7
%{__install} -D -m 0755 scripts/reaper.init $RPM_BUILD_ROOT%{_initrddir}/reaperd
%else
%{__install} -d -m 0755 $RPM_BUILD_ROOT/usr/lib/systemd/system/
%{__install} -D -m 0755 -v scripts/reaperd.service $RPM_BUILD_ROOT/usr/lib/systemd/system/
%endif
%files
%attr(0640,root,root) %config(noreplace) %{_sysconfdir}/reaper.cfg
%attr(0755,root,root) %{_bindir}/reaperd
%attr(0750,root,root) %{_bindir}/reaper
%if 0%{?fedora} < 17 && 0%{?rhel} < 7
%{python_sitelib}/reaper-%{version}-py2.6.egg-info
%attr(0755,root,root) %{_initrddir}/reaperd
%else
%{python_sitelib}/reaper-%{version}-py2.7.egg-info
%attr(0755,root,root) /usr/lib/systemd/system/reaperd.service
%endif
%defattr(0644,root,root,-)
%{python_sitelib}/reaper/cgroups.py*
%{python_sitelib}/reaper/__init__.py*
%{python_sitelib}/reaper/collectors/*
%changelog
* Wed Sep 09 2015 Luiz Viana <[email protected]> - 1.5.3
- Add cpu limit on local MySQL by default
* Mon Apr 06 2015 Luiz Viana <[email protected]> - 1.4.1-1
- CPU accounting ratio enabled on command line output
* Wed Apr 01 2015 Luiz Viana <[email protected]> - 1.4-1
- CPU accounting enabled on all groups
- Removed group prefix (g_)
* Thu Feb 26 2015 Luiz Viana <[email protected]> - 1.3-1
- Processor usage reporting enabled
* Tue Feb 24 2015 Luiz Viana <[email protected]> - 1.2-1
- Command line monitoring tool enabled
* Wed Feb 18 2015 Luiz Viana <[email protected]> - 1.1-1
- Added Plesk support
- Debian compatibility added on functions
* Tue Sep 9 2014 Luiz Viana <[email protected]> - 1.0-1
- Initial release