8ca95d9
%if 0%{?fedora}
8ca95d9
%global with_python3 1
8ca95d9
%endif
8ca95d9
8ca95d9
%{!?_licensedir: %global license %%doc}
8ca95d9
8ca95d9
%if 0%{?rhel} && 0%{?rhel} <= 6
8ca95d9
%{!?__python2:        %global __python2 /usr/bin/python2}
8ca95d9
%{!?python2_sitelib:  %global python2_sitelib %(%{__python2} -c "from distutils.sysconfig import get_python_lib; print(get_python_lib())")}
8ca95d9
%{!?python2_sitearch: %global python2_sitearch %(%{__python2} -c "from distutils.sysconfig import get_python_lib; print(get_python_lib(1))")}
8ca95d9
%endif
8ca95d9
8ca95d9
%global modname nine
8ca95d9
8ca95d9
Name:               python-nine
8ca95d9
Version:            0.3.4
9a1dc7f
Release:            8%{?dist}
8ca95d9
Summary:            Python 2 / 3 compatibility, like six, but favouring Python 3
8ca95d9
8ca95d9
License:            Public Domain
8ca95d9
URL:                http://pypi.python.org/pypi/nine
8ca95d9
Source0:            https://pypi.python.org/packages/source/n/%{modname}/%{modname}-%{version}.tar.gz
8ca95d9
BuildArch:          noarch
8ca95d9
8ca95d9
8ca95d9
BuildRequires:      python2-devel
8ca95d9
BuildRequires:      python-setuptools
8ca95d9
8ca95d9
%if 0%{?with_python3}
8ca95d9
BuildRequires:      python3-devel
8ca95d9
BuildRequires:      python3-setuptools
8ca95d9
%endif
8ca95d9
25e0b90
%if 0%{?rhel} && 0%{?rhel} <= 6
25e0b90
BuildRequires:      python-importlib
25e0b90
Requires:           python-importlib
25e0b90
%endif
25e0b90
8ca95d9
%description
8ca95d9
Let's write Python 3 right now!
8ca95d9
8ca95d9
When the best Python 2/Python 3 compatibility modules -- especially the
8ca95d9
famous `*six* library invented by Benjamin Peterson
8ca95d9
<https://pypi.python.org/pypi/six>`_ -- were created, they were written
8ca95d9
from the point of view of a Python 2 programmer starting to grok Python 3.
8ca95d9
8ca95d9
When thou writeth Python, thou shalt write Python 3 and, just for a while,
8ca95d9
ensure that the thing worketh on Python 2.7 and, possibly, even 2.6.
8ca95d9
8ca95d9
Just before Python 2 is finally phased out, thine codebase shall look more
8ca95d9
like 3 than like 2.
8ca95d9
8ca95d9
nine facilitates this new point of view. You can write code that is as
8ca95d9
3ish as possible while still supporting 2.6. Very comfortable for writing
8ca95d9
new projects.
8ca95d9
8ca95d9
%if 0%{?with_python3}
8ca95d9
%package -n python3-nine
8ca95d9
Summary:            Python 2 / 3 compatibility, like six, but favouring Python 3
8ca95d9
8ca95d9
%description -n python3-nine
8ca95d9
Let's write Python 3 right now!
8ca95d9
8ca95d9
When the best Python 2/Python 3 compatibility modules -- especially the
8ca95d9
famous `*six* library invented by Benjamin Peterson
8ca95d9
<https://pypi.python.org/pypi/six>`_ -- were created, they were written
8ca95d9
from the point of view of a Python 2 programmer starting to grok Python 3.
8ca95d9
8ca95d9
When thou writeth Python, thou shalt write Python 3 and, just for a while,
8ca95d9
ensure that the thing worketh on Python 2.7 and, possibly, even 2.6.
8ca95d9
8ca95d9
Just before Python 2 is finally phased out, thine codebase shall look more
8ca95d9
like 3 than like 2.
8ca95d9
8ca95d9
nine facilitates this new point of view. You can write code that is as
8ca95d9
3ish as possible while still supporting 2.6. Very comfortable for writing
8ca95d9
new projects.
8ca95d9
%endif
8ca95d9
8ca95d9
%prep
8ca95d9
%setup -q -n %{modname}-%{version}
8ca95d9
8ca95d9
# Remove bundled egg-info in case it exists
8ca95d9
rm -rf %{modname}.egg-info
8ca95d9
%if 0%{?with_python3}
8ca95d9
rm -rf %{py3dir}
8ca95d9
cp -a . %{py3dir}
8ca95d9
%endif
8ca95d9
8ca95d9
%build
8ca95d9
%{__python2} setup.py build
8ca95d9
%if 0%{?with_python3}
8ca95d9
pushd %{py3dir}
8ca95d9
%{__python3} setup.py build
8ca95d9
popd
8ca95d9
%endif
8ca95d9
8ca95d9
%install
8ca95d9
%if 0%{?with_python3}
8ca95d9
pushd %{py3dir}
8ca95d9
%{__python3} setup.py install -O1 --skip-build --root=%{buildroot}
8ca95d9
popd
8ca95d9
%endif
8ca95d9
%{__python2} setup.py install -O1 --skip-build --root=%{buildroot}
8ca95d9
8ca95d9
%check
8ca95d9
%{__python2} setup.py test
8ca95d9
%if 0%{?with_python3}
8ca95d9
pushd %{py3dir}
8ca95d9
%{__python3} setup.py test
8ca95d9
popd
8ca95d9
%endif
8ca95d9
8ca95d9
%files
8ca95d9
%doc README.rst porting.rst
c2a8046
%{!?_licensedir:%global license %%doc}
8ca95d9
%license LICENSE.rst
8ca95d9
%{python2_sitelib}/%{modname}/
8ca95d9
%{python2_sitelib}/%{modname}-%{version}*
8ca95d9
8ca95d9
%if 0%{?with_python3}
8ca95d9
%files -n python3-nine
8ca95d9
%doc README.rst porting.rst
c2a8046
%{!?_licensedir:%global license %%doc}
8ca95d9
%license LICENSE.rst
8ca95d9
%{python3_sitelib}/%{modname}/
8ca95d9
%{python3_sitelib}/%{modname}-%{version}*
8ca95d9
8ca95d9
%endif
8ca95d9
8ca95d9
%changelog
9a1dc7f
* Tue Jul 19 2016 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 0.3.4-8
9a1dc7f
- https://fedoraproject.org/wiki/Changes/Automatic_Provides_for_Python_RPM_Packages
9a1dc7f
42b9ee1
* Thu Feb 04 2016 Fedora Release Engineering <releng@fedoraproject.org> - 0.3.4-7
42b9ee1
- Rebuilt for https://fedoraproject.org/wiki/Fedora_24_Mass_Rebuild
42b9ee1
cf08244
* Tue Nov 10 2015 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 0.3.4-6
cf08244
- Rebuilt for https://fedoraproject.org/wiki/Changes/python3.5
cf08244
894b931
* Thu Jun 18 2015 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 0.3.4-5
894b931
- Rebuilt for https://fedoraproject.org/wiki/Fedora_23_Mass_Rebuild
894b931
8ff0e48
* Mon Jan 12 2015 Ralph Bean <rbean@redhat.com> - 0.3.4-4
8ff0e48
- Specify license macro for el6.
8ff0e48
25e0b90
* Mon Jan 12 2015 Ralph Bean <rbean@redhat.com> - 0.3.4-3
25e0b90
- Require python-importlib on el6.
25e0b90
8ca95d9
* Sat Jan 10 2015 Ralph Bean <rbean@redhat.com> - 0.3.4-2
8ca95d9
- Declare noarch.
8ca95d9
- Remove unnecessary cflags.
8ca95d9
- Remove Group tag, as per review.
8ca95d9
8ca95d9
* Wed Jan 07 2015 Ralph Bean <rbean@redhat.com> - 0.3.4-1
8ca95d9
- initial package for Fedora