%if 0%{?fedora}
%global with_python3 1
%endif
%{!?_licensedir: %global license %%doc}
%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
%global modname twiggy
%global distname Twiggy
Name: python-twiggy
Version: 0.4.7
Release: 4%{?dist}
Summary: A Pythonic logger
Group: Development/Libraries
License: BSD
URL: http://pypi.python.org/pypi/Twiggy
Source0: http://pypi.python.org/packages/source/T/%{distname}/%{distname}-%{version}.tar.gz
BuildArch: noarch
BuildRequires: python2-devel
BuildRequires: python2-setuptools
BuildRequires: python-sphinx
%if 0%{?with_python3}
BuildRequires: python3-devel
BuildRequires: python3-setuptools
BuildRequires: python3-sphinx
%endif
%description
Twiggy is a Pythonic logger.
You should use Twiggy because it is awesome. For more information, read the
`documentation <http://twiggy.wearpants.org>`_ or `see this blog post
<http://blog.wearpants.org/meet-twiggy>`_.
%package -n python2-%{modname}
Summary: A Pythonic logger
%{?python_provide:%python_provide python2-%{modname}}
%description -n python2-%{modname}
Twiggy is a Pythonic logger.
You should use Twiggy because it is awesome. For more information, read the
`documentation <http://twiggy.wearpants.org>`_ or `see this blog post
<http://blog.wearpants.org/meet-twiggy>`_.
%if 0%{?with_python3}
%package -n python3-%{modname}
Summary: A Pythonic logger
%{?python_provide:%python_provide python3-%{modname}}
%description -n python3-%{modname}
Twiggy is a Pythonic logger.
You should use Twiggy because it is awesome. For more information, read the
`documentation <http://twiggy.wearpants.org>`_ or `see this blog post
<http://blog.wearpants.org/meet-twiggy>`_.
%endif
%prep
%autosetup -n %{distname}-%{version}
# Remove bundled egg-info in case it exists
rm -rf %{distname}.egg-info
%build
%py2_build
%if 0%{?with_python3}
%py3_build
%endif
%install
%py2_install
%if 0%{?with_python3}
%py3_install
%endif
# There are errors in the test suite.
#%%check
#./scripts/run-twiggy-tests.sh
%files -n python2-%{modname}
%doc README.rst
%license LICENSE
%{python2_sitelib}/%{modname}/
%{python2_sitelib}/%{distname}-%{version}*
%if 0%{?with_python3}
%files -n python3-%{modname}
%doc README.rst
%license LICENSE
%{python3_sitelib}/%{modname}/
%{python3_sitelib}/%{distname}-%{version}-*
%endif
%changelog
* Sat Nov 21 2015 Kalev Lember <klember@redhat.com> - 0.4.7-4
- Fix an unexpanded macro
* Mon Nov 16 2015 Ralph Bean <rbean@redhat.com> - 0.4.7-3
- Python3 subpackage and modernize python macros.
* Thu Jun 18 2015 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 0.4.7-2
- Rebuilt for https://fedoraproject.org/wiki/Fedora_23_Mass_Rebuild
* Fri Mar 13 2015 Ralph Bean <rbean@redhat.com> - 0.4.7-1
- new version
* Sat Jun 07 2014 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 0.4.5-3
- Rebuilt for https://fedoraproject.org/wiki/Fedora_21_Mass_Rebuild
* Fri Nov 01 2013 Ralph Bean <rbean@redhat.com> - 0.4.5-2
- Modernize python rpm macros as per review feedback.
* Thu Oct 31 2013 Ralph Bean <rbean@redhat.com> - 0.4.5-1
- initial package for Fedora