%global srcname mbed-ls %global sum Python module that detects and lists mbed-enabled devices connected to the host computer Name: python-%{srcname} Version: 1.4.0 Release: 1%{?dist} Summary: %{sum} License: ASL 2.0 URL: https://pypi.python.org/pypi/%{srcname} Source0: https://pypi.python.org/packages/a8/4e/bf78efc70d99b638ee1669e3247d19b078d6fc1f0341b55ec57b7b91ca2e/%{srcname}-%{version}.tar.gz BuildArch: noarch BuildRequires: python2-devel python3-devel BuildRequires: python2-appdirs python3-appdirs BuildRequires: python2-fasteners python3-fasteners BuildRequires: python2-prettytable python3-prettytable BuildRequires: python2-pytest python3-pytest BuildRequires: python2-mock python3-mock %description Python module that detects and lists mbed-enabled devices connected to the host computer. %package -n python2-%{srcname} Summary: %{sum} Requires: python2-appdirs Requires: python2-fasteners Requires: python2-prettytable %{?python_provide:%python_provide python2-%{srcname}} %description -n python2-%{srcname} Python module that detects and lists mbed-enabled devices connected to the host computer. %package -n python3-%{srcname} Summary: %{sum} Requires: python3-appdirs Requires: python3-fasteners Requires: python3-prettytable %{?python_provide:%python_provide python3-%{srcname}} %description -n python3-%{srcname} Python module that detects and lists mbed-enabled devices connected to the host computer. %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 rm -rf %{buildroot}/%{python2_sitelib}/test rm -rf %{buildroot}/%{python3_sitelib}/test #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 LICENSE %doc README.md %{python2_sitelib}/* %files -n python3-%{srcname} %license LICENSE %doc README.md %{python3_sitelib}/* %{_bindir}/mbedls %changelog * Sun Mar 25 2018 Thomas Sailer - 1.4.0-1 - initial spec file