c71511f
%if 0%{?fedora}
4c4d6ea
%global with_python3 1
4c4d6ea
4c4d6ea
## Make python?_shortver macros
4c4d6ea
%{!?python2_shortver: %global python2_shortver %(%{__python2} -c 'import sys; print(str(sys.version_info.major) + "." + str(sys.version_info.minor))')}
4c4d6ea
%{!?python3_shortver: %global python3_shortver %(%{__python3} -c 'import sys; print(str(sys.version_info.major) + "." + str(sys.version_info.minor))')}
4c4d6ea
%endif
4c4d6ea
4c4d6ea
%if 0%{?rhel} && 0%{?rhel} <= 6
4c4d6ea
%{!?__python2: %global __python2 /usr/bin/python2}
4c4d6ea
%{!?python2_sitelib: %global python2_sitelib %(%{__python2} -c "from distutils.sysconfig import get_python_lib; print(get_python_lib())")}
4c4d6ea
%{!?python2_sitearch: %global python2_sitearch %(%{__python2} -c "from distutils.sysconfig import get_python_lib; print(get_python_lib(1))")}
4c4d6ea
%global python2_version 2.6
4c4d6ea
%global with_python3 0
4c4d6ea
%endif
4c4d6ea
4c4d6ea
%if 0%{?rhel} && 0%{?rhel} > 6
4c4d6ea
%global with_python3 0
4c4d6ea
%endif
4c4d6ea
87d21bd
%global with_python35 1
87d21bd
4c4d6ea
Name: future
4c4d6ea
Summary: Easy, clean, reliable Python 2/3 compatibility
b1f0ce8
Version: 0.16.0
54aefc0
Release: 4%{?dist}
4c4d6ea
License: MIT
4c4d6ea
Group: Applications/Engineering
4c4d6ea
URL: http://python-future.org/
4c4d6ea
Source0: https://github.com/PythonCharmers/python-future/archive/v%{version}.tar.gz#/python-future-%{version}.tar.gz
4c4d6ea
BuildArch: noarch
4c4d6ea
4c4d6ea
##https://github.com/PythonCharmers/python-future/issues/165
4c4d6ea
Patch0: %{name}-skip_tests_with_connection_errors.patch
4c4d6ea
4c4d6ea
%if 0%{?rhel} && 0%{?rhel} <= 6
4c4d6ea
BuildRequires: python-argparse, python-unittest2, python-importlib 
4c4d6ea
Requires:      python-importlib
4c4d6ea
Requires:      python-argparse
4c4d6ea
%endif
4c4d6ea
BuildRequires: python2-devel
ea07c13
BuildRequires: python-setuptools
4c4d6ea
BuildRequires: numpy
ea07c13
BuildRequires: python-requests
4c4d6ea
BuildRequires: pytest
4c4d6ea
4c4d6ea
%description
4c4d6ea
%{name} is the missing compatibility layer between Python 2 and
4c4d6ea
Python 3. It allows you to use a single, clean Python 3.x-compatible
4c4d6ea
codebase to support both Python 2 and Python 3 with minimal overhead.
4c4d6ea
4c4d6ea
It provides ``future`` and ``past`` packages with backports and forward
4c4d6ea
ports of features from Python 3 and 2. It also comes with ``futurize`` and
4c4d6ea
``pasteurize``, customized 2to3-based scripts that helps you to convert
4c4d6ea
either Py2 or Py3 code easily to support both Python 2 and 3 in a single
4c4d6ea
clean Py3-style codebase, module by module.
4c4d6ea
5865eee
%package -n python2-%{name}
5865eee
Summary: Easy, clean, reliable Python 2/3 compatibility
5865eee
%{?python_provide:%python_provide python2-%{name}}
5865eee
Provides:      future = 0:%{version}-%{release}
5865eee
%description -n python2-%{name}
5865eee
Python2 %{name} is the missing compatibility layer between Python 2 and
5865eee
Python 3. It allows you to use a single, clean Python 3.x-compatible
5865eee
codebase to support both Python 2 and Python 3 with minimal overhead.
5865eee
5865eee
It provides ``future`` and ``past`` packages with backports and forward
5865eee
ports of features from Python 3 and 2. It also comes with ``futurize`` and
5865eee
``pasteurize``, customized 2to3-based scripts that helps you to convert
5865eee
either Py2 or Py3 code easily to support both Python 2 and 3 in a single
5865eee
clean Py3-style codebase, module by module.
5865eee
4c4d6ea
%if 0%{?with_python3}
4c4d6ea
%package -n python3-%{name}
4c4d6ea
Summary: Easy, clean, reliable Python 2/3 compatibility
5865eee
%{?python_provide:%python_provide python3-%{name}}
4c4d6ea
BuildRequires: python3-devel
4c4d6ea
BuildRequires: python3-setuptools
4c4d6ea
BuildRequires: python3-numpy
4c4d6ea
BuildRequires: python3-requests
4c4d6ea
BuildRequires: python3-pytest
4c4d6ea
4c4d6ea
%description -n python3-%{name}
4c4d6ea
Python3-%{name} is the missing compatibility layer between Python 2 and
4c4d6ea
Python 3. It allows you to use a single, clean Python 3.x-compatible
4c4d6ea
codebase to support both Python 2 and Python 3 with minimal overhead.
4c4d6ea
4c4d6ea
It provides ``future`` and ``past`` packages with backports and forward
4c4d6ea
ports of features from Python 3 and 2. It also comes with ``futurize`` and
4c4d6ea
``pasteurize``, customized 2to3-based scripts that helps you to convert
4c4d6ea
either Py2 or Py3 code easily to support both Python 2 and 3 in a single
4c4d6ea
clean Py3-style codebase, module by module.
4c4d6ea
%endif # with_python3
4c4d6ea
4c4d6ea
%prep
90bc4f1
%setup -qc
4c4d6ea
90bc4f1
mv python-future-%{version} python2
90bc4f1
pushd python2
90bc4f1
find -name '*.py' | xargs sed -i '1s|^#!python|#!%{__python2}|'
4c4d6ea
%patch0 -p0
90bc4f1
popd
4c4d6ea
4c4d6ea
%if 0%{?with_python3}
90bc4f1
cp -a python2 python3
90bc4f1
find python3 -name '*.py' | xargs sed -i '1s|^#!python|#!%{__python3}|'
4c4d6ea
%endif # with_python3
4c4d6ea
4c4d6ea
%build
90bc4f1
pushd python2
90bc4f1
CFLAGS="%{optflags}" %{__python2} setup.py build --executable="%{__python2} -s"
90bc4f1
popd
4c4d6ea
4c4d6ea
%if 0%{?with_python3}
90bc4f1
pushd python3
90bc4f1
CFLAGS="%{optflags}" %{__python3} setup.py build --executable="%{__python3} -s"
4c4d6ea
popd
4c4d6ea
%endif # with_python3
4c4d6ea
4c4d6ea
%install
4c4d6ea
4c4d6ea
%if 0%{?with_python3}
90bc4f1
pushd python3
90bc4f1
CFLAGS="%{optflags}" %{__python3} setup.py install -O1 --skip-build --root $RPM_BUILD_ROOT
4c4d6ea
mv $RPM_BUILD_ROOT%{_bindir}/futurize $RPM_BUILD_ROOT%{_bindir}/python%{python3_version}-futurize
4c4d6ea
mv $RPM_BUILD_ROOT%{_bindir}/pasteurize $RPM_BUILD_ROOT%{_bindir}/python%{python3_version}-pasteurize
4c4d6ea
sed -i -e '/^#!\//, 1d' $RPM_BUILD_ROOT%{python3_sitelib}/future/backports/test/pystone.py
4c4d6ea
4c4d6ea
for i in futurize-3 futurize-%{?python3_shortver}; do
4c4d6ea
  touch $i
