Skip to content

Commit

Permalink
explicitly require python2 where appropriate to prevent deprecation w…
Browse files Browse the repository at this point in the history
…arnings, and sooner or later actual breakage

git-svn-id: https://xpra.org/svn/Xpra/trunk@19825 3bb7dfac-3a0b-4e04-842a-767bc560f471
  • Loading branch information
totaam committed Jul 3, 2018
1 parent 8a8c9e1 commit 3bada0e
Show file tree
Hide file tree
Showing 5 changed files with 34 additions and 16 deletions.
13 changes: 8 additions & 5 deletions rpmbuild/Cython.spec
Expand Up @@ -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
Expand Down Expand Up @@ -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}
Expand All @@ -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


Expand All @@ -86,7 +86,7 @@ rm -rf %{buildroot}


##%%check
##%%{__python} runtests.py -x numpy
##%%{__python2} runtests.py -x numpy


%files
Expand All @@ -107,6 +107,9 @@ rm -rf %{buildroot}


%changelog
* Tue Jul 03 2018 Antoine Martin <antoine@devloop.org.uk> - 0.28.3-3
- use python2 explicitly

* Tue Jul 03 2018 Antoine Martin <antoine@devloop.org.uk> - 0.28.3-2
- try harder to prevent rpm db conflicts

Expand Down
10 changes: 7 additions & 3 deletions 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
Expand All @@ -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
Expand Down Expand Up @@ -99,5 +100,8 @@ rm -rf $RPM_BUILD_ROOT


%changelog
* Tue Jul 03 2018 Antoine Martin <antoine@devloop.org.uk> - 1.1.0-16.xpra2
- use python2 explicitly

* Thu Dec 03 2015 Antoine Martin <antoine@nagafix.co.uk> - 1.1.0-16.xpra1
- Added support for building on openSUSE
9 changes: 6 additions & 3 deletions rpmbuild/python-pillow.spec
Expand Up @@ -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
Expand Down Expand Up @@ -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:
Expand Down Expand Up @@ -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}
Expand Down Expand Up @@ -296,6 +296,9 @@ rm -rf $RPM_BUILD_ROOT%{_bindir}
%endif

%changelog
* Tue Jul 03 2018 Antoine Martin <antoine@devloop.org.uk> - 5.2.0-3
- use python2 explicitly

* Tue Jul 03 2018 Antoine Martin <antoine@devloop.org.uk> - 5.2.0-2
- try harder to prevent rpm db conflicts

Expand Down
7 changes: 5 additions & 2 deletions rpmbuild/python-uinput.spec
Expand Up @@ -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
Expand Down Expand Up @@ -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}
Expand Down Expand Up @@ -108,6 +108,9 @@ chmod a-x examples/*


%changelog
* Tue Jul 03 2018 Antoine Martin <antoine@devloop.org.uk> - 0.11.2-3
- use python2 explicitly

* Mon Jan 22 2018 Antoine Martin <antoine@devloop.org.uk> - 0.11.2-2
- more explicit python version, sitearch paths

Expand Down
11 changes: 8 additions & 3 deletions 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
Expand All @@ -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/
Expand All @@ -41,5 +43,8 @@ install -m 444 docs/websockify.1 %{buildroot}%{_mandir}/man1/


%changelog
* Tue Jul 03 2018 Antoine Martin <antoine@devloop.org.uk> - 0.8.0-2
- use python2 explicitly

* Wed Jan 17 2018 Antoine Martin <antoine@devloop.org.uk> - 0.8.0-1
- initial CentOS packaging

0 comments on commit 3bada0e

Please sign in to comment.