78345db
%bcond_with enc_x264
b49472a
%bcond_with enc_x265
ff57c84
%bcond_with dec_avcodec2
78345db
%bcond_with csc_swscale
78345db
bee28cc
# For debugging only
bee28cc
%bcond_with debug
4f7f857
%if %{with debug}
9840109
%global _with_debug --with-debug
bee28cc
%endif
bee28cc
#
bee28cc
cae7f9d
%global __js_jquery_latest %{_datadir}/javascript/jquery/latest/
cae7f9d
70ec1d0
# These are necessary as the _with_foo is *not* defined if the
78345db
# --with flag isn't specifed, and we need to have the --without
78345db
# specified option in that case.
4f7f857
%if %{without enc_x264}
15ed227
%global _with_enc_x264 --without-enc_x264
78345db
%endif
78345db
b49472a
%if %{with enc_x265}
b49472a
%global _with_enc_x265 --with-enc_x265
b49472a
%endif
b49472a
4f7f857
%if %{without dec_avcodec2}
15ed227
%global _with_dec_avcodec2 --without-dec_avcodec2
78345db
%endif
78345db
4f7f857
%if %{without csc_swscale}
15ed227
%global _with_csc_swscale --without-csc_swscale
78345db
%endif
78345db
160512e
# Remove private provides from .so files in the python3_sitearch directory
fec68cf
%global __provides_exclude_from ^%{python3_sitearch}/.*\\.so$
78345db
aa89e44
# Note: cups-config not in buildroot during srpm build, so we use the
aa89e44
# conditional execution to silence erros during srpm build.
aa89e44
%if 0%{?_cups_serverbin:1}
aa89e44
%global cupslibdir %_cups_serverbin
aa89e44
%else
aa89e44
%global cupslibdir %(cups-config --serverbin 2> /dev/null || echo "/usr/lib/cups")
aa89e44
%endif
aa89e44
78345db
Name:           xpra
2bafbf3
Version:        4.4.6
19677b8
Release:        %autorelease
78345db
Summary:        Remote display server for applications and desktops
78345db
License:        GPLv2+ and BSD and LGPLv3+ and MIT
78345db
URL:            https://www.xpra.org/
a4c5459
Source0:        https://github.com/Xpra-org/xpra/archive/refs/tags/v%{version}/%{name}-%{version}.tar.gz
073a05e
# Appdata file for Fedora
073a05e
Source1:        %{name}.appdata.xml
87e1e20
Patch1:         ignore_assert_pandoc.patch
7638781
a2effeb
BuildRequires:  python3-devel
160512e
BuildRequires:  gtk3-devel
42bdc8a
BuildRequires:  libXtst-devel
78345db
BuildRequires:  libxkbfile-devel
70ec1d0
BuildRequires:  lz4-devel
dac08bf
BuildRequires:  python3-Cython
dac08bf
BuildRequires:  ack
78345db
BuildRequires:  desktop-file-utils
78345db
BuildRequires:  libvpx-devel
3f6fb19
BuildRequires:  libXdamage-devel
7cbecbe
BuildRequires:  libXres-devel
dd55e4d
BuildRequires:  cups-devel, cups
b09b741
BuildRequires:  redhat-rpm-config
06ee177
BuildRequires:  python3-rpm-macros
d59aa5c
BuildRequires:  gcc
823f8d0
BuildRequires:  pam-devel
Antonio Trande f48d6ac
BuildRequires:  pandoc
06ee177
# needs by setup.py to detect systemd `sd_listen_ENABLED = POSIX and pkg_config_ok("--exists", "libsystemd")`
06ee177
BuildRequires:  systemd-devel
3da1878
%if 0%{?fedora}
cc9ebae
BuildRequires:  procps-ng-devel
3da1878
%endif
06ee177
BuildRequires:  pkgconfig(libavif)
06ee177
BuildRequires:  pkgconfig(libqrencode)
06ee177
BuildRequires:  libdrm-devel
06ee177
BuildRequires:  pkgconfig(libwebp)
Antonio Trande 0fab12f
%if 0%{?el8}
3da1878
#BuildRequires:  xorg-x11-server-Xvfb
3da1878
#BuildRequires:  cairo-devel
Antonio Trande 0fab12f
BuildRequires:  pygobject3-devel
Antonio Trande 0fab12f
%else
Antonio Trande 0fab12f
BuildRequires:  python3-gobject-devel
3da1878
%endif
Antonio Trande 0fab12f
BuildRequires:  libappstream-glib
Antonio Trande 0fab12f
BuildRequires:  python3-cairo-devel
Antonio Trande f48d6ac
BuildRequires:  xorg-x11-server-Xorg
Antonio Trande f48d6ac
BuildRequires:  xorg-x11-drv-dummy
Antonio Trande f48d6ac
BuildRequires:  xorg-x11-xauth
4f7f857
BuildRequires:  xkbcomp
4f7f857
BuildRequires:  setxkbmap
bee28cc
%if %{with debug}
bee28cc
BuildRequires: libasan
bee28cc
%endif
ff57c84
78345db
%if %{with enc_x264}
78345db
BuildRequires:  x264-devel
78345db
%endif
ff57c84
%if %{with dec_avcodec2} || %{with csc_swscale}
a1b3e58
BuildRequires:  ffmpeg-devel
78345db
%endif
78345db
5643520
Requires: python3-pillow
5643520
Requires: python3-cups
5643520
Requires: python3-pyopengl
fec68cf
Requires: python3-gobject
fec68cf
Requires: python3-inotify
5643520
Requires: python3-lz4
fec68cf
Requires: python3-ldap3
5643520
Requires: python3-rencode
5643520
Requires: python3-netifaces
5643520
Requires: python3-dbus
cc9ebae
Requires: python3-numpy
4ed0085
%if 0%{?fedora}
cc9ebae
Requires: python3-zeroconf
4ed0085
%endif
5643520
Requires: dbus-x11
3f0ae89
Requires: xmodmap
3f0ae89
Requires: xrandr
aa89e44
Requires: xorg-x11-drv-dummy%{?_isa}
aa89e44
Requires: xorg-x11-xauth%{?_isa}
aa89e44
Requires: xorg-x11-server-Xorg%{?_isa}
aa89e44
Requires: gstreamer1%{?_isa}
aa89e44
Requires: gstreamer1-plugins-base%{?_isa}
aa89e44
Requires: gstreamer1-plugins-good%{?_isa}
4ed0085
%if 0%{?fedora} || 0%{?rhel} >= 9
82a04dc
Requires: pipewire%{?_isa}
82a04dc
Requires: pipewire-utils%{?_isa}
82a04dc
Requires: pipewire-pulseaudio%{?_isa}
63d9d78
%else
63d9d78
Requires: pulseaudio%{?_isa}
63d9d78
Requires: pulseaudio-utils%{?_isa}
63d9d78
%endif
dc9c4cf
Requires: cups-filesystem
aa89e44
Requires: shared-mime-info%{?_isa}
aa89e44
Requires: js-jquery
78345db
dd55e4d
# python3-opencv is required for webcam forwarding support, client-side only.
dd55e4d
# Available on Fedora only.
5643520
%{?fedora:Requires: python3-opencv}
dd55e4d
f9732ca
# Needed to create the xpra group
f9732ca
Requires(pre):  shadow-utils
f9732ca
06ee177
# xpra-html5 is now separately provided
Antonio Trande f48d6ac
Obsoletes: xpra-html5 < 0:4.1-1
Antonio Trande f48d6ac
06ee177
Requires: systemd-udev%{?_isa}
06ee177
Obsoletes: xpra-udev < %{version}-%{release}
06ee177
Provides: xpra-udev = %{version}-%{release}
06ee177
78345db
%description
78345db
Xpra is "screen for X": it allows you to run X programs, usually on a remote
78345db
host, direct their display to your local machine, and then to disconnect from
78345db
these programs and reconnect from the same or another machine, without losing
78345db
any state. It gives you remote access to individual applications.
78345db
78345db
Xpra is "rootless" or "seamless": programs you run under it show up on your
78345db
desktop as regular programs, managed by your regular window manager.
78345db
Sessions can be accessed over SSH, or password protected over plain TCP sockets.
78345db
Xpra is usable over reasonably slow links and does its best to adapt to changing
78345db
network bandwidth constraints.
78345db
78345db
%prep
87e1e20
%autosetup -p1 -n %{name}-%{version}
dd55e4d
4f7f857
# cc1: error: unrecognized compiler option ‘-mfpmath=387’
0d36cab
%ifarch %{arm}
0d36cab
sed -i 's|-mfpmath=387|-mfloat-abi=hard|' setup.py
0d36cab
%endif
0d36cab
78345db
%build
15ed227
%set_build_flags
15ed227
%{__python3} setup.py build --executable="%{__python3} -s" \
15ed227
    --with-verbose \
