ddff52
%if 0%{?fedora} && 0%{?fedora} < 30
4c4d6e
%global with_python3 1
ddff52
%global with_python2 1
ddff52
%endif
4c4d6e
ddff52
%if 0%{?fedora} && 0%{?fedora} >= 30
ddff52
%global with_python3 1
ddff52
%global with_python2 1
4c4d6e
%endif
4c4d6e
ddff52
%if 0%{?rhel} && 0%{?rhel} < 7
4c4d6e
%{!?__python2: %global __python2 /usr/bin/python2}
4c4d6e
%{!?python2_sitelib: %global python2_sitelib %(%{__python2} -c "from distutils.sysconfig import get_python_lib; print(get_python_lib())")}
4c4d6e
%{!?python2_sitearch: %global python2_sitearch %(%{__python2} -c "from distutils.sysconfig import get_python_lib; print(get_python_lib(1))")}
4c4d6e
%global python2_version 2.6
4c4d6e
%global with_python3 0
ddff52
%global with_python2 1
4c4d6e
%endif
4c4d6e
ddff52
%if 0%{?rhel} && 0%{?rhel} >= 7
c6bd85
%global with_python3 1
ddff52
%global with_python2 1
4c4d6e
%endif
4c4d6e
cf52b8
%global commit c423752879acc05eebc29b0bb9909327bd5c7308
cf52b8
%global date 20190313
cf52b8
%global shortcommit %(c=%{commit}; echo ${c:0:7})
cf52b8
cf52b8
%global _description \
cf52b8
future is the missing compatibility layer between Python 2 and \
cf52b8
Python 3. It allows you to use a single, clean Python 3.x-compatible \
cf52b8
codebase to support both Python 2 and Python 3 with minimal overhead. \
cf52b8
\
cf52b8
It provides ``future`` and ``past`` packages with backports and forward \
cf52b8
ports of features from Python 3 and 2. It also comes with ``futurize`` and \
cf52b8
``pasteurize``, customized 2to3-based scripts that helps you to convert \
cf52b8
either Py2 or Py3 code easily to support both Python 2 and 3 in a single \
cf52b8
clean Py3-style codebase, module by module.
cf52b8
4c4d6e
Name: future
4c4d6e
Summary: Easy, clean, reliable Python 2/3 compatibility
cf52b8
Version: 0.17.1
cf52b8
Release: 0.1.%{date}git%{shortcommit}%{?dist}
4c4d6e
License: MIT
4c4d6e
URL: http://python-future.org/
cf52b8
Source0: https://github.com/PythonCharmers/python-future/archive/%{commit}/python-%{name}-%{commit}.tar.gz
4c4d6e
BuildArch: noarch
4c4d6e
cf52b8
# https://github.com/PythonCharmers/python-future/issues/165
4c4d6e
Patch0: %{name}-skip_tests_with_connection_errors.patch
4c4d6e
cf52b8
# Fix for Python-3.8
cf52b8
# https://github.com/PythonCharmers/python-future/pull/448
cf52b8
Patch1: %{name}-0.17.1-bug448.patch
cf52b8
ddff52
%if 0%{?with_python3_other}
ddff52
BuildRequires:  python%{python3_other_pkgversion}-devel
ddff52
%endif
ddff52
4c4d6e
%description
cf52b8
%{_description}
4c4d6e
ddff52
%if 0%{?with_python2}
5865ee
%package -n python2-%{name}
5865ee
Summary: Easy, clean, reliable Python 2/3 compatibility
5865ee
%{?python_provide:%python_provide python2-%{name}}
f759a1
%if 0%{?rhel} && 0%{?rhel} <= 6
f759a1
BuildRequires: python-argparse, python-unittest2, python-importlib 
f759a1
Requires:      python-importlib
f759a1
Requires:      python-argparse
f759a1
%endif
f759a1
BuildRequires: python2-devel
f759a1
BuildRequires: python2-setuptools
f759a1
BuildRequires: python2-numpy
f759a1
BuildRequires: python2-requests
f759a1
BuildRequires: python2-pytest
5865ee
Provides:      future = 0:%{version}-%{release}
5865ee
%description -n python2-%{name}
cf52b8
%{_description}
ddff52
%endif
5865ee
4c4d6e
%if 0%{?with_python3}
c6bd85
%package -n python%{python3_pkgversion}-%{name}
4c4d6e
Summary: Easy, clean, reliable Python 2/3 compatibility
c6bd85
%{?python_provide:%python_provide python%{python3_pkgversion}-%{name}}
c6bd85
BuildRequires: python%{python3_pkgversion}-devel
c6bd85
BuildRequires: python%{python3_pkgversion}-setuptools
c6bd85
BuildRequires: python%{python3_pkgversion}-numpy
c6bd85
BuildRequires: python%{python3_pkgversion}-requests
c6bd85
BuildRequires: python%{python3_pkgversion}-pytest
ddff52
Provides:      future-python3 = 0:%{version}-%{release}
c6bd85
c6bd85
%description -n python%{python3_pkgversion}-%{name}
cf52b8
%{_description}
4c4d6e
%endif # with_python3
4c4d6e
ddff52
%if 0%{?with_python3_other}
ddff52
%package -n python%{python3_other_pkgversion}-%{name}
ddff52
Summary:        Easy, clean, reliable Python 2/3 compatibility
ddff52
%{?python_provide:%python_provide python%{python3_other_pkgversion}-%{name}}
ddff52
BuildRequires: python%{python3_other_pkgversion}-devel
ddff52
BuildRequires: python%{python3_other_pkgversion}-setuptools
ddff52
BuildRequires: python%{python3_other_pkgversion}-numpy
ddff52
BuildRequires: python%{python3_other_pkgversion}-requests
ddff52
BuildRequires: python%{python3_other_pkgversion}-pytest
ddff52
Provides:      future-python%{python3_other_pkgversion} = 0:%{version}-%{release}
ddff52
ddff52
%description -n python%{python3_other_pkgversion}-%{name}
cf52b8
%{_description}
ddff52
%endif
ddff52
4c4d6e
%prep
cf52b8
%setup -qc -n python-future-%{commit}
4c4d6e
cf52b8
pushd python-future-%{commit}
ddff52
%patch0 -p0
cf52b8
%patch1 -p1
ddff52
popd
ddff52
ddff52
%if 0%{?with_python2}
cf52b8
cp -a python-future-%{commit} python2
d05348
find python2 -name '*.py' | xargs sed -i '1s|^#!python|#!%{__python2}|'
ddff52
%endif
4c4d6e
4c4d6e
%if 0%{?with_python3}
cf52b8
cp -a python-future-%{commit} python3
90bc4f
find python3 -name '*.py' | xargs sed -i '1s|^#!python|#!%{__python3}|'
4c4d6e
%endif # with_python3
4c4d6e
ddff52
%if 0%{?with_python3_other}
03d337
cp -a python-future-%{version} python%{python3_other_pkgversion}
ddff52
find python%{python3_other_pkgversion} -name '*.py' | xargs sed -i '1s|^#!python|#!%{__python3}|'
ddff52
%endif
ddff52
4c4d6e
%build
ddff52
%if 0%{?with_python2}
90bc4f
pushd python2
ddff52
%py2_build
90bc4f
popd
ddff52
%endif
4c4d6e
4c4d6e
%if 0%{?with_python3}
90bc4f
pushd python3
ddff52
%py3_build
4c4d6e
popd
4c4d6e
%endif # with_python3
4c4d6e
ddff52
%if 0%{?with_python3_other}
ddff52
pushd python%{python3_other_pkgversion}
ddff52
%py3_other_build
ddff52
popd
ddff52
%endif
ddff52
4c4d6e
%install
4c4d6e
4c4d6e
%if 0%{?with_python3}
90bc4f
pushd python3
ddff52
%py3_install
ddff52
mv $RPM_BUILD_ROOT%{_bindir}/futurize $RPM_BUILD_ROOT%{_bindir}/python%{python3_version}-futurize
ddff52
mv $RPM_BUILD_ROOT%{_bindir}/pasteurize $RPM_BUILD_ROOT%{_bindir}/python%{python3_version}-pasteurize
4c4d6e
sed -i -e '/^#!\//, 1d' $RPM_BUILD_ROOT%{python3_sitelib}/future/backports/test/pystone.py
4c4d6e
ddff52
for i in futurize-3 futurize-%{python3_version}; do
ddff52
  touch $i
