diff --git a/.gitignore b/.gitignore index 639b68e..d86c295 100644 --- a/.gitignore +++ b/.gitignore @@ -16,3 +16,4 @@ /mom-0.5.5.tar.gz /mom-0.5.6.tar.gz /mom-0.5.12.tar.gz +/mom-0.5.13.tar.gz diff --git a/mom.spec b/mom.spec index c0335a2..a3f2241 100644 --- a/mom.spec +++ b/mom.spec @@ -1,21 +1,31 @@ -%{!?python_sitelib: %global python_sitelib %(%{__python} -c "from distutils.sysconfig import get_python_lib; print(get_python_lib())")} %{!?_pkgdocdir: %global _pkgdocdir %{_docdir}/%{name}-%{version}} +%{!?with_check: %global with_check 1} -%global package_version 0.5.12 +%global package_version 0.5.13 %global package_name mom +%if 0%{?fedora} >= 30 || 0%{?rhel} >= 8 +%global python_interpreter %{__python3} +%global python_target_version python3 +%global python_sitelib %{python3_sitelib} +%else +%global python_interpreter %{__python2} +%global python_target_version python2 +%global python_sitelib %{python2_sitelib} +%endif + Name: %{package_name} -Version: 0.5.12 +Version: 0.5.13 Release: 1%{?dist} Summary: Dynamically manage system resources on virtualization hosts License: GPLv2 URL: http://www.ovirt.org -Source: https://resources.ovirt.org/pub/src/%{package_name}/%{package_name}-%{package_version}.tar.gz - +Source: https://resources.ovirt.org/pub/src/%{name}/%{package_name}-%{package_version}.tar.gz BuildArch: noarch -BuildRequires: python2-devel -BuildRequires: python2-nose +BuildRequires: %{python_target_version}-devel +BuildRequires: %{python_target_version}-nose +BuildRequires: %{python_target_version}-mock Requires(post): systemd Requires(preun): systemd @@ -29,7 +39,12 @@ Requires: libvirt-daemon-driver-qemu %else Requires: libvirt %endif -Requires: python2-libvirt +%if 0%{?fedora} +Requires: %{python_target_version}-libvirt +%else +Requires: libvirt-python +Requires: python-six +%endif Requires: procps @@ -48,25 +63,25 @@ designed to accommodate new mechanisms such as cgroups. %prep %setup -q -n %{package_name}-%{package_version} -sed -i "s:/usr/bin/env python:/usr/bin/python2:" \ - contrib/mom-rpcclient.py \ - momd %build -%configure --docdir="%{_pkgdocdir}" +%configure \ + PYTHON="%{python_interpreter}" \ + --docdir="%{_pkgdocdir}" make %{?_smp_mflags} %install -rm -rf "%{buildroot}" make DESTDIR="%{buildroot}" install install -dm 755 %{buildroot}%{_unitdir} -mv contrib/momd.service %{buildroot}%{_unitdir} +install contrib/momd.service %{buildroot}%{_unitdir} install -d -m 0755 "%{buildroot}/%{_sysconfdir}" install -m 0644 doc/mom-balloon+ksm.conf "%{buildroot}/%{_sysconfdir}/momd.conf" %check -#make check %{?_smp_mflags} +%if 0%{with_check} +make check %{?_smp_mflags} +%endif %post %systemd_post momd.service @@ -79,18 +94,22 @@ install -m 0644 doc/mom-balloon+ksm.conf "%{buildroot}/%{_sysconfdir}/momd.conf" %files %config(noreplace) %{_sysconfdir}/momd.conf -%doc COPYING +%license COPYING %doc README %dir %{_pkgdocdir}/examples %{_pkgdocdir}/examples/* +# COPYING is handled by license macro, avoid to ship duplicates +%exclude %{_pkgdocdir}/COPYING %{_unitdir}/momd.service %{_sbindir}/momd -%{python2_sitelib}/mom/ - +%{python_sitelib}/mom/ %changelog +* Tue Jul 02 2019 Sandro Bonazzola - 0.5.13-1 +- Rebase on upstream 0.5.13 + * Fri Jun 14 2019 Sandro Bonazzola - 0.5.12-1 - Rebase on upstream 0.5.12 diff --git a/sources b/sources index f23231e..d5d8413 100644 --- a/sources +++ b/sources @@ -1 +1 @@ -SHA512 (mom-0.5.12.tar.gz) = 937eb66e6d16b2ae5a2f930ce0492084260953dd232a9ca94be0468cb83b7bee659a51bec71373e002addb725c2f80c95cda1c33dc8d2914b5bc325b1ddc6add +SHA512 (mom-0.5.13.tar.gz) = deaaa6bf780da37dcd6e228245e00d464e1e4310e020afa08bcd688e70d48043b8e77b59b977903758399d0ba2b594c4d3ff9b5ac747d984b62f5844ad076a68