Name:           python-rpmUtils
Version:        0.1
Release:        1%{?dist}
Summary:        python rpmUtils

License:        GPLv2+
URL:            http://yum.baseurl.org/api/yum/rpmUtils/miscutils.html
Source0:        rpmUtils-%{version}.tar.bz2
BuildArch:      noarch

%description
taken from yum with slightly adaptions in Makefile
Needed for eg. repoview, or for checking rpm-versions (taken from 
https://stackoverflow.com/questions/3206319/how-do-i-compare-rpm-versions-in-python):

import rpmUtils.miscutils
>>> rpmUtils.miscutils.compareEVR(("foo", "3.7.4", "1"), ("foo", "3.7.4", "1"))
0
>>> rpmUtils.miscutils.compareEVR(("foo", "3.7.4", "1"), ("foo", "3.7.4a", "1")) 
-1
>>> rpmUtils.miscutils.compareEVR(("foo", "3.7.4a", "1"), ("foo", "3.7.4", "1")) 
1

%package -n python2-rpmUtils
Summary:        %{summary}
%{?python_provide:%python_provide python2-rpmUtils}
BuildRequires:  python2-devel
BuildRequires:  make

%description -n python2-rpmUtils
%{description}

Python 2 version.

%prep
%autosetup -n rpmUtils-%{version}

%build
# empty

%install
make DESTDIR=$RPM_BUILD_ROOT install

%files -n python2-rpmUtils
%{python2_sitelib}/rpmUtils/*
%dir %{python2_sitelib}/rpmUtils/

%changelog
* Sat Mar 14 2020 josef radinger <cheese@nosuchhost.net> - 0.1-2
- add URL

* Thu Dec 05 2019 josef radinger <cheese@nosuchhost.net> - 0.1-1
- initial version