Blob Blame History Raw
%if 0%{?fedora} > 12 || 0%{?rhel} > 6
%global with_python3 1
%endif

# Re-enable Python 3 support once the following are resolved:
# https://github.com/mitsuhiko/logbook/issues/42
# https://github.com/mitsuhiko/logbook/issues/43

# we don't want to provide private python extension libs
%{?filter_setup:
%filter_provides_in %{python2_sitearch}/.*\.so$
%filter_provides_in %{python3_sitearch}/.*\.so$
%filter_setup
}

Name:		python-logbook
Version:	0.11.3
Release:	3%{?dist}
Summary:	A logging replacement for Python

Group:		Development/Libraries
License:	BSD
URL:		http://pypi.python.org/pypi/Logbook/
Source0:	http://pypi.python.org/packages/source/L/Logbook/Logbook-%{version}.tar.gz
BuildRoot:	%{_tmppath}/%{name}-%{version}-%{release}-root-%(%{__id_u} -n)

BuildRequires:	python2-devel pytest
BuildRequires:	python-sqlalchemy python-zmq python-execnet python-jinja2
%if 0%{?with_python3}
BuildRequires:	python3-devel python3-pytest
BuildRequires:	python3-setuptools
BuildRequires:	python3-sqlalchemy python3-zmq
%endif
BuildRequires:	python-setuptools

%description
Logbook is a logging system for Python that replaces the standard library’s
logging module. It was designed with both complex and simple applications
and mind and the idea to make logging fun. What makes it fun? What about 
getting log messages on your phone or desktop notification system? 
Logbook can do that.


%if 0%{?with_python3}
%package -n python3-logbook
Summary:	A logging replacement for Python 3
Group:		Development/Libraries

%description -n python3-logbook
Logbook is a logging system for Python that replaces the standard library’s
logging module. It was designed with both complex and simple applications
and mind and the idea to make logging fun. What makes it fun? What about 
getting log messages on your phone or desktop notification system? 
Logbook can do that.

This package allows for use of logger with Python 3.
%endif # with_python3

%prep
%setup -qn Logbook-%{version}


%if 0%{?with_python3}
rm -rf %{py3dir}
cp -a . %{py3dir}
%endif # with_python3

%build
CFLAGS="$RPM_OPT_FLAGS" %{__python2} setup.py build

%if 0%{?with_python3}
pushd %{py3dir}
CFLAGS="$RPM_OPT_FLAGS" %{__python3} setup.py build
popd
%endif # with_python3

%install
rm -rf %{buildroot}
# Must do the python3 install first because the scripts in /usr/bin are
# overwritten with every setup.py install (and we want the python2 version
# to be the default for now).
%if 0%{?with_python3}
pushd %{py3dir}
%{__python3} setup.py install --skip-build --root %{buildroot}
popd
%endif # with_python3

%{__python2} setup.py install --skip-build --root %{buildroot} \
	--install-data=%{_datadir}

%check
%{__python} setup.py test
%if 0%{?with_python3}
pushd %{py3dir}
%{__python3} setup.py test
popd
%endif # with_python3


%clean
rm -rf %{buildroot}


%files
%defattr(-,root,root,-)
%doc CHANGES
%{python2_sitearch}/logbook*
#%%exclude %%{python2_sitearch}/logbook/testsuite
%{python2_sitearch}/Logbook-%{version}-py2.7.egg-info/

%if 0%{?with_python3}
%files -n python3-logbook
%defattr(-,root,root,-)
%doc CHANGES
%{python3_sitearch}/logbook*
#%%exclude %%{python3_sitearch}/logbook/testsuite
%{python3_sitearch}/Logbook-%{version}-py%{python3_version}.egg-info/
%endif

%changelog
* Tue Jul 19 2016 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 0.11.3-3
- https://fedoraproject.org/wiki/Changes/Automatic_Provides_for_Python_RPM_Packages

* Thu Feb 04 2016 Fedora Release Engineering <releng@fedoraproject.org> - 0.11.3-2
- Rebuilt for https://fedoraproject.org/wiki/Fedora_24_Mass_Rebuild

* Thu Nov 19 2015 Jon Ciesla <limburgher@gmail.com> - 0.11.3-1
- Latest upstream.
- Fix Python 3 build.
- Moved from noarch to arched.

* Tue Nov 10 2015 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 0.7.0-3
- Rebuilt for https://fedoraproject.org/wiki/Changes/python3.5

* Thu Jun 18 2015 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 0.7.0-2
- Rebuilt for https://fedoraproject.org/wiki/Fedora_23_Mass_Rebuild

* Thu Oct 02 2014 Jon Ciesla <limburgher@gmail.com> - 0.7.0-1
- Latest upstream, BZ 1148946.

* Sat Jun 07 2014 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 0.6.0-3
- Rebuilt for https://fedoraproject.org/wiki/Fedora_21_Mass_Rebuild

* Wed May 14 2014 Bohuslav Kabrda <bkabrda@redhat.com> - 0.6.0-2
- Rebuilt for https://fedoraproject.org/wiki/Changes/Python_3.4

* Mon Nov 11 2013 Jon Ciesla <limburgher@gmail.com> - 0.6.0-1
- Latest upstream.
- Re-enable Python 3, 1028774.

* Fri Sep 13 2013 Jon Ciesla <limburgher@gmail.com> - 0.5.0-1
- Latest upstream.
- Switched to noarch.

* Sun Aug 04 2013 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 0.4.1-2
- Rebuilt for https://fedoraproject.org/wiki/Fedora_20_Mass_Rebuild

* Mon Jan 28 2013 Jon Ciesla <limburgher@gmail.com> - 0.4.1-1
- Latest upstream, BZ 904886.

* Sat Jul 21 2012 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 0.3-5
- Rebuilt for https://fedoraproject.org/wiki/Fedora_18_Mass_Rebuild

* Sat Jan 14 2012 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 0.3-4
- Rebuilt for https://fedoraproject.org/wiki/Fedora_17_Mass_Rebuild

* Fri Oct 28 2011 Jon Ciesla <limb@jcomserv.net> - 0.3-3
- Dropped test suite from Python 3 package.
- Testing via setuptools.
- Filtered .so in Python 3 package.
- Dropped Python 3 subpackage, see comments.
- Added python-jinja2 BR.

* Wed Oct 26 2011 Jon Ciesla <limb@jcomserv.net> - 0.3-2
- Ownership and macro fixes.
- Dropped spurious Requires.
- Added test suite to check, dropped from package.

* Tue Oct 11 2011 Jon Ciesla <limb@jcomserv.net> - 0.3-1
- Initial RPM release