%if 0%{?fedora} || 0%{?rhel} >= 8
%bcond_without python3
%else # 0#{?fedora} || 0#{?rhel} >= 8
%bcond_with python3
%endif # 0#{?fedora} || 0#{?rhel} >= 8
%global sum Python bindings for xapps
Name: python-xapp
Version: 1.0.1
Release: 4%{?dist}
Summary: %{sum}
License: LGPLv2
URL: https://github.com/linuxmint/%{name}
Source0: %{url}/archive/%{version}.tar.gz#/%{name}-%{version}.tar.gz
Patch0: %{url}/pull/5.patch#/%{name}-1.0.1-setup_py_ver.patch
BuildArch: noarch
%description
%{sum}.
%package -n python2-xapp
Summary: %{sum}
BuildRequires: python2-devel
BuildRequires: python2-setuptools
%if 0%{?fedora} || 0%{?rhel} >= 8
Requires: python2-psutil
%else # 0#{?fedora} || 0#{?rhel} >= 8
Requires: python-psutil
%endif # 0#{?fedora} || 0#{?rhel} >= 8
%{?python_provide:%python_provide python2-xapp}
%description -n python2-xapp
%{sum}.
%if %{with python3}
%package -n python3-xapp
Summary: %{sum}
BuildRequires: python3-devel
BuildRequires: python3-setuptools
Requires: python3-psutil
%{?python_provide:%python_provide python3-xapp}
%description -n python3-xapp
%{sum}.
%endif # with python3
%prep
%autosetup -p 1
%build
%py2_build
%if %{with python3}
%py3_build
%endif # with python3
%install
%py2_install
%if %{with python3}
%py3_install
%endif # with python3
%files -n python2-xapp
%license COPYING debian/copyright
%doc AUTHORS PKG-INFO README TODO debian/changelog
%{python2_sitelib}/xapp
%{python2_sitelib}/python_xapp-%{version}-py%{python2_version}.egg-info
%if %{with python3}
%files -n python3-xapp
%license COPYING debian/copyright
%doc AUTHORS PKG-INFO README TODO debian/changelog
%{python3_sitelib}/xapp
%{python3_sitelib}/python_xapp-%{version}-py%{python3_version}.egg-info
%endif # with python3
%changelog
* Tue Aug 29 2017 Björn Esser <besser82@fedoraproject.org> - 1.0.1-4
- Fix for EPEL
* Tue Aug 29 2017 Björn Esser <besser82@fedoraproject.org> - 1.0.1-3
- Conditionalize Python3 for EPEL
* Thu Jul 27 2017 Fedora Release Engineering <releng@fedoraproject.org> - 1.0.1-2
- Rebuilt for https://fedoraproject.org/wiki/Fedora_27_Mass_Rebuild
* Tue Jun 13 2017 Björn Esser <besser82@fedoraproject.org> - 1.0.1-1
- Update to 1.0.1 release (rhbz#1460408)
* Mon May 01 2017 Leigh Scott <leigh123linux@gmail.com> - 1.0.0-1
- Initial rpm-release (rhbz#1448559)