From 2dcffe676a20391624495fc2ea117b9adcb7936f Mon Sep 17 00:00:00 2001 From: Ralph Bean Date: Nov 16 2015 16:48:39 +0000 Subject: Python3 subpackage. --- diff --git a/python-twiggy.spec b/python-twiggy.spec index ca240b3..46bb882 100644 --- a/python-twiggy.spec +++ b/python-twiggy.spec @@ -1,9 +1,21 @@ +%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: 2%{?dist} +Release: 3%{?dist} Summary: A Pythonic logger Group: Development/Libraries @@ -14,33 +26,86 @@ Source0: http://pypi.python.org/packages/source/T/%{distname}/%{distn 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 `_ or `see this blog post +`_. + +%package -n python2-%{modname} +Summary: A Pythonic logger +%{?python_provide:%python_provide python2-%{module}} + +%description -n python2-%{modname} +Twiggy is a Pythonic logger. + +You should use Twiggy because it is awesome. For more information, read the +`documentation `_ or `see this blog post +`_. + +%if 0%{?with_python3} +%package -n python3-%{modname} +Summary: A Pythonic logger +%{?python_provide:%python_provide python3-%{module}} + +%description -n python3-%{modname} +Twiggy is a Pythonic logger. + +You should use Twiggy because it is awesome. For more information, read the +`documentation `_ or `see this blog post +`_. +%endif + %prep -%setup -q -n %{distname}-%{version} +%autosetup -n %{distname}-%{version} # Remove bundled egg-info in case it exists rm -rf %{distname}.egg-info %build -%{__python2} setup.py build +%py2_build +%if 0%{?with_python3} +%py3_build +%endif %install -%{__python2} setup.py install -O1 --skip-build --root=%{buildroot} +%py2_install +%if 0%{?with_python3} +%py3_install +%endif # There are errors in the test suite. #%%check #./scripts/run-twiggy-tests.sh -%files -%doc README.rst LICENSE VERSION +%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 +* Mon Nov 16 2015 Ralph Bean - 0.4.7-3 +- Python3 subpackage and modernize python macros. + * Thu Jun 18 2015 Fedora Release Engineering - 0.4.7-2 - Rebuilt for https://fedoraproject.org/wiki/Fedora_23_Mass_Rebuild