ddff52
  install -p $i $RPM_BUILD_ROOT%{_bindir}
ddff52
  ln -sf %{_bindir}/python%{python3_version}-futurize $RPM_BUILD_ROOT%{_bindir}/$i
ddff52
done
ddff52
for i in pasteurize-3 pasteurize-%{python3_version}; do
ddff52
  touch $i
ddff52
  install -p $i $RPM_BUILD_ROOT%{_bindir}
ddff52
  ln -sf %{_bindir}/python%{python3_version}-pasteurize $RPM_BUILD_ROOT%{_bindir}/$i
ddff52
done
ddff52
popd
ddff52
%endif
ddff52
ddff52
%if 0%{?with_python3_other}
ddff52
pushd python%{python3_other_pkgversion}
ddff52
%py3_other_install
ddff52
mv $RPM_BUILD_ROOT%{_bindir}/futurize $RPM_BUILD_ROOT%{_bindir}/python%{python3_other_version}-futurize
ddff52
mv $RPM_BUILD_ROOT%{_bindir}/pasteurize $RPM_BUILD_ROOT%{_bindir}/python%{python3_other_version}-pasteurize
ddff52
sed -i -e '/^#!\//, 1d' $RPM_BUILD_ROOT%{python3_other_sitelib}/future/backports/test/pystone.py
ddff52
ddff52
for i in futurize-3 futurize-%{python3_other_version}; do
4c4d6e
  touch $i
