%global pypi_name textfsm Name: python-%{pypi_name} Version: 0.3.2 Release: 2%{?dist} Summary: Python module for parsing semi-structured text into python tables License: ASL 2.0 URL: https://github.com/google/textfsm Source0: https://files.pythonhosted.org/packages/source/t/%{pypi_name}/%{pypi_name}-%{version}.tar.gz # https://github.com/google/textfsm/issues/26 Source1: COPYING BuildArch: noarch BuildRequires: python-rpm-macros BuildRequires: python2-rpm-macros BuildRequires: python3-rpm-macros BuildRequires: python-srpm-macros %description Python module which implements a template based state machine for parsing semi-formatted text. Originally developed to allow programmatic access to information returned from the command line interface (CLI) of networking devices. %package -n python2-%{pypi_name} Summary: %{summary} %{?python_provide:%python_provide python2-%{pypi_name}} BuildRequires: python2-devel BuildRequires: python2-setuptools Requires: python2-six %description -n python2-%{pypi_name} Python module which implements a template based state machine for parsing semi-formatted text. Originally developed to allow programmatic access to information returned from the command line interface (CLI) of networking devices. %package -n python%{python3_pkgversion}-%{pypi_name} Summary: %{summary} %{?python_provide:%python_provide python%{python3_pkgversion}-%{pypi_name}} BuildRequires: python%{python3_pkgversion}-devel BuildRequires: python%{python3_pkgversion}-setuptools Requires: python%{python3_pkgversion}-six %description -n python%{python3_pkgversion}-%{pypi_name} Python module which implements a template based state machine for parsing semi-formatted text. Originally developed to allow programmatic access to information returned from the command line interface (CLI) of networking devices. %prep %autosetup -n %{pypi_name}-%{version} # Remove bundled egg-info rm -rf %{pypi_name}.egg-info # License is missing from the tarball, see https://github.com/google/textfsm/issues/26 cp %{SOURCE1} . %build %py2_build %py3_build %install %py3_install %py2_install %check %{__python2} setup.py test %{__python3} setup.py test %files -n python2-%{pypi_name} %license COPYING %{python2_sitelib}/copyable_regex_object.py* %{python2_sitelib}/%{pypi_name}.py* %{python2_sitelib}/terminal.py* %{python2_sitelib}/clitable.py* %{python2_sitelib}/texttable.py* %{python2_sitelib}/%{pypi_name}-%{version}-py?.?.egg-info %files -n python%{python3_pkgversion}-%{pypi_name} %license COPYING %{python3_sitelib}/__pycache__/* %{python3_sitelib}/copyable_regex_object.py %{python3_sitelib}/%{pypi_name}.py %{python3_sitelib}/terminal.py %{python3_sitelib}/clitable.py %{python3_sitelib}/texttable.py %{python3_sitelib}/%{pypi_name}-%{version}-py?.?.egg-info %changelog * Wed Sep 26 2018 Michal Ingeli - 0.3.2-2 - Enabled python3 EPEL build. * Fri Mar 16 2018 Javier Peña - 0.3.2-1 - Initial package.