%global nautilus_python_dir %{_datadir}/nautilus-python %global nautilus_extension_dir %{nautilus_python_dir}/extensions Name: winswitch Summary: Utility for controlling remote desktop sessions URL: http://winswitch.org/ Version: 0.12.21 Release: 17%{?dist} License: GPLv3 Source0: https://winswitch.org/src/%{name}-%{version}.src.tar.xz Source1: winswitch.appdata.xml BuildArch: noarch Requires: pygtk2 Requires: python-crypto Requires: python-twisted Requires: python-pam Requires: python-imaging Requires: python-xlib Requires: python-pyasn1 Requires: python-utmp Requires: python-netifaces Requires: dbus-python Requires: dbus-x11 Requires: gnome-python2 Requires: gnome-python2-rsvg Requires: openssh-clients Requires: avahi Requires: avahi-ui-tools Requires: gstreamer Requires: gnome-menus # Weak deps for the different protocol support Recommends: xpra Suggests: nxproxy Suggests: nxagent Suggests: rdesktop Suggests: freerdp Suggests: tigervnc Suggests: tigervnc-server >= 1.0.90 # Other optional extras Suggests: devilspie2 Suggests: xloadimage Suggests: java-vash Suggests: nautilus-python # Used for the import command when dealing with screenshots Suggests: ImageMagick BuildRequires: python2-devel BuildRequires: python-setuptools BuildRequires: desktop-file-utils BuildRequires: libappstream-glib # Pull this in for the definition of %%{_javadir} BuildRequires: javapackages-tools %description Application to start and control remote GUI sessions via xpra, NX, VNC, RDP or plain ssh X11 forwarding. Winswitch can start, suspend, resume and send supported sessions to other clients. %prep %setup -q # Remove shebangs from py files find winswitch -name \*.py -exec sed -i -e '1{\@^#!/usr/bin/env python@d}' '{}' \; # Patch vash_util.py to use system vash sed -i -e 's|VASH_JAR = os.path.join(SHARE_DIR, "Vash", "Vash.jar")|VASH_JAR = os.path.join("%{_javadir}", "Vash.jar")|g' winswitch/util/vash_util.py # Use devilspie2 rather than devilspie sed -i -e 's|DEVILSPIE_COMMAND = which("devilspie")|DEVILSPIE_COMMAND = which("devilspie2")|g' winswitch/util/commands_util.py # Remove bundled pybonjour, and all bonjour related files - this is only used on OSX rm -f winswitch/net/*bonjour* # Remove bundled python pam module and use system wide one rm -f winswitch/util/pam.py* sed -i -e 's/from winswitch.util import pam/import pam/g' winswitch/util/password_checker.py # Remove hashbang from type of firewall config file sed -i -e '/^#!\//, 1d' skel/etc/winswitch/firewall # Replace /usr/bin/env python from files with %{__python2} for f in $(find skel/libexec/winswitch -type f -print); do sed -i "1 s|^#!/usr/bin/env python\b|#!%{__python2}|" $f done # Disable firewall control by default sed -i -e 's/FIREWALL_ENABLED=1/FIREWALL_ENABLED=0/g' skel/etc/winswitch/firewall %build %{__python2} setup.py build %install %{__python2} setup.py install -O1 --prefix /usr --skip-build --root %{buildroot} # Move the nautilus python extension to the correct location and fix perms # https://projects-old.gnome.org/nautilus-python/documentation/html/nautilus-python-overview.html mkdir -p %{buildroot}%{nautilus_extension_dir} for file in %{buildroot}%{_prefix}/lib/nautilus/extensions-2.0/python/* ; do install -p -m 0644 ${file} %{buildroot}%{nautilus_extension_dir} done rm -rf %{buildroot}%{_prefix}/lib/nautilus # Check desktop file desktop-file-validate %{buildroot}/%{_datadir}/applications/winswitch.desktop # Remove bundled vash rm -rf %{buildroot}%{_datadir}/Vash # Install and check appdata file mkdir -p %{buildroot}%{_datadir}/appdata/ cp -a %{SOURCE1} %{buildroot}%{_datadir}/appdata/ appstream-util validate-relax --nonet %{buildroot}%{_datadir}/appdata/winswitch.appdata.xml # Fix perms on /etc/winswitch/firewall chmod 0644 %{buildroot}%{_sysconfdir}/winswitch/firewall %post /bin/touch --no-create %{_datadir}/icons/hicolor &>/dev/null || : /usr/bin/update-desktop-database &> /dev/null || : /bin/touch --no-create %{_datadir}/mime/packages &>/dev/null || : %postun if [ $1 -eq 0 ] ; then /bin/touch --no-create %{_datadir}/icons/hicolor &>/dev/null /usr/bin/gtk-update-icon-cache %{_datadir}/icons/hicolor &>/dev/null || : fi /usr/bin/update-desktop-database &> /dev/null || : if [ $1 -eq 0 ] ; then /usr/bin/update-mime-database %{_datadir}/mime &> /dev/null || : fi %posttrans /usr/bin/gtk-update-icon-cache %{_datadir}/icons/hicolor &>/dev/null || : /usr/bin/update-mime-database %{?fedora:-n} %{_datadir}/mime &> /dev/null || : %files %license COPYING %{python2_sitelib}/winswitch %{python2_sitelib}/winswitch*.egg-info %{_bindir}/winswitch_* %{_bindir}/wcw %{_libexecdir}/winswitch %dir %{_sysconfdir}/winswitch %config(noreplace) %{_sysconfdir}/winswitch/server_defaults.conf %config(noreplace) %{_sysconfdir}/winswitch/ports.conf %config(noreplace) %{_sysconfdir}/winswitch/firewall %{_datadir}/winswitch %{_datadir}/Thunar %{_datadir}/applications/winswitch.desktop %{_datadir}/icons/hicolor/48x48/apps/* %{_datadir}/icons/hicolor/64x64/apps/* %{_datadir}/icons/winswitch* %{_datadir}/appdata/winswitch.appdata.xml %{_mandir}/man1/* %{_datadir}/mime/packages/winswitch.xml %{nautilus_python_dir} %{nautilus_extension_dir} %changelog * Fri Aug 14 2015 Jonathan Underwood - 0.12.21-17 - Own /usr/share/nautilus-python * Thu Aug 13 2015 Jonathan Underwood - 0.12.21-16 - Disable firewall control by default * Thu Aug 13 2015 Jonathan Underwood - 0.12.21-15 - Replace /usr/bin/env python from files with %%{__python2} * Thu Aug 13 2015 Jonathan Underwood - 0.12.21-14 - Remove shebang from top of /etc/winswitch/firewall file and fix perms to not include executable bit * Thu Aug 13 2015 Jonathan Underwood - 0.12.21-13 - Add appdata file - Remove all bonjour related files (only used on OSX) - Remove bundled python pam module and use system wide version * Wed Aug 12 2015 Jonathan Underwood - 0.12.21-12 - Change Suggests xfreerdp to freerdp * Wed Aug 12 2015 Jonathan Underwood - 0.12.21-11 - Change xpra to be a Recommends dep * Wed Aug 12 2015 Jonathan Underwood - 0.12.21-10 - Move Requires for ImageMagick to Suggests - Move Requires for java-vash to Suggests - Move Requires for nautilus-python to Suggests - Own nautilus extension directory rather than just the files under it * Wed Aug 12 2015 Jonathan Underwood - 0.12.21-9 - Move Requires for devilspie to a Suggests for devilspie2 and patch source accordingly - Move xloads image Requires to Suggests * Wed Aug 12 2015 Jonathan Underwood - 0.12.21-8 - Add Requires for python-netifaces * Wed Aug 12 2015 Jonathan Underwood - 0.12.21-7 - Move protocol dependencies to Suggests instead of Requires * Tue Aug 11 2015 Jonathan Underwood - 0.12.21-6 - Use %%{_mandir} macro in file list * Tue Aug 4 2015 Jonathan Underwood - 0.12.21-5 - Use system Vash.jar * Tue Aug 4 2015 Jonathan Underwood - 0.12.21-4 - Add Requires for nxagent * Tue Aug 4 2015 Jonathan Underwood - 0.12.21-3 - Remove Requires for nx-libs - Add Requires for nxproxy - Mark config files as %%config(noreplace) - Remove executable bit from the nautilus plugin script * Wed Jul 15 2015 Jonathan Underwood - 0.12.21-2 - Untabify spec file * Wed Jul 15 2015 Jonathan Underwood - 0.12.21-1 - Initial package