4c4d6ea
  install -p $i $RPM_BUILD_ROOT%{_bindir}
4c4d6ea
  ln -sf %{_bindir}/python%{python3_version}-futurize $RPM_BUILD_ROOT%{_bindir}/$i
4c4d6ea
done
4c4d6ea
for i in pasteurize-3 pasteurize-%{?python3_shortver}; do
4c4d6ea
  touch $i
4c4d6ea
  install -p $i $RPM_BUILD_ROOT%{_bindir}
4c4d6ea
  ln -sf %{_bindir}/python%{python3_version}-pasteurize $RPM_BUILD_ROOT%{_bindir}/$i
4c4d6ea
done
4c4d6ea
popd
4c4d6ea
%endif
4c4d6ea
90bc4f1
pushd python2
90bc4f1
CFLAGS="%{optflags}" %{__python2} setup.py install -O1 --skip-build --root $RPM_BUILD_ROOT
4c4d6ea
cp -p $RPM_BUILD_ROOT%{_bindir}/futurize $RPM_BUILD_ROOT%{_bindir}/python%{python2_version}-futurize
4c4d6ea
cp -p $RPM_BUILD_ROOT%{_bindir}/pasteurize $RPM_BUILD_ROOT%{_bindir}/python%{python2_version}-pasteurize
4c4d6ea
4c4d6ea
for i in futurize futurize-2 futurize-%{python2_version}; do
4c4d6ea
  touch $i
