diff --git a/.gitignore b/.gitignore index 414d752..2a0574e 100644 --- a/.gitignore +++ b/.gitignore @@ -4,3 +4,4 @@ /python-future-bee0f3bcb8ba9e7bd131d64e3bf631f5bd06c5b4.tar.gz /python-future-0.17.0.tar.gz /python-future-c423752879acc05eebc29b0bb9909327bd5c7308.tar.gz +/python-future-23989c4d61a5e3b2308b107efc1402bc727e8fe6.tar.gz diff --git a/future.spec b/future.spec index 75ba373..b2904f2 100644 --- a/future.spec +++ b/future.spec @@ -1,11 +1,5 @@ -%if 0%{?fedora} && 0%{?fedora} < 30 +%if 0%{?fedora} || 0%{?rhel} > 7 %global with_python3 1 -%global with_python2 1 -%endif - -%if 0%{?fedora} && 0%{?fedora} >= 30 -%global with_python3 1 -%global with_python2 1 %endif %if 0%{?rhel} && 0%{?rhel} < 7 @@ -13,17 +7,16 @@ %{!?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))")} %global python2_version 2.6 -%global with_python3 0 %global with_python2 1 %endif -%if 0%{?rhel} && 0%{?rhel} >= 7 +%if 0%{?rhel} && 0%{?rhel} == 7 %global with_python3 1 %global with_python2 1 %endif -%global commit c423752879acc05eebc29b0bb9909327bd5c7308 -%global date 20190313 +%global commit 23989c4d61a5e3b2308b107efc1402bc727e8fe6 +%global date 20190506 %global shortcommit %(c=%{commit}; echo ${c:0:7}) %global _description \ @@ -40,7 +33,7 @@ clean Py3-style codebase, module by module. Name: future Summary: Easy, clean, reliable Python 2/3 compatibility Version: 0.17.1 -Release: 0.1.%{date}git%{shortcommit}%{?dist} +Release: 0.2.%{date}git%{shortcommit}%{?dist} License: MIT URL: http://python-future.org/ Source0: https://github.com/PythonCharmers/python-future/archive/%{commit}/python-%{name}-%{commit}.tar.gz @@ -64,11 +57,12 @@ BuildRequires: python%{python3_other_pkgversion}-devel %package -n python2-%{name} Summary: Easy, clean, reliable Python 2/3 compatibility %{?python_provide:%python_provide python2-%{name}} -%if 0%{?rhel} && 0%{?rhel} <= 6 +%if 0%{?el6} BuildRequires: python-argparse, python-unittest2, python-importlib Requires: python-importlib Requires: python-argparse %endif +%if 0%{?el7} BuildRequires: python2-devel BuildRequires: python2-setuptools BuildRequires: python2-numpy @@ -78,6 +72,7 @@ Provides: future = 0:%{version}-%{release} %description -n python2-%{name} %{_description} %endif +%endif %if 0%{?with_python3} %package -n python%{python3_pkgversion}-%{name} @@ -89,10 +84,17 @@ BuildRequires: python%{python3_pkgversion}-numpy BuildRequires: python%{python3_pkgversion}-requests BuildRequires: python%{python3_pkgversion}-pytest Provides: future-python3 = 0:%{version}-%{release} +%if 0%{?fedora} +Obsoletes: python2-%{name} +%endif +%if 0%{?rhel} +Obsoletes: python34-%{name} +%endif %description -n python%{python3_pkgversion}-%{name} %{_description} -%endif # with_python3 +%endif +# with_python3 %if 0%{?with_python3_other} %package -n python%{python3_other_pkgversion}-%{name} @@ -156,6 +158,7 @@ popd %if 0%{?with_python3} pushd python3 %py3_install +%if 0%{?rhel} && 0%{?rhel} >= 7 mv $RPM_BUILD_ROOT%{_bindir}/futurize $RPM_BUILD_ROOT%{_bindir}/python%{python3_version}-futurize mv $RPM_BUILD_ROOT%{_bindir}/pasteurize $RPM_BUILD_ROOT%{_bindir}/python%{python3_version}-pasteurize sed -i -e '/^#!\//, 1d' $RPM_BUILD_ROOT%{python3_sitelib}/future/backports/test/pystone.py @@ -172,6 +175,24 @@ for i in pasteurize-3 pasteurize-%{python3_version}; do done popd %endif +%if 0%{?fedora} +cp -pr $RPM_BUILD_ROOT%{_bindir}/futurize $RPM_BUILD_ROOT%{_bindir}/python%{python3_version}-futurize +cp -pr $RPM_BUILD_ROOT%{_bindir}/pasteurize $RPM_BUILD_ROOT%{_bindir}/python%{python3_version}-pasteurize +sed -i -e '/^#!\//, 1d' $RPM_BUILD_ROOT%{python3_sitelib}/future/backports/test/pystone.py + +for i in futurize-%{python3_version}; do + touch -r $RPM_BUILD_ROOT%{_bindir}/futurize $i + install -p $i $RPM_BUILD_ROOT%{_bindir} + ln -sf %{_bindir}/python%{python3_version}-futurize $RPM_BUILD_ROOT%{_bindir}/$i +done +for i in pasteurize-%{python3_version}; do + touch -r $RPM_BUILD_ROOT%{_bindir}/pasteurize $i + install -p $i $RPM_BUILD_ROOT%{_bindir} + ln -sf %{_bindir}/python%{python3_version}-pasteurize $RPM_BUILD_ROOT%{_bindir}/$i +done +popd +%endif +%endif %if 0%{?with_python3_other} pushd python%{python3_other_pkgversion} @@ -180,13 +201,13 @@ mv $RPM_BUILD_ROOT%{_bindir}/futurize $RPM_BUILD_ROOT%{_bindir}/python%{python3_ mv $RPM_BUILD_ROOT%{_bindir}/pasteurize $RPM_BUILD_ROOT%{_bindir}/python%{python3_other_version}-pasteurize sed -i -e '/^#!\//, 1d' $RPM_BUILD_ROOT%{python3_other_sitelib}/future/backports/test/pystone.py -for i in futurize-3 futurize-%{python3_other_version}; do - touch $i +for i in futurize-%{python3_other_version}; do + touch -r $RPM_BUILD_ROOT%{_bindir}/python%{python3_other_version}-futurize $i install -p $i $RPM_BUILD_ROOT%{_bindir} ln -sf %{_bindir}/python%{python3_other_version}-futurize $RPM_BUILD_ROOT%{_bindir}/$i done -for i in pasteurize-3 pasteurize-%{python3_other_version}; do - touch $i +for i in pasteurize-%{python3_other_version}; do + touch -r $RPM_BUILD_ROOT%{_bindir}/python%{python3_other_version}-pasteurize $i install -p $i $RPM_BUILD_ROOT%{_bindir} ln -sf %{_bindir}/python%{python3_other_version}-pasteurize $RPM_BUILD_ROOT%{_bindir}/$i done @@ -196,16 +217,16 @@ popd %if 0%{?with_python2} pushd python2 %py2_install -cp -p $RPM_BUILD_ROOT%{_bindir}/futurize $RPM_BUILD_ROOT%{_bindir}/python%{python2_version}-futurize -cp -p $RPM_BUILD_ROOT%{_bindir}/pasteurize $RPM_BUILD_ROOT%{_bindir}/python%{python2_version}-pasteurize +cp -pr $RPM_BUILD_ROOT%{_bindir}/futurize $RPM_BUILD_ROOT%{_bindir}/python%{python2_version}-futurize +cp -pr $RPM_BUILD_ROOT%{_bindir}/pasteurize $RPM_BUILD_ROOT%{_bindir}/python%{python2_version}-pasteurize -for i in futurize futurize-2 futurize-%{python2_version}; do - touch $i +for i in futurize-2 futurize-%{python2_version}; do + touch -r $RPM_BUILD_ROOT%{_bindir}/futurize $i install -p $i $RPM_BUILD_ROOT%{_bindir} ln -sf %{_bindir}/python%{python2_version}-futurize $RPM_BUILD_ROOT%{_bindir}/$i done -for i in pasteurize pasteurize-2 pasteurize-%{python2_version}; do - touch $i +for i in pasteurize-2 pasteurize-%{python2_version}; do + touch -r $RPM_BUILD_ROOT%{_bindir}/pasteurize $i install -p $i $RPM_BUILD_ROOT%{_bindir} ln -sf %{_bindir}/python%{python2_version}-pasteurize $RPM_BUILD_ROOT%{_bindir}/$i done @@ -213,31 +234,33 @@ sed -i -e '/^#!\//, 1d' $RPM_BUILD_ROOT%{python2_sitelib}/future/backports/test/ popd %endif -##This packages ships PEM certificates in future/backports/test directory -##It's for testing purpose, i guess. Ignore them. +## This packages ships PEM certificates in future/backports/test directory. +## It's for testing purpose, i guess. Ignore them. %check %if 0%{?with_python2} pushd python2 -PYTHONPATH=$PWD/build/lib py.test-%{python2_version} -v +PYTHONPATH=$PWD/build/lib py.test-%{python2_version} popd %endif %if 0%{?with_python3} pushd python3 -PYTHONPATH=$PWD/build/lib py.test-%{python3_version} -v \ +PYTHONPATH=$PWD/build/lib py.test-%{python3_version} \ %if 0%{?python3_version_nodots} > 37 -k "not test_pow" # https://github.com/PythonCharmers/python-future/issues/474 %else ; %endif popd -%endif # with_python3 +%endif +# with_python3 %if 0%{?with_python3_other} pushd python%{python3_other_pkgversion} -PYTHONPATH=$PWD/build/lib py.test-%{python3_other_version} -v +PYTHONPATH=$PWD/build/lib py.test-%{python3_other_version} popd -%endif # with_python3 +%endif +# with_python3 %if 0%{?with_python2} %files -n python2-%{name} @@ -273,9 +296,15 @@ popd %files -n python%{python3_pkgversion}-%{name} %license python3/LICENSE.txt %doc python3/README.rst +%if 0%{?rhel} && 0%{?rhel} >= 7 %{_bindir}/futurize-3 -%{_bindir}/futurize-%{python3_version} %{_bindir}/pasteurize-3 +%endif +%if 0%{?fedora} +%{_bindir}/futurize +%{_bindir}/pasteurize +%endif +%{_bindir}/futurize-%{python3_version} %{_bindir}/pasteurize-%{python3_version} %{_bindir}/python%{python3_version}-futurize %{_bindir}/python%{python3_version}-pasteurize @@ -290,9 +319,7 @@ popd %files -n python%{python3_other_pkgversion}-%{name} %license python3/LICENSE.txt %doc python3/README.rst -%{_bindir}/futurize-3 %{_bindir}/futurize-%{python3_other_version} -%{_bindir}/pasteurize-3 %{_bindir}/pasteurize-%{python3_other_version} %{_bindir}/python%{python3_other_version}-futurize %{_bindir}/python%{python3_other_version}-pasteurize @@ -305,6 +332,11 @@ popd %changelog +* Tue Jul 23 2019 Antonio Trande - 0.17.1-0.2.20190506git23989c4 +- Bump to a pre-release 0.17.1, commit #23989c4 +- Unversioned commands point to Python3 on Fedora +- Obsolete Python2 version on Fedora + * Tue Apr 09 2019 Antonio Trande - 0.17.1-0.1.20190313gitc423752 - Bump to a pre-release 0.17.1 (fix rhbz#1698160, upstream bug #488) diff --git a/sources b/sources index 7419b11..6177e53 100644 --- a/sources +++ b/sources @@ -1 +1 @@ -SHA512 (python-future-c423752879acc05eebc29b0bb9909327bd5c7308.tar.gz) = 83054ff192bb22c82813344132e7f1fec25faec9baf947494486aaf574703a2d0aba2d4cd93e5882a9394c1d5d0d30cc18df18b076bf00eb139bb7d645be8af1 +SHA512 (python-future-23989c4d61a5e3b2308b107efc1402bc727e8fe6.tar.gz) = 890042c8b4129043ce0eca73785ac1424a5ef1d176e12661626c0fb93d3a0a1a7cb5efd6106740e8e8449a19c24f19dc2aa5d7a8b03bca95772ab71144242d16