Skip to content

Commit

Permalink
#1386: install both python2 and python3 builds with the "xpra" packag…
Browse files Browse the repository at this point in the history
…e, use python3 for the sound subprocess on Fedora and CentOS / RedHat

git-svn-id: https://xpra.org/svn/Xpra/trunk@14579 3bb7dfac-3a0b-4e04-842a-767bc560f471
  • Loading branch information
totaam committed Dec 23, 2016
1 parent 88041ee commit d93f204
Show file tree
Hide file tree
Showing 3 changed files with 48 additions and 27 deletions.
59 changes: 32 additions & 27 deletions rpmbuild/xpra.spec
Original file line number Diff line number Diff line change
Expand Up @@ -121,16 +121,31 @@ Name: xpra
Version: %{version}
Release: %{build_no}%{?dist}
Summary: Xpra gives you "persistent remote applications" for X.

Group: Networking
License: GPL
URL: http://xpra.org/
Packager: Antoine Martin <[email protected]>
Vendor: http://xpra.org/

Source: xpra-%{version}.tar.bz2
#rpm falls over itself if we try to make the top-level package noarch:
#BuildArch: noarch
BuildRoot: %{_tmppath}/%{name}-%{version}-root

Requires: xpra-common = %{version}-%{build_no}%{dist}
Requires: python2-xpra = %{version}-%{build_no}%{dist}
Requires: python3-xpra = %{version}-%{build_no}%{dist}
Requires: xpra-html5

%description
Xpra gives you "persistent remote applications" for X. That is, unlike normal X applications, applications run with xpra are "persistent" -- you can run them remotely, and they don't die if your connection does. You can detach them, and reattach them later -- even from another computer -- with no loss of state. And unlike VNC or RDP, xpra is for remote applications, not remote desktops -- individual applications show up as individual windows on your screen, managed by your window manager. They're not trapped in a box.

So basically it's screen for remote X apps.


%package -n python2-xpra
Summary: python2 build of xpra
Group: Networking

Requires: python %{requires_opengl} %{requires_sound} %{requires_lzo} %{requires_websockify} %{requires_printing} %{requires_webcam}
Requires: python2-lz4
Requires: %{requires_pygtk2}
Expand All @@ -156,7 +171,6 @@ Requires: ffmpeg-xpra
Requires: python2-pynvml
Requires: %{numpy}
Requires: xpra-common = %{version}-%{build_no}%{dist}
Requires: xpra-html5
%if 0%{?el7}
#sshpass is not available!
%else
Expand Down Expand Up @@ -209,21 +223,9 @@ Requires(post): desktop-file-utils
Requires(postun): desktop-file-utils
Requires: %{requires_crypto}

%if %{with_python3}
BuildRequires: python3-devel
BuildRequires: python3-Cython
BuildRequires: python3-numpy
BuildRequires: gtk3-devel
BuildRequires: python3-gobject
BuildRequires: gobject-introspection-devel
BuildRequires: python3-rencode
%endif

%description -n python2-xpra
This package contains the python2 build of xpra.

%description
Xpra gives you "persistent remote applications" for X. That is, unlike normal X applications, applications run with xpra are "persistent" -- you can run them remotely, and they don't die if your connection does. You can detach them, and reattach them later -- even from another computer -- with no loss of state. And unlike VNC or RDP, xpra is for remote applications, not remote desktops -- individual applications show up as individual windows on your screen, managed by your window manager. They're not trapped in a box.

So basically it's screen for remote X apps.

#package containing the common bits:
%package common
Expand Down Expand Up @@ -272,27 +274,29 @@ Requires: xorg-x11-drv-dummy
Requires: %{requires_xorg}
Requires: %{libvpx}
%if 0%{?fedora}
BuildRequires: libwebp-devel
BuildRequires: libyuv-devel
Requires: libwebp
Requires: libyuv
%endif
Requires: x264-xpra
Requires: ffmpeg-xpra
Requires: xpra-common = %{build_no}%{dist}
Requires: xpra-html5
Requires: xpra-common = %{version}-%{build_no}%{dist}
#for running the tests:
BuildRequires: %{py3requires_crypto}
%if 0%{?fedora}
BuildRequires: libwebp-devel
BuildRequires: libyuv-devel
%endif
BuildRequires: python3-devel
BuildRequires: python3-Cython
BuildRequires: python3-numpy
BuildRequires: gtk3-devel
BuildRequires: python3-gobject
BuildRequires: gobject-introspection-devel
BuildRequires: python3-rencode

%description -n python3-xpra
Xpra gives you "persistent remote applications" for X. That is, unlike normal X applications, applications run with xpra are "persistent" -- you can run them remotely, and they don't die if your connection does. You can detach them, and reattach them later -- even from another computer -- with no loss of state. And unlike VNC or RDP, xpra is for remote applications, not remote desktops -- individual applications show up as individual windows on your screen, managed by your window manager. They're not trapped in a box.
This package contains the python3 build of xpra.

So basically it's screen for remote X apps.
%endif


%prep
rm -rf $RPM_BUILD_DIR/xpra-%{version}-python2 $RPM_BUILD_DIR/xpra-%{version}
bzcat $RPM_SOURCE_DIR/xpra-%{version}.tar.bz2 | tar -xf -
Expand Down Expand Up @@ -378,6 +382,7 @@ rm -fr ${RPM_BUILD_ROOT}/%{python3_sitearch}/unittests
%clean
rm -rf $RPM_BUILD_ROOT

%files

%files html5
%defattr(-,root,root)
Expand Down Expand Up @@ -425,7 +430,7 @@ rm -rf $RPM_BUILD_ROOT
%{_datadir}/selinux/*/cups_xpra.pp
%endif

%files
%files -n python2-xpra
%{python2_sitearch}/xpra
%{python2_sitearch}/xpra-*.egg-info

Expand Down
6 changes: 6 additions & 0 deletions src/xpra/os_util.py
Original file line number Diff line number Diff line change
Expand Up @@ -209,6 +209,12 @@ def is_Fedora():
def is_Arch():
return is_distribution_variant(b"Arch")

def is_CentOS():
return is_distribution_variant(b"CentOS")

def is_RedHat():
return is_distribution_variant(b"RedHat")


_linux_distribution = None
def get_linux_distribution():
Expand Down
10 changes: 10 additions & 0 deletions src/xpra/platform/xposix/paths.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,10 @@
import sys
import site

from xpra.util import envbool
from xpra.os_util import is_Fedora, is_CentOS, is_RedHat
SOUND_PYTHON3 = envbool("XPRA_SOUND_PYTHON3", is_Fedora() or is_CentOS() or is_RedHat())


def do_get_install_prefix():
#special case for "user" installations, ie:
Expand Down Expand Up @@ -99,3 +103,9 @@ def do_get_default_log_dirs():
if v:
return [v, "~/.xpra", "/tmp"]
return ["~/.xpra", "/tmp"]

def do_get_sound_command():
from xpra.platform.paths import get_xpra_command
if SOUND_PYTHON3:
return ["python3"]+get_xpra_command()
return get_xpra_command()

0 comments on commit d93f204

Please sign in to comment.