Blob Blame History Raw
%global with_python3 1
%global srcname structlog

Name:           python-structlog
Version:        0.4.2
Release:        3%{?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
BuildRequires:  python-pytest-cov
BuildRequires:  python-setuptools
%if 0%{?with_python3}
BuildRequires:  python3-devel
BuildRequires:  python3-freezegun
BuildRequires:  python3-pretend
BuildRequires:  python3-pytest
BuildRequires:  python3-pytest-cov
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 0%{?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 0%{?with_python3}
rm -rf %{py3dir}
cp -a . %{py3dir}
%endif


%build
%{__python2} setup.py build

%if 0%{?with_python3}
pushd %{py3dir}
%{__python3} setup.py build
popd
%endif


%install
%if 0%{?with_python3}
pushd %{py3dir}
%{__python3} setup.py install -O1 --skip-build --root %{buildroot}
popd
%endif

%{__python2} setup.py install -O1 --skip-build --root %{buildroot}


%check
%{_bindir}/py.test

%if 0%{?with_python3}
%{_bindir}/py.test-3.?
%endif


%files
%doc AUTHORS.rst CONTRIBUTING.rst LICENSE PKG-INFO docs/*.rst docs/code_examples
%{python2_sitelib}/%{srcname}
%{python2_sitelib}/%{srcname}-%{version}-py2.?.egg-info

%if 0%{?with_python3}
%files -n python3-structlog
%doc AUTHORS.rst CONTRIBUTING.rst LICENSE PKG-INFO docs/*.rst docs/code_examples
%{python3_sitelib}/%{srcname}
%{python3_sitelib}/%{srcname}-%{version}-py3.?.egg-info
%endif


%changelog
* 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