%global pyname cloudflare %if 0%{?rhel} && 0%{?rhel} <= 7 %bcond_with python3 %else %bcond_without python3 %endif Name: python-%{pyname} Version: 2.0.4 Release: 1%{?dist} Summary: Python wrapper for the Cloudflare Client API v4 License: MIT URL: https://pypi.python.org/pypi/cloudflare Source0: https://files.pythonhosted.org/packages/source/c/%{pyname}/%{pyname}-%{version}.tar.gz BuildArch: noarch BuildRequires: python2-devel BuildRequires: python2-future BuildRequires: python2-setuptools %if 0%{?fedora} > 27 BuildRequires: python2-pyyaml %else BuildRequires: PyYAML %endif %if 0%{?rhel} && 0%{?rhel} <= 7 # EL7 has an unversioned name for this package BuildRequires: python-requests %else BuildRequires: python2-requests %endif %if %{with python3} BuildRequires: python3-devel BuildRequires: python3-future BuildRequires: python3-PyYAML BuildRequires: python3-requests BuildRequires: python3-setuptools %endif %description Python wrapper library for the Cloudflare Client API v4. %package -n python2-%{pyname} Requires: python2-future %if 0%{?fedora} > 27 Requires: python2-pyyaml %else Requires: PyYAML %endif %if 0%{?rhel} && 0%{?rhel} <= 7 # EL7 has an unversioned name for this package Requires: python-requests %else Requires: python2-requests %endif Summary: %{summary} %{?python_provide:%python_provide python2-%{pyname}} %description -n python2-%{pyname} Python wrapper library for the Cloudflare Client API v4. This is the Python 2 version of the package. %if %{with python3} %package -n python3-%{pyname} BuildRequires: python3-future BuildRequires: python3-PyYAML BuildRequires: python3-requests Summary: %{summary} %{?python_provide:%python_provide python3-%{pyname}} %description -n python3-%{pyname} Python wrapper library for the Cloudflare Client API v4. This is the Python 3 version of the package. %endif %prep %autosetup -p1 -n %{pyname}-%{version} %build %py2_build %if %{with python3} %py3_build %endif %check %{__python2} setup.py test %if %{with python3} %{__python3} setup.py test %endif %install %py2_install rm -rf %{buildroot}%{python2_sitelib}/examples %if %{with python3} %py3_install rm -rf %{buildroot}%{python3_sitelib}/examples %endif %files -n python2-%{pyname} %license LICENSE %doc README.rst %if ! %{with python3} %{_bindir}/cli4 %endif %{python2_sitelib}/cli4 %{python2_sitelib}/CloudFlare %{python2_sitelib}/cloudflare-%{version}*.egg-info %if %{with python3} %files -n python3-%{pyname} %license LICENSE %doc README.rst %{_bindir}/cli4 %{python3_sitelib}/cli4 %{python3_sitelib}/CloudFlare %{python3_sitelib}/cloudflare-%{version}*.egg-info %endif %changelog * Fri Feb 16 2018 Eli Young - 2.0.4-1 - Initial package