# needed for epel6
%if 0%{?rhel} && 0%{?rhel} <= 6
%{!?__python2: %global __python2 /usr/bin/python2}
%{!?python2_sitelib: %global python2_sitelib %(%{__python2} -c "from distutils.sysconfig import get_python_lib; print(get_python_lib())")}
%{!?python2_sitearch: %global python2_sitearch %(%{__python2} -c "from distutils.sysconfig import get_python_lib; print(get_python_lib(1))")}
%endif
# enable python3 on fedora
# disable tests on RHEL pytest 2.4 not available
%if 0%{?fedora}
%bcond_without python3
%bcond_without tests
%else
%bcond_with python3
%bcond_with tests
%endif
%global srcname structlog
Name: python-structlog
Version: 15.2.0
Release: 5%{?dist}
Summary: Painless structural logging
License: ASL 2.0
URL: http://www.structlog.org/
Source0: https://pypi.python.org/packages/source/s/%{srcname}/%{srcname}-%{version}.tar.gz
BuildArch: noarch
BuildRequires: pytest
BuildRequires: python-devel
BuildRequires: python-freezegun
BuildRequires: python-pretend
%if %{with tests}
BuildRequires: python-pytest-cov
%endif
BuildRequires: python-setuptools
%if %{with python3}
BuildRequires: python3-devel
BuildRequires: python3-freezegun
BuildRequires: python3-pretend
%if %{with tests}
BuildRequires: python3-pytest
BuildRequires: python3-pytest-cov
%endif
BuildRequires: python3-setuptools
%endif
%description
Structlog makes structured logging in Python easy by augmenting your existing
logger. It allows you to split your log entries up into key/value pairs and
build them incrementally without annoying boilerplate code.
%if %{with python3}
%package -n python3-structlog
Summary: Painless structural logging
License: ASL 2.0
%description -n python3-structlog
Structlog makes structured logging in Python easy by augmenting your existing
logger. It allows you to split your log entries up into key/value pairs and
build them incrementally without annoying boilerplate code.
%endif
%prep
%setup -q -n %{srcname}-%{version}
rm -rf *.egg-info
%if %{with python3}
rm -rf %{py3dir}
cp -a . %{py3dir}
%endif
%build
%{__python2} setup.py build
%if %{with python3}
pushd %{py3dir}
%{__python3} setup.py build
popd
%endif
%install
%if %{with python3}
pushd %{py3dir}
%{__python3} setup.py install -O1 --skip-build --root %{buildroot}
popd
%endif
%{__python2} setup.py install -O1 --skip-build --root %{buildroot}
%if %{with tests}
%check
%{_bindir}/py.test
%if %{with python3}
%{_bindir}/py.test-3.?
%endif
%endif
%files
%doc AUTHORS.rst CONTRIBUTING.rst PKG-INFO docs/*.rst docs/code_examples
%license LICENSE
%{python2_sitelib}/%{srcname}
%{python2_sitelib}/%{srcname}-%{version}-py2.?.egg-info
%if %{with python3}
%files -n python3-structlog
%doc AUTHORS.rst CONTRIBUTING.rst PKG-INFO docs/*.rst docs/code_examples
%license LICENSE
%{python3_sitelib}/%{srcname}
%{python3_sitelib}/%{srcname}-%{version}-py3.?.egg-info
%endif
%changelog
* Mon Dec 19 2016 Miro HronĨok <mhroncok@redhat.com> - 15.2.0-5
- Rebuild for Python 3.6
* Thu Feb 04 2016 Fedora Release Engineering <releng@fedoraproject.org> - 15.2.0-4
- Rebuilt for https://fedoraproject.org/wiki/Fedora_24_Mass_Rebuild
* Tue Nov 10 2015 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 15.2.0-3
- Rebuilt for https://fedoraproject.org/wiki/Changes/python3.5
* Fri Nov 06 2015 Piotr Popieluch <piotr1212@gmail.com> - 15.2.0-2
- Rebuilt for python 3.5
* Fri Jul 03 2015 Piotr Popieluch <piotr1212@gmail.com> - 15.2.0-1
- Update to 15.2.0
* Thu Jun 18 2015 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 0.4.2-6
- Rebuilt for https://fedoraproject.org/wiki/Fedora_23_Mass_Rebuild
* Thu Dec 4 2014 Piotr Popieluch <piotr1212@gmail.com> - 0.4.2-5
- disabled tests on epel
* Sat Nov 22 2014 Piotr Popieluch <piotr1212@gmail.com> - 0.4.2-4
- added epel support
* Tue Oct 28 2014 Piotr Popieluch <piotr1212@gmail.com> - 0.4.2-3
- Removed group
- Removed shipped .egg-info
- Added license to python3 package
- Made %%files section more verbose
- Replaced %%{python_sitelib} with %%{python2_sitelib}
* Mon Oct 20 2014 Piotr Popieluch <piotr1212@gmail.com> - 0.4.2-2
- Added python3 package
- Added %%check section
* Sat Oct 11 2014 Piotr Popieluch <piotr1212@gmail.com> - 0.4.2-1
- Initial package