forked from oVirt/mom
-
Notifications
You must be signed in to change notification settings - Fork 0
/
mom.spec.in
123 lines (91 loc) · 3.91 KB
/
mom.spec.in
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
112
113
114
115
116
117
118
119
120
121
122
123
%{!?python_sitelib: %global python_sitelib %(%{__python} -c "from distutils.sysconfig import get_python_lib; print(get_python_lib())")}
Name: mom
Version: @PACKAGE_VERSION@
Release: @PACKAGE_RELEASE@%{?dist}%{?extra_release}
Summary: Dynamically manage system resources on virtualization hosts
Group: Applications/System
License: GPLv2
URL: http://wiki.github.com/aglitke/mom
Source0: %{name}-%{version}.tar.gz
BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}-root-%(%{__id_u} -n)
BuildArch: noarch
BuildRequires: python-devel
BuildRequires: python-nose
# MOM makes use of libvirt by way of the python bindings to monitor and
# interact with virtual machines.
Requires: libvirt, libvirt-python
Requires(post): chkconfig
Requires(postun): initscripts
Requires(preun): chkconfig
Requires(preun): initscripts
%description
MOM is a policy-driven tool that can be used to manage overcommitment on KVM
hosts. Using libvirt, MOM keeps track of active virtual machines on a host. At
a regular collection interval, data is gathered about the host and guests. Data
can come from multiple sources (eg. the /proc interface, libvirt API calls, a
client program connected to a guest, etc). Once collected, the data is
organized for use by the policy evaluation engine. When started, MOM accepts a
user-supplied overcommitment policy. This policy is regularly evaluated using
the latest collected data. In response to certain conditions, the policy may
trigger reconfiguration of the system’s overcommitment mechanisms. Currently
MOM supports control of memory ballooning and KSM but the architecture is
designed to accommodate new mechanisms such as cgroups.
%prep
%setup -q
%build
%{__python} setup.py build
%install
rm -rf $RPM_BUILD_ROOT
%{__python} setup.py install -O1 --skip-build --root $RPM_BUILD_ROOT
install -Dp contrib/momd.init $RPM_BUILD_ROOT/%{_initrddir}/momd
cp $RPM_BUILD_ROOT/%{_defaultdocdir}/%{name}/examples/mom-balloon+ksm.conf \
$RPM_BUILD_ROOT/%{_sysconfdir}/momd.conf
# Correct the installed location of documentation files
mv $RPM_BUILD_ROOT/%{_defaultdocdir}/%{name} \
$RPM_BUILD_ROOT/%{_defaultdocdir}/%{name}-%{version}
cp COPYING README $RPM_BUILD_ROOT/%{_defaultdocdir}/%{name}-%{version}
%clean
rm -rf $RPM_BUILD_ROOT
%post
/sbin/chkconfig --add momd
%preun
if [ $1 = 0 ] ; then
/sbin/service momd stop >/dev/null 2>&1
/sbin/chkconfig --del momd
fi
%postun
if [ "$1" -ge "1" ] ; then
/sbin/service momd condrestart >/dev/null 2>&1 || :
fi
%files
%defattr(-,root,root,-)
%{_sbindir}/momd
%{_initrddir}/momd
%{python_sitelib}/*
%config(noreplace) %{_sysconfdir}/momd.conf
# The use of '_defaultdocdir' conflicts with 'doc'. Therefore, 'doc' MUST NOT
# be used to include additional documentation files so long as this is in use.
%{_defaultdocdir}/%{name}-%{version}/
%changelog
* Fri Oct 05 2012 Adam Litke <agl@us.ibm.com> - 0.3.0-1
- Upgrade to version 0.3.0
- Upstream fixes CVE-2012-4480
* Fri Jul 20 2012 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 0.2.2-2
- Rebuilt for https://fedoraproject.org/wiki/Fedora_18_Mass_Rebuild
* Thu Jan 12 2011 Adam Litke <agl@us.ibm.com> - 0.2.2-1
- Upgrade to version 0.2.2
- Packaging related changes merged upstream so patches dropped
* Fri Jan 7 2011 Adam Litke <agl@us.ibm.com> - 0.2.1-5
- Address review comments by Michael Schwendt
- Fix use of _defaultdocdir macro
- Add some comments to the spec file
* Tue Oct 26 2010 Adam Litke <agl@us.ibm.com> - 0.2.1-4
- Third round of package review comments
- Remove useless shebang on non-executable python script
* Tue Oct 26 2010 Adam Litke <agl@us.ibm.com> - 0.2.1-3
- Second round of package review comments
- Add a default config file: /etc/momd.conf
* Wed Oct 13 2010 Adam Litke <agl@us.ibm.com> - 0.2.1-2
- Address initial package review comments
* Mon Sep 27 2010 Adam Litke <agl@us.ibm.com> - 0.2.1-1
- Initial package