ddff526
%if 0%{?fedora} && 0%{?fedora} < 30
4c4d6ea
%global with_python3 1
ddff526
%global with_python2 1
ddff526
%endif
4c4d6ea
ddff526
%if 0%{?fedora} && 0%{?fedora} >= 30
ddff526
%global with_python3 1
ddff526
%global with_python2 1
4c4d6ea
%endif
4c4d6ea
ddff526
%if 0%{?rhel} && 0%{?rhel} < 7
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
ddff526
%global with_python2 1
4c4d6ea
%endif
4c4d6ea
ddff526
%if 0%{?rhel} && 0%{?rhel} >= 7
c6bd85c
%global with_python3 1
ddff526
%global with_python2 1
4c4d6ea
%endif
4c4d6ea
4c4d6ea
Name: future
4c4d6ea
Summary: Easy, clean, reliable Python 2/3 compatibility
d436bdf
Version: 0.17.0
03d3372
Release: 1%{?dist}
4c4d6ea
License: MIT
4c4d6ea
URL: http://python-future.org/
03d3372
Source0: https://github.com/PythonCharmers/python-future/archive/v%{version}/python-%{name}-%{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
ddff526
%if 0%{?with_python3_other}
ddff526
BuildRequires:  python%{python3_other_pkgversion}-devel
ddff526
%endif
ddff526
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
ddff526
%if 0%{?with_python2}
5865eee
%package -n python2-%{name}
5865eee
Summary: Easy, clean, reliable Python 2/3 compatibility
5865eee
%{?python_provide:%python_provide python2-%{name}}
f759a1c
%if 0%{?rhel} && 0%{?rhel} <= 6
f759a1c
BuildRequires: python-argparse, python-unittest2, python-importlib 
f759a1c
Requires:      python-importlib
f759a1c
Requires:      python-argparse
f759a1c
%endif
f759a1c
BuildRequires: python2-devel
f759a1c
BuildRequires: python2-setuptools
f759a1c
BuildRequires: python2-numpy
f759a1c
BuildRequires: python2-requests
f759a1c
BuildRequires: python2-pytest
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.
ddff526
%endif
5865eee
4c4d6ea
%if 0%{?with_python3}
c6bd85c
%package -n python%{python3_pkgversion}-%{name}
4c4d6ea
Summary: Easy, clean, reliable Python 2/3 compatibility
c6bd85c
%{?python_provide:%python_provide python%{python3_pkgversion}-%{name}}
c6bd85c
BuildRequires: python%{python3_pkgversion}-devel
c6bd85c
BuildRequires: python%{python3_pkgversion}-setuptools
c6bd85c
BuildRequires: python%{python3_pkgversion}-numpy
c6bd85c
BuildRequires: python%{python3_pkgversion}-requests
c6bd85c
BuildRequires: python%{python3_pkgversion}-pytest
ddff526
Provides:      future-python3 = 0:%{version}-%{release}
c6bd85c
c6bd85c
%description -n python%{python3_pkgversion}-%{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
ddff526
%if 0%{?with_python3_other}
ddff526
%package -n python%{python3_other_pkgversion}-%{name}
ddff526
Summary:        Easy, clean, reliable Python 2/3 compatibility
ddff526
%{?python_provide:%python_provide python%{python3_other_pkgversion}-%{name}}
ddff526
BuildRequires: python%{python3_other_pkgversion}-devel
ddff526
BuildRequires: python%{python3_other_pkgversion}-setuptools
ddff526
BuildRequires: python%{python3_other_pkgversion}-numpy
ddff526
BuildRequires: python%{python3_other_pkgversion}-requests
ddff526
BuildRequires: python%{python3_other_pkgversion}-pytest
ddff526
Provides:      future-python%{python3_other_pkgversion} = 0:%{version}-%{release}
ddff526
ddff526
%description -n python%{python3_other_pkgversion}-%{name}
ddff526
Python3-%{name} is the missing compatibility layer between Python 2 and
ddff526
Python 3. It allows you to use a single, clean Python 3.x-compatible
ddff526
codebase to support both Python 2 and Python 3 with minimal overhead.
ddff526
ddff526
It provides ``future`` and ``past`` packages with backports and forward
ddff526
ports of features from Python 3 and 2. It also comes with ``futurize`` and
ddff526
``pasteurize``, customized 2to3-based scripts that helps you to convert
ddff526
either Py2 or Py3 code easily to support both Python 2 and 3 in a single
ddff526
clean Py3-style codebase, module by module.
ddff526
%endif
ddff526
4c4d6ea
%prep
90bc4f1
%setup -qc
4c4d6ea
03d3372
pushd python-future-%{version}
ddff526
%patch0 -p0
ddff526
popd
ddff526
ddff526
%if 0%{?with_python2}
03d3372
cp -a python-future-%{version} python2
d053487
find python2 -name '*.py' | xargs sed -i '1s|^#!python|#!%{__python2}|'
ddff526
%endif
4c4d6ea
4c4d6ea
%if 0%{?with_python3}
03d3372
cp -a python-future-%{version} python3
90bc4f1
find python3 -name '*.py' | xargs sed -i '1s|^#!python|#!%{__python3}|'
4c4d6ea
%endif # with_python3
4c4d6ea
ddff526
%if 0%{?with_python3_other}
03d3372
cp -a python-future-%{version} python%{python3_other_pkgversion}
ddff526
find python%{python3_other_pkgversion} -name '*.py' | xargs sed -i '1s|^#!python|#!%{__python3}|'
ddff526
%endif
ddff526
4c4d6ea
%build
ddff526
%if 0%{?with_python2}
90bc4f1
pushd python2
ddff526
%py2_build
90bc4f1
popd
ddff526
%endif
4c4d6ea
4c4d6ea
%if 0%{?with_python3}
90bc4f1
pushd python3
ddff526
%py3_build
4c4d6ea
popd
4c4d6ea
%endif # with_python3
4c4d6ea
ddff526
%if 0%{?with_python3_other}
ddff526
pushd python%{python3_other_pkgversion}
ddff526
%py3_other_build
ddff526
popd
ddff526
%endif
ddff526
4c4d6ea
%install
4c4d6ea
4c4d6ea
%if 0%{?with_python3}
90bc4f1
pushd python3
ddff526
%py3_install
ddff526
mv $RPM_BUILD_ROOT%{_bindir}/futurize $RPM_BUILD_ROOT%{_bindir}/python%{python3_version}-futurize
ddff526
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
ddff526
for i in futurize-3 futurize-%{python3_version}; do
ddff526
  touch $i
ddff526
  install -p $i $RPM_BUILD_ROOT%{_bindir}
ddff526
  ln -sf %{_bindir}/python%{python3_version}-futurize $RPM_BUILD_ROOT%{_bindir}/$i
ddff526
done
ddff526
for i in pasteurize-3 pasteurize-%{python3_version}; do
ddff526
  touch $i
ddff526
  install -p $i $RPM_BUILD_ROOT%{_bindir}
ddff526
  ln -sf %{_bindir}/python%{python3_version}-pasteurize $RPM_BUILD_ROOT%{_bindir}/$i
ddff526
done
ddff526
popd
ddff526
%endif
ddff526
ddff526
%if 0%{?with_python3_other}
ddff526
pushd python%{python3_other_pkgversion}
ddff526
%py3_other_install
ddff526
mv $RPM_BUILD_ROOT%{_bindir}/futurize $RPM_BUILD_ROOT%{_bindir}/python%{python3_other_version}-futurize
ddff526
mv $RPM_BUILD_ROOT%{_bindir}/pasteurize $RPM_BUILD_ROOT%{_bindir}/python%{python3_other_version}-pasteurize
ddff526
sed -i -e '/^#!\//, 1d' $RPM_BUILD_ROOT%{python3_other_sitelib}/future/backports/test/pystone.py
ddff526
ddff526
for i in futurize-3 futurize-%{python3_other_version}; do
4c4d6ea
  touch $i
4c4d6ea
  install -p $i $RPM_BUILD_ROOT%{_bindir}
ddff526
  ln -sf %{_bindir}/python%{python3_other_version}-futurize $RPM_BUILD_ROOT%{_bindir}/$i
4c4d6ea
done
ddff526
for i in pasteurize-3 pasteurize-%{python3_other_version}; do
4c4d6ea
  touch $i
4c4d6ea
  install -p $i $RPM_BUILD_ROOT%{_bindir}
ddff526
  ln -sf %{_bindir}/python%{python3_other_version}-pasteurize $RPM_BUILD_ROOT%{_bindir}/$i
4c4d6ea
done
4c4d6ea
popd
4c4d6ea
%endif
4c4d6ea
ddff526
%if 0%{?with_python2}
90bc4f1
pushd python2
ddff526
%py2_install
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
ddff526
%endif
4c4d6ea
4c4d6ea
##This packages ships PEM certificates in future/backports/test directory
4c4d6ea
##It's for testing purpose, i guess. Ignore them.
4c4d6ea
%check
ddff526
%if 0%{?with_python2}
90bc4f1
pushd python2
4c4d6ea
PYTHONPATH=$PWD/build/lib py.test -v
90bc4f1
popd
ddff526
%endif
4c4d6ea
ddff526
%if 0%{?with_python3}
90bc4f1
pushd python3
ddff526
PYTHONPATH=$PWD/build/lib py.test-%{python3_version} -v
4c4d6ea
popd
ddff526
%endif # with_python3
ddff526
ddff526
%if 0%{?with_python3_other}
ddff526
pushd python%{python3_other_pkgversion}
ddff526
PYTHONPATH=$PWD/build/lib py.test-%{python3_other_version} -v
ddff526
popd
ddff526
%endif # with_python3
4c4d6ea
ddff526
%if 0%{?with_python2}
5865eee
%files -n python2-%{name}
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
ddff526
%endif
4c4d6ea
4c4d6ea
%if 0%{?with_python3}
c6bd85c
%files -n python%{python3_pkgversion}-%{name}
90bc4f1
%license python3/LICENSE.txt
90bc4f1
%doc python3/README.rst
c6bd85c
%{_bindir}/futurize-3
ddff526
%{_bindir}/futurize-%{python3_version}
c6bd85c
%{_bindir}/pasteurize-3
ddff526
%{_bindir}/pasteurize-%{python3_version}
ddff526
%{_bindir}/python%{python3_version}-futurize
ddff526
%{_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
ddff526
%if 0%{?with_python3_other}
ddff526
%files -n python%{python3_other_pkgversion}-%{name}
ddff526
%license python3/LICENSE.txt
ddff526
%doc python3/README.rst
ddff526
%{_bindir}/futurize-3
ddff526
%{_bindir}/futurize-%{python3_other_version}
ddff526
%{_bindir}/pasteurize-3
ddff526
%{_bindir}/pasteurize-%{python3_other_version}
ddff526
%{_bindir}/python%{python3_other_version}-futurize
ddff526
%{_bindir}/python%{python3_other_version}-pasteurize
ddff526
%{python3_other_sitelib}/future/
ddff526
%{python3_other_sitelib}/past/
ddff526
%{python3_other_sitelib}/libfuturize/
ddff526
%{python3_other_sitelib}/libpasteurize/
ddff526
%{python3_other_sitelib}/*.egg-info
ddff526
%endif
ddff526
ddff526
4c4d6ea
%changelog
03d3372
* Fri Oct 26 2018 Antonio Trande <sagitterATfedoraproject.org> - 0.17.0-1
03d3372
- Release 0.17.0
03d3372
d436bdf
* Wed Oct 24 2018 Antonio Trande <sagitterATfedoraproject.org> - 0.17.0-0.1.20181019gitbee0f3b
d436bdf
- Bump to a pre-release 0.17.0
d436bdf
d053487
* Wed Oct 24 2018 Antonio Trande <sagitterATfedoraproject.org> - 0.16.0-13.20181019gitbee0f3b
d053487
- Update to the commit #bee0f3b
d053487
- Perform all Python3 tests
d053487
cb0276c
* Fri Sep 21 2018 Antonio Trande <sagitterATfedoraproject.org> - 0.16.0-12.20180917gitaf02ef6
cb0276c
- Update to the commit #af02ef6
cb0276c
ddff526
* Sun Aug 26 2018 Antonio Trande <sagitterATfedoraproject.org> - 0.16.0-11
ddff526
- Prepare SPEC file for deprecation of Python2 on fedora 30+
ddff526
- Prepare SPEC file for Python3-modules packaging on epel7
ddff526
16b4fb1
* Fri Jul 13 2018 Fedora Release Engineering <releng@fedoraproject.org> - 0.16.0-10
16b4fb1
- Rebuilt for https://fedoraproject.org/wiki/Fedora_29_Mass_Rebuild
16b4fb1
0351165
* Tue Jun 19 2018 Miro Hrončok <mhroncok@redhat.com> - 0.16.0-9
0351165
- Rebuilt for Python 3.7
0351165
184ccdd
* Wed Feb 07 2018 Fedora Release Engineering <releng@fedoraproject.org> - 0.16.0-8
184ccdd
- Rebuilt for https://fedoraproject.org/wiki/Fedora_28_Mass_Rebuild
184ccdd
f759a1c
* Sun Jan 14 2018 Antonio Trande <sagitterATfedoraproject.org> - 0.16.0-7
f759a1c
- Use versioned Python2 packages
f759a1c
c6bd85c
* Fri Dec 15 2017 Antonio Trande <sagitterATfedoraproject.org> - 0.16.0-6
c6bd85c
- Python3 built on epel7
c6bd85c
2199817
* Wed Jul 26 2017 Fedora Release Engineering <releng@fedoraproject.org> - 0.16.0-5
2199817
- Rebuilt for https://fedoraproject.org/wiki/Fedora_27_Mass_Rebuild
2199817
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