%if 0%{?fedora} > 12 || 0%{?rhel} > 6 %global with_python3 1 %endif %global modname logutils Name: python-%{modname} Version: 0.3.2 Release: 1%{?dist} Summary: Logging utilities Group: Development/Libraries License: BSD URL: http://pypi.python.org/pypi/logutils Source0: http://%{modname}.googlecode.com/files/%{modname}-%{version}.tar.gz BuildArch: noarch BuildRequires: python2-devel %if 0%{?with_python3} BuildRequires: python3-devel %endif %description The logutils package provides a set of handlers for the Python standard library's logging package. Some of these handlers are out-of-scope for the standard library, and so they are packaged here. Others are updated versions which have appeared in recent Python releases, but are usable with older versions of Python and so are packaged here. %if 0%{?with_python3} %package -n python3-logutils Summary: Logging utilities Group: Development/Libraries %description -n python3-logutils The logutils package provides a set of handlers for the Python standard library's logging package. Some of these handlers are out-of-scope for the standard library, and so they are packaged here. Others are updated versions which have appeared in recent Python releases, but are usable with older versions of Python and so are packaged here. %endif %prep %setup -q -n %{modname}-%{version} # Remove bundled egg-info in case it exists rm -rf %{modname}.egg-info %if 0%{?with_python3} rm -rf %{py3dir} cp -a . %{py3dir} %endif %build %{__python} 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 %{__python} setup.py install -O1 --skip-build --root=%{buildroot} %check %{__python} setup.py test %if 0%{?with_python3} pushd %{py3dir} %{__python3} setup.py test popd %endif %files %doc README.txt LICENSE.txt NEWS.txt doc/ %{python_sitelib}/%{modname}/ %{python_sitelib}/%{modname}-%{version}* %if 0%{?with_python3} %files -n python3-%{modname} %doc README.txt LICENSE.txt NEWS.txt doc/ %{python3_sitelib}/%{modname}/ %{python3_sitelib}/%{modname}-%{version}-* %endif %changelog * Wed Dec 05 2012 Ralph Bean - 0.3.2-1 - Initial package for Fedora