%global srcname prettytable %global sum Table Pretty Printing Library Name: python-%{srcname} Version: 0.7.2 Release: 1%{?dist} Summary: %{sum} License: BSD URL: https://pypi.python.org/pypi/PrettyTable Source0: https://pypi.python.org/packages/ef/30/4b0746848746ed5941f052479e7c23d2b56d174b82f4fd34a25e389831f5/%{srcname}-%{version}.tar.bz2 BuildArch: noarch BuildRequires: python2-devel python3-devel %description PrettyTable is a simple Python library designed to make it quick and easy to represent tabular data in visually appealing ASCII tables. %package -n python2-%{srcname} Summary: %{sum} %{?python_provide:%python_provide python2-%{srcname}} %description -n python2-%{srcname} PrettyTable is a simple Python library designed to make it quick and easy to represent tabular data in visually appealing ASCII tables. %package -n python3-%{srcname} Summary: %{sum} %{?python_provide:%python_provide python3-%{srcname}} %description -n python3-%{srcname} PrettyTable is a simple Python library designed to make it quick and easy to represent tabular data in visually appealing ASCII tables. %prep %autosetup -n %{srcname}-%{version} %build %py2_build %py3_build %install # Must do the python2 install first because the scripts in /usr/bin are # overwritten with every setup.py install, and in general we want the # python3 version to be the default. # If, however, we're installing separate executables for python2 and python3, # the order needs to be reversed so the unversioned executable is the python2 one. %py2_install %py3_install %check %{__python2} setup.py test %{__python3} setup.py test # Note that there is no %%files section for the unversioned python module if we are building for several python runtimes %files -n python2-%{srcname} %license COPYING %doc README %{python2_sitelib}/* %files -n python3-%{srcname} %license COPYING %doc README %{python3_sitelib}/* %changelog * Sun Mar 25 2018 Thomas Sailer - 0.7.2-1 - initial spec file