%global pypi_name astunparse Name: python-%{pypi_name} Version: 1.6.2 Release: 1%{?dist} Summary: An AST unparser for Python License: BSD URL: https://github.com/simonpercivall/astunparse Source0: https://files.pythonhosted.org/packages/source/a/%{pypi_name}/%{pypi_name}-%{version}.tar.gz BuildArch: noarch %if 0%{?fedora} BuildRequires: python2-devel BuildRequires: python2dist(setuptools) BuildRequires: python2dist(six) < 2.0 BuildRequires: python2dist(six) >= 1.6.1 BuildRequires: python2dist(wheel) < 1.0 BuildRequires: python2dist(wheel) >= 0.23.0 BuildRequires: python3-devel BuildRequires: python3dist(setuptools) BuildRequires: python3dist(six) < 2.0 BuildRequires: python3dist(six) >= 1.6.1 BuildRequires: python3dist(wheel) < 1.0 BuildRequires: python3dist(wheel) >= 0.23.0 %else BuildRequires: python2-devel BuildRequires: python2-setuptools BuildRequires: python2-six < 2.0 BuildRequires: python2-six >= 1.6.1 BuildRequires: python-wheel < 1.0 BuildRequires: python-wheel >= 0.23.0 %{!?python2_sitearch: %global python2_sitearch %(%{__python} -c "from distutils.sysconfig import get_python_lib; print get_python_lib(1)")} %endif %description AST Unparser An AST unparser for Python.This is a factored out version of unparse found in the Python source distribution; under Demo/parser in Python 2 and under Tools/parser in Python 3.Basic example:: import inspect import ast import astunparse %if 0%{?fedora} %package -n python2-%{pypi_name} Summary: %{summary} %{?python_provide:%python_provide python2-%{pypi_name}} Requires: python2dist(six) < 2.0 Requires: python2dist(six) >= 1.6.1 Requires: python2dist(wheel) < 1.0 Requires: python2dist(wheel) >= 0.23.0 %description -n python2-%{pypi_name} AST Unparser An AST unparser for Python.This is a factored out version of unparse found in the Python source distribution; under Demo/parser in Python 2 and under Tools/parser in Python 3.Basic example:: import inspect import ast import astunparse %package -n python3-%{pypi_name} Summary: %{summary} %{?python_provide:%python_provide python3-%{pypi_name}} Requires: python3dist(six) < 2.0 Requires: python3dist(six) >= 1.6.1 Requires: python3dist(wheel) < 1.0 Requires: python3dist(wheel) >= 0.23.0 %description -n python3-%{pypi_name} AST Unparser An AST unparser for Python.This is a factored out version of unparse found in the Python source distribution; under Demo/parser in Python 2 and under Tools/parser in Python 3.Basic example:: import inspect import ast import astunparse %else %package -n python2-%{pypi_name} Summary: %{summary} %{?python_provide:%python_provide python2-%{pypi_name}} Requires: python-six < 2.0 Requires: python-six >= 1.6.1 Requires: python-wheel < 1.0 Requires: python-wheel >= 0.23.0 %description -n python2-%{pypi_name} AST Unparser An AST unparser for Python.This is a factored out version of unparse found in the Python source distribution; under Demo/parser in Python 2 and under Tools/parser in Python 3.Basic example:: import inspect import ast import astunparse %endif %prep %autosetup -n %{pypi_name}-%{version} # Remove bundled egg-info rm -rf %{pypi_name}.egg-info %build %py2_build %if 0%{?fedora} %py3_build %endif %install # Must do the default python version install last because # the scripts in /usr/bin are overwritten with every setup.py install. %py2_install %if 0%{?fedora} %py3_install %endif %check %{__python2} setup.py test %if 0%{?fedora} %{__python3} setup.py test %endif %files -n python2-%{pypi_name} %license LICENSE %doc README.rst %{python2_sitelib}/%{pypi_name} %{python2_sitelib}/%{pypi_name}-%{version}-py?.?.egg-info %if 0%{?fedora} %files -n python3-%{pypi_name} %license LICENSE %doc README.rst %{python3_sitelib}/%{pypi_name} %{python3_sitelib}/%{pypi_name}-%{version}-py?.?.egg-info %endif %changelog * Wed Mar 13 2019 Ruslan Pisarev - 1.6.2-1 - Initial package.