%global pypi_name incremental %if 0%{?fedora} %global with_python3 1 %endif Name: python-%{pypi_name} Version: 17.5.0 Release: 1%{?dist} Summary: It versions your Python projects License: MIT URL: https://github.com/twisted/incremental Source0: https://files.pythonhosted.org/packages/source/i/%{pypi_name}/%{pypi_name}-%{version}.tar.gz BuildArch: noarch BuildRequires: python2-devel BuildRequires: python2-setuptools %if 0%{?with_python3} BuildRequires: python3-devel BuildRequires: python3-setuptools %endif %description Incremental is a small library that versions your Python projects. %package -n python2-%{pypi_name} Summary: %{summary} %{?python_provide:%python_provide python2-%{pypi_name}} %description -n python2-%{pypi_name} Incremental is a small library that versions your Python projects. %if 0%{?with_python3} %package -n python3-%{pypi_name} Summary: %{summary} %{?python_provide:%python_provide python3-%{pypi_name}} %description -n python3-%{pypi_name} Incremental is a small library that versions your Python projects. %endif %prep %autosetup -n %{pypi_name}-%{version} # Remove bundled egg-info rm -rf %{pypi_name}.egg-info %build %py2_build %if 0%{?with_python3} %py3_build %endif %install %if 0%{?with_python3} %py3_install %endif %py2_install %files -n python2-%{pypi_name} %license LICENSE %doc README.rst %{python2_sitelib}/%{pypi_name} %{python2_sitelib}/%{pypi_name}-%{version}-py?.?.egg-info %if 0%{?with_python3} %files -n python3-%{pypi_name} %license LICENSE %doc README.rst %{python3_sitelib}/%{pypi_name} %{python3_sitelib}/%{pypi_name}-%{version}-py?.?.egg-info %endif %changelog * Fri Aug 11 2017 Yatin Karel - 17.5.0-1 - Initial package.