%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 future Name: python-future Version: 0.15.2 Release: 1%{?dist} Summary: Clean single-source support for Python 3 and 2 License: MIT URL: http://pypi.python.org/pypi/future Source0: https://pypi.python.org/packages/5a/f4/99abde815842bc6e97d5a7806ad51236630da14ca2f3b1fce94c0bb94d3d/%{modname}-%{version}.tar.gz BuildArch: noarch BuildRequires: python2-devel BuildRequires: python2-setuptools BuildRequires: pytest %if 0%{?with_python3} BuildRequires: python3-devel BuildRequires: python3-setuptools BuildRequires: python3-pytest %endif %description ``future`` is the missing compatibility layer between Python 2 and Python 3. It allows you to use a single, clean Python 3.x-compatible codebase to support both Python 2 and Python 3 with minimal overhead. %package -n python2-%{modname} Summary: Clean single-source support for Python 3 and 2 %{?python_provide:%python_provide python2-%{modname}} %description -n python2-%{modname} ``future`` is the missing compatibility layer between Python 2 and Python 3. It allows you to use a single, clean Python 3.x-compatible codebase to support both Python 2 and Python 3 with minimal overhead. %if 0%{?with_python3} %package -n python3-%{modname} Summary: Clean single-source support for Python 3 and 2 %{?python_provide:%python_provide python3-%{modname}} %description -n python3-%{modname} ``future`` is the missing compatibility layer between Python 2 and Python 3. It allows you to use a single, clean Python 3.x-compatible codebase to support both Python 2 and Python 3 with minimal overhead. %endif %prep %autosetup -n %{modname}-%{version} rm -rf *.egg* %build %py2_build mv build py2-build %if 0%{?with_python3} %py3_build mv build py3-build %endif %install mv py2-build build %py2_install mv %{buildroot}%{_bindir}/pasteurize %{buildroot}%{_bindir}/python2-pasteurize mv %{buildroot}%{_bindir}/futurize %{buildroot}%{_bindir}/python2-futurize mv build py2-build %if 0%{?with_python3} mv py3-build build %py3_install mv build py3-build %endif # The tests are present, but they are totally crazy. #%%check #%%{__python2} setup.py test #%%if 0%%{?with_python3} #%%{__python3} setup.py test #%%endif %files -n python2-%{modname} %doc README.rst %license LICENSE.txt %{_bindir}/python2-futurize %{_bindir}/python2-pasteurize %{python2_sitelib}/%{modname}-%{version}* %{python2_sitelib}/%{modname}/ %{python2_sitelib}/past/ %{python2_sitelib}/libfuturize/ %{python2_sitelib}/libpasteurize/ # Py2-only shims. Crazy! %{python2_sitelib}/builtins/ %{python2_sitelib}/configparser/ %{python2_sitelib}/copyreg/ %{python2_sitelib}/html/ %{python2_sitelib}/http/ %{python2_sitelib}/queue/ %{python2_sitelib}/reprlib/ %{python2_sitelib}/socketserver/ %{python2_sitelib}/tkinter/ %{python2_sitelib}/winreg/ %{python2_sitelib}/xmlrpc/ %{python2_sitelib}/_dummy_thread/ %{python2_sitelib}/_markupbase/ %{python2_sitelib}/_thread/ %if 0%{?with_python3} %files -n python3-%{modname} %doc README.rst %license LICENSE.txt %{_bindir}/futurize %{_bindir}/pasteurize %{python3_sitelib}/%{modname}-%{version}* %{python3_sitelib}/%{modname}/ %{python3_sitelib}/past/ %{python3_sitelib}/libfuturize/ %{python3_sitelib}/libpasteurize/ %endif %changelog * Wed Nov 09 2016 Ralph Bean - 0.15.2-1 - initial package for Fedora