[mom] Update to mom-0.4.0
aglitke
aglitke at fedoraproject.org
Fri Jan 31 15:44:06 UTC 2014
commit 22797b52ecedc5ffaf6b8caf63395f23ba52d122
Author: Adam Litke <alitke at redhat.com>
Date: Fri Jan 31 10:37:06 2014 -0500
Update to mom-0.4.0
Signed-off-by: Adam Litke <alitke at redhat.com>
mom.spec | 103 +++++++++++++++++++++++++++-----------------------------------
1 files changed, 45 insertions(+), 58 deletions(-)
---
diff --git a/mom.spec b/mom.spec
index 34ec34b..2c7ba95 100644
--- a/mom.spec
+++ b/mom.spec
@@ -1,36 +1,37 @@
%{!?python_sitelib: %global python_sitelib %(%{__python} -c "from distutils.sysconfig import get_python_lib; print(get_python_lib())")}
%{!?_pkgdocdir: %global _pkgdocdir %{_docdir}/%{name}-%{version}}
-Name: mom
-Version: 0.3.2
-Release: 7%{?dist}
-Summary: Dynamically manage system resources on virtualization hosts
-
-Group: Applications/System
-License: GPLv2
-URL: http://www.ovirt.org
-Source0: %{name}-%{version}.tar.gz
-BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}-root-%(%{__id_u} -n)
-BuildArch: noarch
-BuildRequires: python-devel
-BuildRequires: autoconf
-BuildRequires: automake
-BuildRequires: python-nose
+%global package_version 0.4.0
+%global package_name mom
+
+Name: %{package_name}
+Version: 0.4.0
+Release: 1%{?release_suffix}%{?dist}
+Summary: Dynamically manage system resources on virtualization hosts
+
+Group: Applications/System
+License: GPLv2
+URL: http://www.ovirt.org
+Source: %{package_name}-%{package_version}.tar.gz
+BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}
+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.
%if 0%{?fedora} >= 18 || 0%{?rhel} >= 7
-Requires: libvirt-daemon-driver-qemu
+Requires: libvirt-daemon-driver-qemu
%else
-Requires: libvirt
+Requires: libvirt
%endif
-Requires: libvirt-python
-Requires: procps
+Requires: libvirt-python
+Requires: procps
-Requires(post): chkconfig
-Requires(postun): initscripts
-Requires(preun): chkconfig
-Requires(preun): initscripts
+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
@@ -45,66 +46,52 @@ 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
+%setup -q -n %{package_name}-%{package_version}
%build
-echo "v%{version}-%{release}" > VERSION
-autoreconf -if
-%configure
-make
-%{__python} setup.py build
+%configure --docdir="%{_pkgdocdir}"
+make %{?_smp_mflags}
%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
+rm -rf "%{buildroot}"
+make DESTDIR="%{buildroot}" install
-cp -p $RPM_BUILD_ROOT/%{_pkgdocdir}/examples/mom-balloon+ksm.conf \
- $RPM_BUILD_ROOT/%{_sysconfdir}/momd.conf
-cp -p COPYING README $RPM_BUILD_ROOT/%{_pkgdocdir}
+install -d -m 0755 "%{buildroot}/%{_initrddir}"
+install -m 0755 contrib/momd.init "%{buildroot}/%{_initrddir}/momd"
+install -d -m 0755 "%{buildroot}/%{_sysconfdir}"
+install -m 0644 doc/mom-balloon+ksm.conf "%{buildroot}/%{_sysconfdir}/momd.conf"
%check
-# Temporarily disabled while debugging test failures in koji
-# nosetests tests/*.py
-
-%clean
-rm -rf $RPM_BUILD_ROOT
-
+#make check %{?_smp_mflags}
%post
/sbin/chkconfig --add momd
-
%preun
if [ $1 = 0 ] ; then
- /sbin/service momd stop >/dev/null 2>&1
- /sbin/chkconfig --del momd
+ /sbin/service momd stop >/dev/null 2>&1 || true
+ /sbin/chkconfig --del momd || true
fi
-
%postun
if [ "$1" -ge "1" ] ; then
- /sbin/service momd condrestart >/dev/null 2>&1 || :
+ /sbin/service momd condrestart >/dev/null 2>&1 || true
fi
-
%files
-%defattr(-,root,root,-)
-%{_sbindir}/momd
-%{_initrddir}/momd
-%{python_sitelib}/*
%config(noreplace) %{_sysconfdir}/momd.conf
-
-# The use of '_pkgdocdir' conflicts with '%%doc' in some distro versions.
-# Therefore, '%%doc' MUST NOT
-# be used to include additional documentation files so long as this is in use.
-%{_pkgdocdir}/
+%doc COPYING
+%doc README
+%{_initrddir}/momd
+%{_sbindir}/momd
+%{python_sitelib}/mom/
%changelog
+* Fri Jan 31 2014 Adam Litke <alitke at redhat.com> - 0.4.0-1
+- Upgrade to 0.4.0 and update build process
+
* Fri Jan 10 2014 Adam Litke <alitke at redhat.com> - 0.3.2-8
- Sync Fedora spec file with package spec file
More information about the scm-commits
mailing list