diff --git a/python-cov-core.spec b/python-cov-core.spec index 60f9a92..c0d86ec 100644 --- a/python-cov-core.spec +++ b/python-cov-core.spec @@ -6,6 +6,14 @@ This is a lib package for use by pytest-cov, nose-cov and nose2-cov. \ If youre developing a coverage plugin for a test framework then you \ probably want one of those. +# EPEL7 support: Python2 packages prefix is unversioned. +%if 0%{?rhel} && 0%{?rhel} <= 7 +%global py2_namespace python +%else +%global py2_namespace python2 +%endif + + Name: python-%{pypi_name} Version: 1.15.0 Release: 6%{?dist} @@ -24,16 +32,30 @@ BuildRequires: python-srpm-macros BuildRequires: python%{python3_pkgversion}-devel BuildRequires: python%{python3_pkgversion}-setuptools %if 0%{?with_python3_other} -BuildRequires: python%{python3_other_pkgversion}-devel -BuildRequires: python%{python3_other_pkgversion}-setuptools +BuildRequires: python%{python3_other_pkgversion}-devel +BuildRequires: python%{python3_other_pkgversion}-setuptools %endif +%if %{py2_namespace} == python Requires: python-coverage >= 3.6 +%endif + %{?python_provide:%python_provide python-%{pypi_name}} %description %{_description} +# Python 2 +%if %{py2_namespace} != python +%package -n %{py2_namespace}-%{pypi_name} +Summary: %{summary} +%{?python_provide:%python_provide %{py2_namespace}-%{pypi_name}} +Requires: %{py2_namespace}-coverage >= 3.6 + +%description -n %{py2_namespace}-%{pypi_name} %{_description} +%endif + + # Python3 %package -n python%{python3_pkgversion}-%{pypi_name} Summary: %{summary} @@ -78,7 +100,7 @@ rm -rf %{pypi_name}.egg-info %py2_install -%files +%files -n %{py2_namespace}-%{pypi_name} %license LICENSE.txt %doc README.rst %{python2_sitelib}/cov_core* @@ -102,6 +124,7 @@ rm -rf %{pypi_name}.egg-info %changelog * Tue Apr 25 2017 Aurelien Bompard - 1.15.0-6 - Build the Python3 version in EPEL. +- Use the proper Python namespace. * Sat Feb 11 2017 Fedora Release Engineering - 1.15.0-5 - Rebuilt for https://fedoraproject.org/wiki/Fedora_26_Mass_Rebuild