Blame SPECS/future.spec

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