From: Jacek Konieczny Date: Fri, 10 Nov 2017 08:33:57 +0000 (+0100) Subject: Fix tests when running out of X11 session X-Git-Tag: auto/th/python-tdbus-0.10-1 X-Git-Url: http://git.pld-linux.org/gitweb.cgi?a=commitdiff_plain;h=f9a3da589d12a691e0c81826f93f3ef05bb0156e;p=packages%2Fpython-tdbus.git Fix tests when running out of X11 session Run local dbus-daemon instead of using user session. --- diff --git a/python-tdbus.spec b/python-tdbus.spec index 7837c36..4077631 100644 --- a/python-tdbus.spec +++ b/python-tdbus.spec @@ -27,6 +27,9 @@ BuildRequires: python3-devel BuildRequires: python3-gevent BuildRequires: python3-setuptools %endif +%if %{with tests} +BuildRequires: /usr/bin/dbus-launch +%endif BuildRoot: %{tmpdir}/%{name}-%{version}-root-%(id -u -n) %description @@ -87,6 +90,14 @@ Dokumentacja API %{module}. %patch0 -p1 %build +unset DISPLAY +unset DBUS_SESSION_BUS_ADDRESS +unset XDG_RUNTIME_DIR + +%if %{with tests} +eval $(dbus-launch --sh-syntax) +%endif + %if %{with python2} %py_build %{?with_tests:test} %endif