From 3bada0e76a3d76ea252b43b73ea7cf9816fc1050 Mon Sep 17 00:00:00 2001 From: Antoine Martin Date: Tue, 3 Jul 2018 14:14:45 +0000 Subject: [PATCH] explicitly require python2 where appropriate to prevent deprecation warnings, and sooner or later actual breakage git-svn-id: https://xpra.org/svn/Xpra/trunk@19825 3bb7dfac-3a0b-4e04-842a-767bc560f471 --- rpmbuild/Cython.spec | 13 ++++++++----- rpmbuild/pygtkglext.spec | 10 +++++++--- rpmbuild/python-pillow.spec | 9 ++++++--- rpmbuild/python-uinput.spec | 7 +++++-- rpmbuild/python-websockify.spec | 11 ++++++++--- 5 files changed, 34 insertions(+), 16 deletions(-) diff --git a/rpmbuild/Cython.spec b/rpmbuild/Cython.spec index f6cd3b460f..488d73af2e 100644 --- a/rpmbuild/Cython.spec +++ b/rpmbuild/Cython.spec @@ -6,7 +6,7 @@ Name: python2-Cython Version: 0.28.3 -Release: 2%{?dist} +Release: 3%{?dist} Summary: A language for writing Python extension modules Group: Development/Tools @@ -50,11 +50,11 @@ cp -a . %{py3dir} find %{py3dir} -name '*.py' | xargs sed -i '1s|^#!python|#!%{__python3}|' %endif -find -name '*.py' | xargs sed -i '1s|^#!python|#!%{__python}|' +find -name '*.py' | xargs sed -i '1s|^#!python|#!%{__python2}|' %build -CFLAGS="$RPM_OPT_FLAGS" %{__python} setup.py build +CFLAGS="$RPM_OPT_FLAGS" %{__python2} setup.py build %if %{with_python3} pushd %{py3dir} @@ -77,7 +77,7 @@ rm -rf %{buildroot}%{python3_sitelib}/setuptools/tests popd %endif -%{__python} setup.py install -O1 --skip-build --root %{buildroot} +%{__python2} setup.py install -O1 --skip-build --root %{buildroot} rm -rf %{buildroot}%{python_sitelib}/setuptools/tests @@ -86,7 +86,7 @@ rm -rf %{buildroot} ##%%check -##%%{__python} runtests.py -x numpy +##%%{__python2} runtests.py -x numpy %files @@ -107,6 +107,9 @@ rm -rf %{buildroot} %changelog +* Tue Jul 03 2018 Antoine Martin - 0.28.3-3 +- use python2 explicitly + * Tue Jul 03 2018 Antoine Martin - 0.28.3-2 - try harder to prevent rpm db conflicts diff --git a/rpmbuild/pygtkglext.spec b/rpmbuild/pygtkglext.spec index b007aacc0f..6f0e4ab13e 100644 --- a/rpmbuild/pygtkglext.spec +++ b/rpmbuild/pygtkglext.spec @@ -1,5 +1,6 @@ -%{!?python_sitelib: %global python_sitelib %(%{__python} -c "from distutils.sysconfig import get_python_lib; print get_python_lib()")} -%{!?python_sitearch: %global python_sitearch %(%{__python} -c "from distutils.sysconfig import get_python_lib; print get_python_lib(1)")} +%{!?__python2: %define __python2 python2} +%{!?python_sitelib: %global python_sitelib %(%{__python2} -c "from distutils.sysconfig import get_python_lib; print get_python_lib()")} +%{!?python_sitearch: %global python_sitearch %(%{__python2} -c "from distutils.sysconfig import get_python_lib; print get_python_lib(1)")} %define pygtk2 pygtk2 %define pygtkglext pygtkglext @@ -11,7 +12,7 @@ Name: %{pygtkglext} Version: 1.1.0 -Release: 16.xpra1%{?dist} +Release: 16.xpra2%{?dist} Summary: Python bindings for GtkGLExt License: LGPLv2+ Group: System Environment/Libraries @@ -99,5 +100,8 @@ rm -rf $RPM_BUILD_ROOT %changelog +* Tue Jul 03 2018 Antoine Martin - 1.1.0-16.xpra2 +- use python2 explicitly + * Thu Dec 03 2015 Antoine Martin - 1.1.0-16.xpra1 - Added support for building on openSUSE diff --git a/rpmbuild/python-pillow.spec b/rpmbuild/python-pillow.spec index d55d5a4b0a..106010f1e7 100644 --- a/rpmbuild/python-pillow.spec +++ b/rpmbuild/python-pillow.spec @@ -34,7 +34,7 @@ Name: python2-pillow Version: 5.2.0 -Release: 2%{?snap}%{?dist} +Release: 3%{?snap}%{?dist} Summary: Python image processing library # License: see http://www.pythonware.com/products/pil/license.htm @@ -208,7 +208,7 @@ cp -a . %{py3dir} %build # Build Python 2 modules -find -name '*.py' | xargs sed -i '1s|^#!.*python|#!%{__python}|' +find -name '*.py' | xargs sed -i '1s|^#!.*python|#!%{__python2}|' CFLAGS="$RPM_OPT_FLAGS" %{__python2} setup.py build %if %{with_webp} == 0 #couldn't find a better way to disable webp: @@ -239,7 +239,7 @@ popd %install rm -rf $RPM_BUILD_ROOT install -d $RPM_BUILD_ROOT/%{py2_incdir}/Imaging -%{__python} setup.py install --skip-build --root $RPM_BUILD_ROOT +%{__python2} setup.py install --skip-build --root $RPM_BUILD_ROOT %if %{with_python3} pushd %{py3dir} @@ -296,6 +296,9 @@ rm -rf $RPM_BUILD_ROOT%{_bindir} %endif %changelog +* Tue Jul 03 2018 Antoine Martin - 5.2.0-3 +- use python2 explicitly + * Tue Jul 03 2018 Antoine Martin - 5.2.0-2 - try harder to prevent rpm db conflicts diff --git a/rpmbuild/python-uinput.spec b/rpmbuild/python-uinput.spec index 03e8ed00e4..1ce559bf98 100644 --- a/rpmbuild/python-uinput.spec +++ b/rpmbuild/python-uinput.spec @@ -10,7 +10,7 @@ Name: python2-uinput Version: 0.11.2 -Release: 2%{?dist} +Release: 3%{?dist} Summary: Pythonic API to the Linux uinput kernel module License: GPLv3 @@ -68,7 +68,7 @@ find %{py3dir} -name '*.py' | xargs sed -i '1s|^#!python|#!%{__python3}|' %build -CFLAGS="$RPM_OPT_FLAGS" %{__python} setup.py build +CFLAGS="$RPM_OPT_FLAGS" %{__python2} setup.py build %if 0%{?with_python3} pushd %{py3dir} @@ -108,6 +108,9 @@ chmod a-x examples/* %changelog +* Tue Jul 03 2018 Antoine Martin - 0.11.2-3 +- use python2 explicitly + * Mon Jan 22 2018 Antoine Martin - 0.11.2-2 - more explicit python version, sitearch paths diff --git a/rpmbuild/python-websockify.spec b/rpmbuild/python-websockify.spec index 15a07eb330..74a82464b8 100644 --- a/rpmbuild/python-websockify.spec +++ b/rpmbuild/python-websockify.spec @@ -1,6 +1,8 @@ +%{!?__python2: %define __python2 python2} + Name: python-websockify Version: 0.8.0 -Release: 1%{?dist} +Release: 2%{?dist} Summary: WSGI based adapter for the Websockets protocol License: LGPLv3 @@ -21,11 +23,11 @@ Python WSGI based adapter for the Websockets protocol sed -i '/setup_requires/d; /install_requires/d; /dependency_links/d' setup.py %build -%{__python} setup.py build +%{__python2} setup.py build %install -%{__python} setup.py install -O1 --skip-build --root %{buildroot} +%{__python2} setup.py install -O1 --skip-build --root %{buildroot} rm -Rf %{buildroot}/usr/share/websockify mkdir -p %{buildroot}%{_mandir}/man1/ @@ -41,5 +43,8 @@ install -m 444 docs/websockify.1 %{buildroot}%{_mandir}/man1/ %changelog +* Tue Jul 03 2018 Antoine Martin - 0.8.0-2 +- use python2 explicitly + * Wed Jan 17 2018 Antoine Martin - 0.8.0-1 - initial CentOS packaging