%global pypi_name requests-unixsocket %if %{?fedora} %global with_python3 1 %endif Name: python-%{pypi_name} Version: 0.1.5 Release: 1%{?dist} Summary: Use requests to talk HTTP via a UNIX domain socket License: ASL 2.0 URL: https://github.com/msabramo/requests-unixsocket Source0: https://pypi.python.org/packages/source/r/%{pypi_name}/%{pypi_name}-%{version}.tar.gz BuildArch: noarch %description %{summary} %package -n python2-%{pypi_name} Summary: Use requests to talk HTTP via a UNIX domain socket %{?python_provide:%python_provide python2-%{pypi_name}} BuildRequires: python2-devel BuildRequires: python-setuptools BuildRequires: python-pbr BuildRequires: python-pytest BuildRequires: python-waitress Requires: python-requests %description -n python2-%{pypi_name} %{summary} %if 0%{?with_python3} %package -n python3-%{pypi_name} Summary: Use requests to talk HTTP via a UNIX domain socket %{?python_provide:%python_provide python3-%{pypi_name}} BuildRequires: python3-devel BuildRequires: python3-setuptools BuildRequires: python3-pbr BuildRequires: python3-pytest BuildRequires: python3-waitress Requires: python3-requests %description -n python3-%{pypi_name} %{summary} %endif %prep %autosetup -n %{pypi_name}-%{version} # Remove bundled egg-info rm -rf %{pypi_name}.egg-info %build %py2_build %if 0%{?with_python3} %py3_build %endif %install # Must do the subpackages' install first because the scripts in /usr/bin are # overwritten with every setup.py install. %if 0%{?with_python3} %py3_install %endif %py2_install %check %{__python2} setup.py test %if 0%{?with_python3} %{__python3} setup.py test %endif %files -n python2-%{pypi_name} %doc README.rst %license LICENSE %{python2_sitelib}/requests_unixsocket %{python2_sitelib}/requests_unixsocket-%{version}-py?.?.egg-info %if 0%{?with_python3} %files -n python3-%{pypi_name} %doc README.rst LICENSE %{python3_sitelib}/requests_unixsocket %{python3_sitelib}/requests_unixsocket-%{version}-py?.?.egg-info %endif %changelog * Tue Mar 8 2016 Haïkel Guémar - 0.1.5-1 - Initial package.