diff --git a/clustershell.spec b/clustershell.spec index c2ab3b1..8dd9c6d 100644 --- a/clustershell.spec +++ b/clustershell.spec @@ -1,11 +1,21 @@ -%global srcname ClusterShell - %{!?python2_shortver: %global python2_shortver %(%{__python2} -c 'import sys; print(str(sys.version_info.major) + "." + str(sys.version_info.minor))')} %{!?python3_shortver: %global python3_shortver %(%{__python3} -c 'import sys; print(str(sys.version_info.major) + "." + str(sys.version_info.minor))')} +%if 0%{?fedora} >= 22 +%{!?python2_pkgversion: %global python2_pkgversion 2} +%global python2_pkgprefix python%{python2_pkgversion} +%else +%global python2_pkgprefix python +%endif + +%{!?python3_pkgversion: %global python3_pkgversion 3} +%global python3_pkgprefix python%{python3_pkgversion} + +%global srcname ClusterShell + Name: clustershell Version: 1.7.81 -Release: 2%{?dist} +Release: 3%{?dist} Summary: Python framework for efficient cluster administration License: LGPLv2+ @@ -27,11 +37,10 @@ offered by the library. %package -n python2-%{name} Summary: ClusterShell module for Python 2 -BuildRequires: python-devel -BuildRequires: python-setuptools -Requires: python-setuptools +BuildRequires: %{python2_pkgprefix}-devel +BuildRequires: %{python2_pkgprefix}-setuptools +Requires: %{python2_pkgprefix}-setuptools Requires: PyYAML - %{?python_provide:%python_provide python2-%{name}} %description -n python2-%{name} @@ -41,12 +50,11 @@ ClusterShell Python 2 module and related command line tools. %package -n python%{python3_pkgversion}-%{name} Summary: ClusterShell module for Python 3 -BuildRequires: python%{python3_pkgversion}-devel -BuildRequires: python%{python3_pkgversion}-setuptools -Requires: python%{python3_pkgversion}-setuptools -Requires: python%{python3_pkgversion}-PyYAML - -%{?python_provide:%python_provide python%{python3_pkgversion}-%{srcname}} +BuildRequires: %{python3_pkgprefix}-devel +BuildRequires: %{python3_pkgprefix}-setuptools +Requires: %{python3_pkgprefix}-setuptools +Requires: %{python3_pkgprefix}-PyYAML +%{?python_provide:%python_provide %{python3_pkgprefix}-%{srcname}} %description -n python%{python3_pkgversion}-%{name} ClusterShell Python 3 module and related command line tools. @@ -54,7 +62,6 @@ ClusterShell Python 3 module and related command line tools. %package -n vim-%{name} Summary: VIM files for ClusterShell -Group: System Environment/Base Requires: clustershell = %{version}-%{release}, vim-common %description -n vim-%{name} @@ -148,6 +155,9 @@ rm -rf %{buildroot} %{vimdatadir}/syntax/groupsconf.vim %changelog +* Sat Sep 2 2017 Stephane Thiell 1.7.81-3 +- use `python2-` prefix in *Requires if available + * Sat Sep 2 2017 Stephane Thiell 1.7.81-2 - create separate packages for python2 and python3 modules