4c4d6ea
  install -p $i $RPM_BUILD_ROOT%{_bindir}
4c4d6ea
  ln -sf %{_bindir}/python%{python2_version}-futurize $RPM_BUILD_ROOT%{_bindir}/$i
4c4d6ea
done
4c4d6ea
for i in pasteurize pasteurize-2 pasteurize-%{python2_version}; do
4c4d6ea
  touch $i
4c4d6ea
  install -p $i $RPM_BUILD_ROOT%{_bindir}
4c4d6ea
  ln -sf %{_bindir}/python%{python2_version}-pasteurize $RPM_BUILD_ROOT%{_bindir}/$i
4c4d6ea
done
4c4d6ea
sed -i -e '/^#!\//, 1d' $RPM_BUILD_ROOT%{python2_sitelib}/future/backports/test/pystone.py
90bc4f1
popd
4c4d6ea
4c4d6ea
##This packages ships PEM certificates in future/backports/test directory
4c4d6ea
##It's for testing purpose, i guess. Ignore them.
4c4d6ea
%check
90bc4f1
pushd python2
4c4d6ea
PYTHONPATH=$PWD/build/lib py.test -v
90bc4f1
popd
4c4d6ea
c71511f
%if 0%{?with_python3} && !%{?with_python35}
90bc4f1
pushd python3
4c4d6ea
PYTHONPATH=$PWD/build/lib py.test-%{python3_version} -v
4c4d6ea
popd
c71511f
%endif # with_python3 # with_python35
4c4d6ea
5865eee
%files -n python2-%{name}
4c4d6ea
%{!?_licensedir:%global license %doc}
90bc4f1
%doc python2/README.rst
90bc4f1
%license python2/LICENSE.txt
4c4d6ea
%{_bindir}/futurize
4c4d6ea
%{_bindir}/futurize-2*
4c4d6ea
%{_bindir}/pasteurize
4c4d6ea
%{_bindir}/pasteurize-2*
4c4d6ea
%{_bindir}/python%{python2_version}-futurize
4c4d6ea
%{_bindir}/python%{python2_version}-pasteurize
4c4d6ea
%{python2_sitelib}/future/
4c4d6ea
%{python2_sitelib}/past/
4c4d6ea
%{python2_sitelib}/libfuturize/
4c4d6ea
%{python2_sitelib}/libpasteurize/
4c4d6ea
%{python2_sitelib}/tkinter/
4c4d6ea
%{python2_sitelib}/_dummy_thread/
4c4d6ea
%{python2_sitelib}/_markupbase/
4c4d6ea
%{python2_sitelib}/_thread/
4c4d6ea
%{python2_sitelib}/builtins/
4c4d6ea
%{python2_sitelib}/copyreg/
4c4d6ea
%{python2_sitelib}/html/
4c4d6ea
%{python2_sitelib}/http/
4c4d6ea
%{python2_sitelib}/queue/
4c4d6ea
%{python2_sitelib}/reprlib/
4c4d6ea
%{python2_sitelib}/socketserver/
4c4d6ea
%{python2_sitelib}/winreg/
4c4d6ea
%{python2_sitelib}/xmlrpc/
4c4d6ea
%{python2_sitelib}/*.egg-info
4c4d6ea
4c4d6ea
%if 0%{?with_python3}
4c4d6ea
%files -n python3-%{name}
4c4d6ea
%{!?_licensedir:%global license %doc}
90bc4f1
%license python3/LICENSE.txt
90bc4f1
%doc python3/README.rst
4c4d6ea
%{_bindir}/futurize-3*
4c4d6ea
%{_bindir}/pasteurize-3*
4c4d6ea
%{_bindir}/python%{python3_version}-futurize
4c4d6ea
%{_bindir}/python%{python3_version}-pasteurize
4c4d6ea
%{python3_sitelib}/future/
4c4d6ea
%{python3_sitelib}/past/
4c4d6ea
%{python3_sitelib}/libfuturize/
4c4d6ea
%{python3_sitelib}/libpasteurize/
4c4d6ea
%{python3_sitelib}/*.egg-info
4c4d6ea
%endif
4c4d6ea
4c4d6ea
%changelog
54aefc0
* Fri Feb 10 2017 Fedora Release Engineering <releng@fedoraproject.org> - 0.16.0-4
54aefc0
- Rebuilt for https://fedoraproject.org/wiki/Fedora_26_Mass_Rebuild
54aefc0
6c30623
* Mon Dec 19 2016 Miro Hrončok <mhroncok@redhat.com> - 0.16.0-3
6c30623
- Rebuild for Python 3.6
6c30623
ea07c13
* Tue Dec 13 2016 Antonio Trande <sagitterATfedoraproject.org> - 0.16.0-2
ea07c13
- BR Python2 dependencies unversioned on epel6
ea07c13
b1f0ce8
* Tue Dec 13 2016 Antonio Trande <sagitterATfedoraproject.org> - 0.16.0-1
b1f0ce8
- Update to 0.16.0
b1f0ce8
b1f0ce8
* Wed Aug 17 2016 Antonio Trande <sagitterATfedoraproject.org> - 0.15.2-10
f9c6bf6
- Rebuild for Python 3.5.2
f9c6bf6
189f864
* Tue Jul 19 2016 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 0.15.2-9
189f864
- https://fedoraproject.org/wiki/Changes/Automatic_Provides_for_Python_RPM_Packages
189f864
96ecdf0
* Wed Feb 03 2016 Fedora Release Engineering <releng@fedoraproject.org> - 0.15.2-8
96ecdf0
- Rebuilt for https://fedoraproject.org/wiki/Fedora_24_Mass_Rebuild
96ecdf0
5865eee
* Fri Jan 29 2016 Antonio Trande <sagitterATfedoraproject.org> - 0.15.2-7
5865eee
- Renamed Python2 package
5865eee
90bc4f1
* Thu Dec 10 2015 Antonio Trande <sagitterATfedoraproject.org> - 0.15.2-6
90bc4f1
- SPEC file adapted to recent guidelines for Python
90bc4f1
c71511f
* Fri Nov 13 2015 Antonio Trande <sagitter@fedoraproject.org> 0.15.2-5
c71511f
- Rebuild
c71511f
87d21bd
* Fri Nov 13 2015 Antonio Trande <sagitter@fedoraproject.org> 0.15.2-4
87d21bd
- Python3 tests temporarily disabled with Python35
87d21bd
87d21bd
* Tue Nov 10 2015 Fedora Release Engineering <rel-eng@lists.fedoraproject.org>
87d21bd
- 0.15.2-3 - Rebuilt for https://fedoraproject.org/wiki/Changes/python3.5
f777061
449a855
* Mon Sep 14 2015 Antonio Trande <sagitter@fedoraproject.org> 0.15.2-2
449a855
- Patch0 updated
449a855
4c4d6ea
* Fri Sep 11 2015 Antonio Trande <sagitter@fedoraproject.org> 0.15.2-1
4c4d6ea
- Update to 0.15.2
4c4d6ea
4c4d6ea
* Wed Sep 02 2015 Antonio Trande <sagitter@fedoraproject.org> 0.15.0-4
4c4d6ea
- Added patch to exclude failed tests (patch0)
4c4d6ea
4c4d6ea
* Wed Aug 26 2015 Antonio Trande <sagitter@fedoraproject.org> 0.15.0-3
4c4d6ea
- Added python-provides macro
4c4d6ea
4c4d6ea
* Thu Jul 30 2015 Antonio Trande <sagitter@fedoraproject.org> 0.15.0-2
4c4d6ea
- Fixed Python3 packaging on Fedora
4c4d6ea
- Removed configparser backport (patch1)
4c4d6ea
4c4d6ea
* Tue Jul 28 2015 Antonio Trande <sagitter@fedoraproject.org> 0.15.0-1
4c4d6ea
- Initial build