4c4d6e
  install -p $i $RPM_BUILD_ROOT%{_bindir}
ddff52
  ln -sf %{_bindir}/python%{python3_other_version}-futurize $RPM_BUILD_ROOT%{_bindir}/$i
4c4d6e
done
ddff52
for i in pasteurize-3 pasteurize-%{python3_other_version}; do
4c4d6e
  touch $i
4c4d6e
  install -p $i $RPM_BUILD_ROOT%{_bindir}
ddff52
  ln -sf %{_bindir}/python%{python3_other_version}-pasteurize $RPM_BUILD_ROOT%{_bindir}/$i
4c4d6e
done
4c4d6e
popd
4c4d6e
%endif
4c4d6e
ddff52
%if 0%{?with_python2}
90bc4f
pushd python2
ddff52
%py2_install
4c4d6e
cp -p $RPM_BUILD_ROOT%{_bindir}/futurize $RPM_BUILD_ROOT%{_bindir}/python%{python2_version}-futurize
4c4d6e
cp -p $RPM_BUILD_ROOT%{_bindir}/pasteurize $RPM_BUILD_ROOT%{_bindir}/python%{python2_version}-pasteurize
4c4d6e
4c4d6e
for i in futurize futurize-2 futurize-%{python2_version}; do
4c4d6e
  touch $i
4c4d6e
  install -p $i $RPM_BUILD_ROOT%{_bindir}
4c4d6e
  ln -sf %{_bindir}/python%{python2_version}-futurize $RPM_BUILD_ROOT%{_bindir}/$i
4c4d6e
done
4c4d6e
for i in pasteurize pasteurize-2 pasteurize-%{python2_version}; do
4c4d6e
  touch $i
