%if 0%{?fedora} || 0%{?rhel} > 7 %{lua:posix.setenv("RHEL_ALLOW_PYTHON2_FOR_BUILD", 1)} %global with_python3 1 %endif %bcond_with docs %global srcname statsd Name: python-%{srcname} Version: 3.2.1 Release: 6%{?dist} Summary: A Python statsd client License: MIT URL: https://github.com/jsocol/pystatsd Source0: https://pypi.python.org/packages/source/s/%{srcname}/%{srcname}-%{version}.tar.gz # Apply https://github.com/jsocol/pystatsd/pull/88 Patch0: 0001-Fix-sphinx-extension-conflict.patch BuildArch: noarch BuildRequires: openstack-macros BuildRequires: python2-devel BuildRequires: python2-mock BuildRequires: python2-nose %if 0%{?with_python3} BuildRequires: python3-devel BuildRequires: python3-mock BuildRequires: python3-nose %endif # if with_python3 %description A python client for the statsd daemon. %package -n python2-%{srcname} Summary: %{summary} %{?python_provide:%python_provide python2-%{srcname}} %description -n python2-%{srcname} A python client for the statsd daemon. %if 0%{?with_python3} %package -n python3-%{srcname} Summary: %{summary} %{?python_provide:%python_provide python3-%{srcname}} %description -n python3-%{srcname} A python client for the statsd daemon. %endif %if %{with docs} %package doc Summary: Documentation of the Python client for the statsd daemon BuildRequires: python-sphinx %description doc Documentation of the Python client for the statsd daemon. %endif %prep %autosetup -n %{srcname}-%{version} -p1 # Remove bundled egg-info rm -rf %{srcname}.egg-info # Let RPM handle the dependencies rm -f requirements.txt %build %py2_build %if 0%{?with_python3} %py3_build %endif %if %{with docs} ## generate html docs sphinx-build docs html rm -rf html/.{doctrees,buildinfo} %endif %install %py2_install %if 0%{?with_python3} %py3_install %endif %check %{__python2} setup.py test %if 0%{?with_python3} %{__python3} setup.py test %endif %files -n python2-%{srcname} %license LICENSE %doc AUTHORS README.rst %{python2_sitelib}/* %if 0%{?with_python3} %files -n python3-%{srcname} %license LICENSE %doc AUTHORS README.rst %{python3_sitelib}/* %endif %if %{with docs} %files doc %license LICENSE %doc html %endif %changelog * Fri Jan 18 2019 Shreshtha Joshi - 3.2.1-6 - RHEL8-isms * Mon Jan 02 2017 Tristan de Cacqueray - 3.2.1-5 - Fix sphinx-build error * Mon Dec 19 2016 Miro HronĨok - 3.2.1-4 - Rebuild for Python 3.6 * Thu Feb 04 2016 Fedora Release Engineering - 3.2.1-3 - Rebuilt for https://fedoraproject.org/wiki/Fedora_24_Mass_Rebuild * Fri Dec 18 2015 Paul Belanger - 3.2.1-2 - Ensure python3-statsd only exists when with_python3 defined - Add python3 testing dependencies - Run tests under python3 * Fri Dec 18 2015 Paul Belanger - 3.2.1-1 - New upstream version - 3.2.1 - Add support for both python2 and python3. * Thu Jun 18 2015 Fedora Release Engineering - 2.1.2-3 - Rebuilt for https://fedoraproject.org/wiki/Fedora_23_Mass_Rebuild * Tue Apr 28 2015 Tristan de Cacqueray - 2.1.2-2.fc21 - Fixed fedora-review warnings * Thu Apr 23 2015 Tristan de Cacqueray - 2.1.2-1.fc21 - Initial packaging