74c3864
%if 0%{?fedora}
74c3864
%global with_python3 1
74c3864
%endif
d148cf8
74c3864
%global srcname statsd
74c3864
74c3864
Name:       python-%{srcname}
74c3864
Version:    3.2.1
65fd6ff
Release:    5%{?dist}
d148cf8
Summary:    A Python statsd client
d148cf8
d148cf8
License:    MIT
74c3864
URL:        https://github.com/jsocol/pystatsd
74c3864
Source0:    https://pypi.python.org/packages/source/s/%{srcname}/%{srcname}-%{version}.tar.gz
65fd6ff
# Apply https://github.com/jsocol/pystatsd/pull/88
65fd6ff
Patch0:     0001-Fix-sphinx-extension-conflict.patch
74c3864
d148cf8
BuildArch:  noarch
d148cf8
d148cf8
BuildRequires:  python2-devel
d148cf8
BuildRequires:  python-mock
d148cf8
BuildRequires:  python-nose
74c3864
%if 0%{?with_python3}
74c3864
BuildRequires:  python3-devel
58c9bc4
BuildRequires:  python3-mock
58c9bc4
BuildRequires:  python3-nose
74c3864
%endif # if with_python3
d148cf8
d148cf8
%description
74c3864
A python client for the statsd daemon.
d148cf8
74c3864
%package -n python2-%{srcname}
74c3864
Summary: %{summary}
74c3864
%{?python_provide:%python_provide python2-%{srcname}}
74c3864
74c3864
%description -n python2-%{srcname}
74c3864
A python client for the statsd daemon.
d148cf8
58c9bc4
%if 0%{?with_python3}
74c3864
%package -n python3-%{srcname}
74c3864
Summary: %{summary}
74c3864
%{?python_provide:%python_provide python3-%{srcname}}
74c3864
74c3864
%description -n python3-%{srcname}
74c3864
A python client for the statsd daemon.
58c9bc4
%endif
74c3864
74c3864
%package doc
74c3864
Summary: Documentation of the Python client for the statsd daemon
d148cf8
BuildRequires:  python-sphinx
d148cf8
d148cf8
%description doc
d148cf8
Documentation of the Python client for the statsd daemon.
d148cf8
d148cf8
%prep
65fd6ff
%autosetup -n %{srcname}-%{version} -p1
d148cf8
# Remove bundled egg-info
74c3864
rm -rf %{srcname}.egg-info
d148cf8
# Let RPM handle the dependencies
d148cf8
rm -f requirements.txt
d148cf8
d148cf8
%build
74c3864
%py2_build
74c3864
%if 0%{?with_python3}
74c3864
%py3_build
74c3864
%endif
d148cf8
74c3864
## generate html docs
74c3864
sphinx-build docs html
74c3864
rm -rf html/.{doctrees,buildinfo}
d148cf8
d148cf8
%install
74c3864
%py2_install
74c3864
%if 0%{?with_python3}
74c3864
%py3_install
74c3864
%endif
d148cf8
d148cf8
%check
74c3864
%{__python2} setup.py test
74c3864
%if 0%{?with_python3}
58c9bc4
%{__python3} setup.py test
74c3864
%endif
d148cf8
74c3864
%files -n python2-%{srcname}
74c3864
%license LICENSE
74c3864
%doc AUTHORS README.rst
74c3864
%{python2_sitelib}/*
d148cf8
74c3864
%if 0%{?with_python3}
74c3864
%files -n python3-%{srcname}
d148cf8
%license LICENSE
74c3864
%doc AUTHORS README.rst
74c3864
%{python3_sitelib}/*
74c3864
%endif
d148cf8
d148cf8
%files doc
d148cf8
%license LICENSE
74c3864
%doc html
d148cf8
d148cf8
%changelog
65fd6ff
* Mon Jan 02 2017 Tristan de Cacqueray <tdecacqu@redhat.com> - 3.2.1-5
65fd6ff
- Fix sphinx-build error
65fd6ff
3017cde
* Thu Feb 04 2016 Fedora Release Engineering <releng@fedoraproject.org> - 3.2.1-3
3017cde
- Rebuilt for https://fedoraproject.org/wiki/Fedora_24_Mass_Rebuild
3017cde
58c9bc4
* Fri Dec 18 2015 Paul Belanger <pabelanger@redhat.com> - 3.2.1-2
58c9bc4
- Ensure python3-statsd only exists when with_python3 defined
58c9bc4
- Add python3 testing dependencies
58c9bc4
- Run tests under python3
58c9bc4
74c3864
* Fri Dec 18 2015 Paul Belanger <pabelanger@redhat.com> - 3.2.1-1
74c3864
- New upstream version - 3.2.1
74c3864
- Add support for both python2 and python3.
74c3864
e9c076f
* Thu Jun 18 2015 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 2.1.2-3
e9c076f
- Rebuilt for https://fedoraproject.org/wiki/Fedora_23_Mass_Rebuild
e9c076f
d148cf8
* Tue Apr 28 2015 Tristan de Cacqueray <tdecacqu@redhat.com> - 2.1.2-2.fc21
d148cf8
- Fixed fedora-review warnings
d148cf8
d148cf8
* Thu Apr 23 2015 Tristan de Cacqueray <tdecacqu@redhat.com> - 2.1.2-1.fc21
d148cf8
- Initial packaging