15ed227
    --with-vpx \
15ed227
    %{?_with_enc_x264} \
b49472a
    %{?_with_enc_x265} \
15ed227
    %{?_with_dec_avcodec2} \
15ed227
    %{?_with_csc_swscale} \
15ed227
    %{?_with_debug} \
15ed227
    --with-Xdummy \
15ed227
    --with-Xdummy_wrapper \
5643520
    --without-strict \
7638781
    --without-enc_ffmpeg
78345db
78345db
%install
4f7f857
%py3_install
9840109
06ee177
mkdir -p %{buildroot}%{_unitdir}
06ee177
mv %{buildroot}/lib/systemd/system/xpra.*  %{buildroot}%{_unitdir}/
1196876
78345db
#move icon to proper directory
78345db
mkdir -p %{buildroot}%{_datadir}/icons/hicolor/48x48/apps
073a05e
mkdir -p %{buildroot}%{_datadir}/icons/hicolor/64x64/apps
073a05e
78345db
mv %{buildroot}%{_datadir}/icons/xpra.png \
073a05e
    %{buildroot}%{_datadir}/icons/hicolor/64x64/apps/
073a05e
073a05e
rm -f %{buildroot}%{_datadir}/icons/xpra-mdns.png
Antonio Trande f48d6ac
install -pm 644 fs/share/icons/xpra-mdns.png %{buildroot}%{_datadir}/icons/hicolor/48x48/apps/
073a05e
cdd5630
rm -f %{buildroot}%{_datadir}/icons/xpra-shadow.png
Antonio Trande f48d6ac
install -pm 644 fs/share/icons/xpra-shadow.png %{buildroot}%{_datadir}/icons/hicolor/48x48/apps/
cdd5630
073a05e
#replace old file with horrible WindowsXP old image
5a3f013
rm -rf %{buildroot}%{_datadir}/appdata
271c3d1
mkdir -p %{buildroot}%{_metainfodir}
271c3d1
install -pm 644 %{SOURCE1} %{buildroot}%{_metainfodir}/
78345db
3a4e6c8
#Install nvenc.keys file
3a4e6c8
mkdir -p %{buildroot}%{_sysconfdir}/xpra
Antonio Trande f48d6ac
install -pm 644 fs/etc/xpra/nvenc.keys %{buildroot}%{_sysconfdir}/xpra
3a4e6c8
78345db
#remove doc stuff from /usr/share
06ee177
rm %{buildroot}%{_datadir}/xpra/COPYING
78345db
cc9ebae
#fix shebangs from python3_sitearch
fec68cf
for i in `ack -rl '^#!/.*python' %{buildroot}%{python3_sitearch}/xpra`; do
06ee177
    %py3_shebang_fix $i
