diff --git a/utils/dbus/Config.in b/utils/dbus/Config.in new file mode 100644 index 000000000..86ceed5f6 --- /dev/null +++ b/utils/dbus/Config.in @@ -0,0 +1,7 @@ +if PACKAGE_dbus + +config DBUS_VERBOSE + bool "Enable verbose error strings" + default n + +endif diff --git a/utils/dbus/Makefile b/utils/dbus/Makefile index da8a7bef3..263e8c53f 100644 --- a/utils/dbus/Makefile +++ b/utils/dbus/Makefile @@ -19,6 +19,9 @@ PKG_MAINTAINER:= PKG_LICENSE:=AFL-2.1 PKG_CPE_ID:=cpe:/a:freedesktop:dbus +PKG_CONFIG_DEPENDS:= \ + CONFIG_DBUS_VERBOSE + include $(INCLUDE_DIR)/package.mk include $(INCLUDE_DIR)/cmake.mk @@ -71,10 +74,13 @@ $(call Package/dbus/Default/description) This package contains D-Bus utilities. endef +define Package/dbus/config + source "$(SOURCE)/Config.in" +endef + CMAKE_OPTIONS += \ -DDBUS_SYSTEM_SOCKET=/var/run/dbus/system_bus_socket \ -DDBUS_SESSION_SOCKET_DIR=/tmp \ - -DDBUS_SYSTEM_PID_FILE=/var/run/dbus.pid \ -DDBUS_BUILD_TESTS=OFF \ -DDBUS_LINUX=ON \ -DDBUS_DISABLE_ASSERT=ON \ @@ -88,7 +94,12 @@ CMAKE_OPTIONS += \ -DDBUS_DISABLE_CHECKS=ON \ -DDBUS_BUILD_X11=OFF \ -DDBUS_ENABLE_DOXYGEN_DOCS=OFF \ - -DENABLE_QT_HELP=OFF + -DDBUS_ENABLE_QTHELP_DOCS=OFF \ + -DDBUS_ENABLE_XML_DOCS=OFF + +ifeq ($(CONFIG_DBUS_VERBOSE),y) + CMAKE_OPTIONS += -DDBUS_ENABLE_VERBOSE_MODE=ON +endif define Build/InstallDev $(INSTALL_DIR) $(1)/usr/include @@ -128,7 +139,9 @@ endef define Package/dbus-utils/install $(INSTALL_DIR) $(1)/usr/bin - $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/bin/dbus-{monitor,send,update-activation-environment} $(1)/usr/bin/ + $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/bin/dbus-monitor $(1)/usr/bin/ + $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/bin/dbus-send $(1)/usr/bin/ + $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/bin/dbus-test-tool $(1)/usr/bin/ endef $(eval $(call BuildPackage,libdbus)) diff --git a/utils/dbus/files/dbus.init b/utils/dbus/files/dbus.init index afb70547c..949a38d16 100644 --- a/utils/dbus/files/dbus.init +++ b/utils/dbus/files/dbus.init @@ -3,15 +3,30 @@ START=60 -SERVICE_PID_FILE=/var/run/dbus.pid +USE_PROCD=1 +PROG=/usr/bin/dbus-daemon -start() { +# To enable this makes only sense if the dbus has been compiled with +# the option CONFIG_DBUS_VERBOSE=y + +#DEBUG=1 + +start_service() { mkdir -m 0755 -p /var/lib/dbus mkdir -m 0755 -p /var/run/dbus + [ -x /usr/bin/dbus-uuidgen ] && /usr/bin/dbus-uuidgen --ensure - service_start /usr/bin/dbus-daemon --system + + procd_open_instance + procd_set_param command "${PROG}" + procd_append_param command --system + procd_append_param command --nofork + [ -n "$DEBUG" ] && procd_set_param env DBUS_VERBOSE=1 + procd_set_param stdout 1 + procd_set_param stderr 1 + procd_close_instance } -stop() { - service_stop /usr/bin/dbus-daemon +stop_service() { + service_stop "${PROG}" } diff --git a/utils/dbus/patches/020-cmake-fix-tmp-session-search.patch b/utils/dbus/patches/020-cmake-fix-tmp-session-search.patch new file mode 100644 index 000000000..2847b628e --- /dev/null +++ b/utils/dbus/patches/020-cmake-fix-tmp-session-search.patch @@ -0,0 +1,27 @@ +--- a/CMakeLists.txt ++++ b/CMakeLists.txt +@@ -471,14 +471,16 @@ endif() + + #### Find socket directories + if(UNIX) +- if(NOT $ENV{TMPDIR} STREQUAL "") +- set(DBUS_SESSION_SOCKET_DIR $ENV{TMPDIR}) +- elseif(NOT $ENV{TEMP} STREQUAL "") +- set(DBUS_SESSION_SOCKET_DIR $ENV{TEMP}) +- elseif(NOT $ENV{TMP} STREQUAL "") +- set(DBUS_SESSION_SOCKET_DIR $ENV{TMP}) +- else() +- set(DBUS_SESSION_SOCKET_DIR /tmp) ++ if(NOT DEFINED DBUS_SESSION_SOCKET_DIR) ++ if(NOT $ENV{TMPDIR} STREQUAL "") ++ set(DBUS_SESSION_SOCKET_DIR $ENV{TMPDIR}) ++ elseif(NOT $ENV{TEMP} STREQUAL "") ++ set(DBUS_SESSION_SOCKET_DIR $ENV{TEMP}) ++ elseif(NOT $ENV{TMP} STREQUAL "") ++ set(DBUS_SESSION_SOCKET_DIR $ENV{TMP}) ++ else() ++ set(DBUS_SESSION_SOCKET_DIR /tmp) ++ endif() + endif() + endif() +