4c4d6e
  install -p $i $RPM_BUILD_ROOT%{_bindir}
4c4d6e
  ln -sf %{_bindir}/python%{python2_version}-pasteurize $RPM_BUILD_ROOT%{_bindir}/$i
4c4d6e
done
4c4d6e
sed -i -e '/^#!\//, 1d' $RPM_BUILD_ROOT%{python2_sitelib}/future/backports/test/pystone.py
90bc4f
popd
ddff52
%endif
4c4d6e
4c4d6e
##This packages ships PEM certificates in future/backports/test directory
4c4d6e
##It's for testing purpose, i guess. Ignore them.
4c4d6e
%check
ddff52
%if 0%{?with_python2}
90bc4f
pushd python2
Jeroen van Meeuwen (Kolab Systems) 1913f6
PYTHONPATH=$PWD/build/lib py.test-%{python2_version} -v
90bc4f
popd
ddff52
%endif
4c4d6e
ddff52
%if 0%{?with_python3}
90bc4f
pushd python3
ddff52
PYTHONPATH=$PWD/build/lib py.test-%{python3_version} -v
4c4d6e
popd
ddff52
%endif # with_python3
ddff52
ddff52
%if 0%{?with_python3_other}
ddff52
pushd python%{python3_other_pkgversion}
ddff52
PYTHONPATH=$PWD/build/lib py.test-%{python3_other_version} -v
ddff52
popd
ddff52
%endif # with_python3
4c4d6e
ddff52
%if 0%{?with_python2}
5865ee
%files -n python2-%{name}
90bc4f
%doc python2/README.rst
90bc4f
%license python2/LICENSE.txt
4c4d6e
%{_bindir}/futurize
4c4d6e
%{_bindir}/futurize-2*
4c4d6e
%{_bindir}/pasteurize
4c4d6e
%{_bindir}/pasteurize-2*
4c4d6e
%{_bindir}/python%{python2_version}-futurize
4c4d6e
%{_bindir}/python%{python2_version}-pasteurize
4c4d6e
%{python2_sitelib}/future/
4c4d6e
%{python2_sitelib}/past/
4c4d6e
%{python2_sitelib}/libfuturize/
4c4d6e
%{python2_sitelib}/libpasteurize/
4c4d6e
%{python2_sitelib}/tkinter/
4c4d6e
%{python2_sitelib}/_dummy_thread/
4c4d6e
%{python2_sitelib}/_markupbase/
4c4d6e
%{python2_sitelib}/_thread/
4c4d6e
%{python2_sitelib}/builtins/
4c4d6e
%{python2_sitelib}/copyreg/
4c4d6e
%{python2_sitelib}/html/
4c4d6e
%{python2_sitelib}/http/
4c4d6e
%{python2_sitelib}/queue/
4c4d6e
%{python2_sitelib}/reprlib/
4c4d6e
%{python2_sitelib}/socketserver/
4c4d6e
%{python2_sitelib}/winreg/
4c4d6e
%{python2_sitelib}/xmlrpc/
4c4d6e
%{python2_sitelib}/*.egg-info
ddff52
%endif
4c4d6e
4c4d6e
%if 0%{?with_python3}
c6bd85
%files -n python%{python3_pkgversion}-%{name}
90bc4f
%license python3/LICENSE.txt
90bc4f
%doc python3/README.rst
c6bd85
%{_bindir}/futurize-3
ddff52
%{_bindir}/futurize-%{python3_version}
c6bd85
%{_bindir}/pasteurize-3
ddff52
%{_bindir}/pasteurize-%{python3_version}
ddff52
%{_bindir}/python%{python3_version}-futurize
ddff52
%{_bindir}/python%{python3_version}-pasteurize
4c4d6e
%{python3_sitelib}/future/
4c4d6e
%{python3_sitelib}/past/
4c4d6e
%{python3_sitelib}/libfuturize/
4c4d6e
%{python3_sitelib}/libpasteurize/
4c4d6e
%{python3_sitelib}/*.egg-info
4c4d6e
%endif
4c4d6e
ddff52
%if 0%{?with_python3_other}
ddff52
%files -n python%{python3_other_pkgversion}-%{name}
ddff52
%license python3/LICENSE.txt
ddff52
%doc python3/README.rst
ddff52
%{_bindir}/futurize-3
ddff52
%{_bindir}/futurize-%{python3_other_version}
ddff52
%{_bindir}/pasteurize-3
ddff52
%{_bindir}/pasteurize-%{python3_other_version}
ddff52
%{_bindir}/python%{python3_other_version}-futurize
ddff52
%{_bindir}/python%{python3_other_version}-pasteurize
ddff52
%{python3_other_sitelib}/future/
ddff52
%{python3_other_sitelib}/past/
ddff52
%{python3_other_sitelib}/libfuturize/
ddff52
%{python3_other_sitelib}/libpasteurize/
ddff52
%{python3_other_sitelib}/*.egg-info
ddff52
%endif
ddff52
ddff52
4c4d6e
%changelog
cf52b8
* Tue Apr 09 2019 Antonio Trande <sagitteratfedoraproject.org> - 0.17.1-0.1.20190313gitc423752
cf52b8
- Bump to a pre-release 0.17.1 (fix rhbz#1698160, upstream bug #488)
cf52b8
d1a0c5
* Thu Jan 31 2019 Fedora Release Engineering <releng@fedoraproject.org> - 0.17.0-2
d1a0c5
- Rebuilt for https://fedoraproject.org/wiki/Fedora_30_Mass_Rebuild
d1a0c5
03d337
* Fri Oct 26 2018 Antonio Trande <sagitteratfedoraproject.org> - 0.17.0-1
03d337
- Release 0.17.0
03d337
d436bd
* Wed Oct 24 2018 Antonio Trande <sagitteratfedoraproject.org> - 0.17.0-0.1.20181019gitbee0f3b
d436bd
- Bump to a pre-release 0.17.0
d436bd
d05348
* Wed Oct 24 2018 Antonio Trande <sagitteratfedoraproject.org> - 0.16.0-13.20181019gitbee0f3b
d05348
- Update to the commit #bee0f3b
d05348
- Perform all Python3 tests
d05348
cb0276
* Fri Sep 21 2018 Antonio Trande <sagitteratfedoraproject.org> - 0.16.0-12.20180917gitaf02ef6
cb0276
- Update to the commit #af02ef6
cb0276
ddff52
* Sun Aug 26 2018 Antonio Trande <sagitteratfedoraproject.org> - 0.16.0-11
ddff52
- Prepare SPEC file for deprecation of Python2 on fedora 30+
ddff52
- Prepare SPEC file for Python3-modules packaging on epel7
ddff52
16b4fb
* Fri Jul 13 2018 Fedora Release Engineering <releng@fedoraproject.org> - 0.16.0-10
16b4fb
- Rebuilt for https://fedoraproject.org/wiki/Fedora_29_Mass_Rebuild
16b4fb
035116
* Tue Jun 19 2018 Miro Hrončok <mhroncok@redhat.com> - 0.16.0-9
035116
- Rebuilt for Python 3.7
035116
184ccd
* Wed Feb 07 2018 Fedora Release Engineering <releng@fedoraproject.org> - 0.16.0-8
184ccd
- Rebuilt for https://fedoraproject.org/wiki/Fedora_28_Mass_Rebuild
184ccd
f759a1
* Sun Jan 14 2018 Antonio Trande <sagitteratfedoraproject.org> - 0.16.0-7
f759a1
- Use versioned Python2 packages
f759a1
c6bd85
* Fri Dec 15 2017 Antonio Trande <sagitteratfedoraproject.org> - 0.16.0-6
c6bd85
- Python3 built on epel7
c6bd85
219981
* Wed Jul 26 2017 Fedora Release Engineering <releng@fedoraproject.org> - 0.16.0-5
219981
- Rebuilt for https://fedoraproject.org/wiki/Fedora_27_Mass_Rebuild
219981
54aefc
* Fri Feb 10 2017 Fedora Release Engineering <releng@fedoraproject.org> - 0.16.0-4
54aefc
- Rebuilt for https://fedoraproject.org/wiki/Fedora_26_Mass_Rebuild
54aefc
6c3062
* Mon Dec 19 2016 Miro Hrončok <mhroncok@redhat.com> - 0.16.0-3
6c3062
- Rebuild for Python 3.6
6c3062
ea07c1
* Tue Dec 13 2016 Antonio Trande <sagitteratfedoraproject.org> - 0.16.0-2
ea07c1
- BR Python2 dependencies unversioned on epel6
ea07c1
b1f0ce
* Tue Dec 13 2016 Antonio Trande <sagitteratfedoraproject.org> - 0.16.0-1
b1f0ce
- Update to 0.16.0
b1f0ce
b1f0ce
* Wed Aug 17 2016 Antonio Trande <sagitteratfedoraproject.org> - 0.15.2-10
f9c6bf
- Rebuild for Python 3.5.2
f9c6bf
189f86
* Tue Jul 19 2016 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 0.15.2-9
189f86
- https://fedoraproject.org/wiki/Changes/Automatic_Provides_for_Python_RPM_Packages
189f86
96ecdf
* Wed Feb 03 2016 Fedora Release Engineering <releng@fedoraproject.org> - 0.15.2-8
96ecdf
- Rebuilt for https://fedoraproject.org/wiki/Fedora_24_Mass_Rebuild
96ecdf
5865ee
* Fri Jan 29 2016 Antonio Trande <sagitteratfedoraproject.org> - 0.15.2-7
5865ee
- Renamed Python2 package
5865ee
90bc4f
* Thu Dec 10 2015 Antonio Trande <sagitteratfedoraproject.org> - 0.15.2-6
90bc4f
- SPEC file adapted to recent guidelines for Python
90bc4f
c71511
* Fri Nov 13 2015 Antonio Trande <sagitter@fedoraproject.org> 0.15.2-5
c71511
- Rebuild
c71511
87d21b
* Fri Nov 13 2015 Antonio Trande <sagitter@fedoraproject.org> 0.15.2-4
87d21b
- Python3 tests temporarily disabled with Python35
87d21b
87d21b
* Tue Nov 10 2015 Fedora Release Engineering <rel-eng@lists.fedoraproject.org>
87d21b
- 0.15.2-3 - Rebuilt for https://fedoraproject.org/wiki/Changes/python3.5
f77706
449a85
* Mon Sep 14 2015 Antonio Trande <sagitter@fedoraproject.org> 0.15.2-2
449a85
- Patch0 updated
449a85
4c4d6e
* Fri Sep 11 2015 Antonio Trande <sagitter@fedoraproject.org> 0.15.2-1
4c4d6e
- Update to 0.15.2
4c4d6e
4c4d6e
* Wed Sep 02 2015 Antonio Trande <sagitter@fedoraproject.org> 0.15.0-4
4c4d6e
- Added patch to exclude failed tests (patch0)
4c4d6e
4c4d6e
* Wed Aug 26 2015 Antonio Trande <sagitter@fedoraproject.org> 0.15.0-3
4c4d6e
- Added python-provides macro
4c4d6e
4c4d6e
* Thu Jul 30 2015 Antonio Trande <sagitter@fedoraproject.org> 0.15.0-2
4c4d6e
- Fixed Python3 packaging on Fedora
4c4d6e
- Removed configparser backport (patch1)
4c4d6e
4c4d6e
* Tue Jul 28 2015 Antonio Trande <sagitter@fedoraproject.org> 0.15.0-1
4c4d6e
- Initial build