073a05e
    chmod 0755 $i
073a05e
done
78345db
78345db
#fix permissions on shared objects
70ec1d0
find %{buildroot}%{python3_sitearch}/xpra -name '*.so' \
78345db
    -exec chmod 0755 {} \;
78345db
78345db
# delete any bundled SWFs - binary content forbidden by packaging
78345db
# guidelines
78345db
find %{buildroot}%{_datadir}/xpra -name '*.swf' -exec rm {} \;
78345db
f9732ca
# Create this directory for sharing sockets
fae89d1
mkdir -p %{buildroot}%{_rundir}/xpra
f9732ca
160512e
# Remove use of /usr/bin/enx on scripts
06ee177
%py3_shebang_fix %{buildroot}%{cupslibdir}/backend/xpraforwarder
06ee177
%py3_shebang_fix %{buildroot}%{_libexecdir}/xpra/auth_dialog
06ee177
%py3_shebang_fix %{buildroot}%{_libexecdir}/xpra/xdg-open
faf3329
d59997c
for i in `find %{buildroot}%{_bindir} -perm /644 -type f \( -name "*" \)`; do
d59997c
    chmod 0755 $i
d59997c
done
d59997c
Antonio Trande f48d6ac
# Remove Build documentation
Antonio Trande f48d6ac
rm -rf %{buildroot}%{_docdir}/xpra/Build
Antonio Trande f48d6ac
Antonio Trande f48d6ac
install -pm 644 README.md %{buildroot}%{_docdir}/xpra/
Antonio Trande f48d6ac
78345db
%check
a1b3e58
%{?fedora:appstream-util validate-relax --nonet %{buildroot}%{_metainfodir}/xpra.appdata.xml}
3f6fb19
desktop-file-validate %{buildroot}%{_datadir}/applications/*.desktop
78345db
f9732ca
%pre
f9732ca
getent group xpra >/dev/null || groupadd -r xpra
f9732ca
78345db
%files
073a05e
%license COPYING
78345db
%dir %{_sysconfdir}/xpra
bee0762
%dir %{_sysconfdir}/xpra/conf.d
bee0762
%config(noreplace) %{_sysconfdir}/xpra/*.conf
bee0762
%config(noreplace) %{_sysconfdir}/xpra/nvenc.keys
bee0762
%config(noreplace) %{_sysconfdir}/xpra/conf.d/*.conf
aa89e44
%config(noreplace) %{_sysconfdir}/X11/xorg.conf.d/90-xpra-virtual.conf
aa89e44
%config(noreplace) %{_sysconfdir}/dbus-1/system.d/xpra.conf
bee0762
%config(noreplace) %{_sysconfdir}/sysconfig/xpra
823f8d0
%config(noreplace) %{_sysconfdir}/pam.d/xpra
Antonio Trande f48d6ac
%config(noreplace) %{_sysconfdir}/xpra/content-categories/10_default.conf
5643520
%config(noreplace) %{_sysconfdir}/xpra/content-parent/10_default.conf
Antonio Trande f48d6ac
%config(noreplace) %{_sysconfdir}/xpra/content-type/10_role.conf
Antonio Trande f48d6ac
%config(noreplace) %{_sysconfdir}/xpra/content-type/30_title.conf
Antonio Trande f48d6ac
%config(noreplace) %{_sysconfdir}/xpra/content-type/50_class.conf
Antonio Trande f48d6ac
%config(noreplace) %{_sysconfdir}/xpra/content-type/70_commands.conf
Antonio Trande f48d6ac
%config(noreplace) %{_sysconfdir}/xpra/http-headers/00_nocache.txt
Antonio Trande f48d6ac
%config(noreplace) %{_sysconfdir}/xpra/http-headers/10_content_security_policy.txt
160512e
%{_libexecdir}/xpra/
78345db
%{_bindir}/xpra
5643520
%{_bindir}/xpra_launcher
Antonio Trande f48d6ac
%{_bindir}/run_scaled
3fa0249
%{_sysusersdir}/*.conf
fec68cf
%{python3_sitearch}/xpra/
fec68cf
%{python3_sitearch}/*.egg-info
78345db
%{_datadir}/applications/xpra*.desktop
073a05e
%{_datadir}/icons/hicolor/48x48/apps/xpra-mdns.png
cdd5630
%{_datadir}/icons/hicolor/48x48/apps/xpra-shadow.png
073a05e
%{_datadir}/icons/hicolor/64x64/apps/xpra.png
78345db
%{_mandir}/man1/xpra.1.*
3f6fb19
%{_mandir}/man1/xpra_*.1.*
Antonio Trande f48d6ac
%{_mandir}/man1/run_scaled.1.*
271c3d1
%{_metainfodir}/xpra.appdata.xml
9ac5dd0
%{_datadir}/mime/packages/application-x-xpraconfig.xml
073a05e
%{_datadir}/xpra/
ff57c84
%{cupslibdir}/backend/xpraforwarder
102e6fd
%{_tmpfilesdir}/xpra.conf
fae89d1
%dir %{_rundir}/xpra
06ee177
%{_docdir}/xpra
06ee177
%{_unitdir}/xpra.service
06ee177
%{_unitdir}/xpra.socket
aa89e44
%{_udevrulesdir}/71-xpra-virtual-pointer.rules
78345db
78345db
%changelog
19677b8
%autochangelog