%global pypi_name gast Name: python-%{pypi_name} Version: 0.2.2 Release: 1%{?dist} Summary: Python AST that abstracts the underlying Python version License: BSD 3-Clause URL: https://github.com/serge-sans-paille/gast/ Source0: https://files.pythonhosted.org/packages/source/g/%{pypi_name}/%{pypi_name}-%{version}.tar.gz BuildArch: noarch %if 0%{?fedora} BuildRequires: python2-devel BuildRequires: python2dist(astunparse) BuildRequires: python2dist(setuptools) BuildRequires: python3-devel BuildRequires: python3dist(astunparse) BuildRequires: python3dist(setuptools) %else BuildRequires: python2-devel BuildRequires: python2-setuptools BuildRequires: python2-astunparse %{!?python2_sitearch: %global python2_sitearch %(%{__python} -c "from distutils.sysconfig import get_python_lib; print get_python_lib(1)")} %endif %description A generic AST to represent Python2 and Python3's Abstract Syntax Tree(AST).GAST provides a compatibility layer between the AST of various Python versions, as produced by ast.parse from the standard ast module. %package -n python2-%{pypi_name} Summary: %{summary} %{?python_provide:%python_provide python2-%{pypi_name}} %description -n python2-%{pypi_name} A generic AST to represent Python2 and Python3's Abstract Syntax Tree(AST).GAST provides a compatibility layer between the AST of various Python versions, as produced by ast.parse from the standard ast module. %if 0%{?fedora} %package -n python3-%{pypi_name} Summary: %{summary} %{?python_provide:%python_provide python3-%{pypi_name}} %description -n python3-%{pypi_name} A generic AST to represent Python2 and Python3's Abstract Syntax Tree(AST).GAST provides a compatibility layer between the AST of various Python versions, as produced by ast.parse from the standard ast module. %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 - 0.2.2-1 - Initial package.