commit 14003935f1f57b7cc3d389ed82c52b66f05be22b
parent a689d930f104100db6b2f8c5434449ce4867b932
Author: Steven Barth <steven@midlink.org>
Date: Fri, 18 Jul 2014 11:03:55 +0200
dbus: adopt here
Signed-off-by: Steven Barth <steven@midlink.org>
Diffstat:
3 files changed, 217 insertions(+), 0 deletions(-)
diff --git a/utils/dbus/Makefile b/utils/dbus/Makefile
@@ -0,0 +1,188 @@
+#
+# Copyright (C) 2007-2011 OpenWrt.org
+#
+# This is free software, licensed under the GNU General Public License v2.
+# See /LICENSE for more information.
+#
+
+include $(TOPDIR)/rules.mk
+
+# Make sure to also update the dbus-x package
+PKG_NAME:=dbus
+PKG_VERSION:=1.8.6
+PKG_RELEASE:=1
+
+PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz
+PKG_SOURCE_URL:=http://dbus.freedesktop.org/releases/dbus/
+PKG_MD5SUM:=6a08ba555d340e9dfe2d623b83c0eea8
+PKG_MAINTAINER:=Steven Barth <cyrus@openwrt.org>
+
+PKG_FIXUP:=autoreconf
+PKG_INSTALL:=1
+
+include $(INCLUDE_DIR)/package.mk
+
+TARGET_LDFLAGS+= \
+ -Wl,-rpath-link=$(STAGING_DIR)/usr/lib \
+ -Wl,-rpath=/usr/lib/
+
+define Package/dbus/Default
+ SECTION:=utils
+ CATEGORY:=Utilities
+ TITLE:=Simple interprocess messaging system
+ URL:=http://dbus.freedesktop.org/
+endef
+
+define Package/dbus/Default/description
+ D-Bus is a message bus system, a simple way for applications to talk to one
+ another. In addition to interprocess communication, D-Bus helps coordinate
+ process lifecycle; it makes it simple and reliable to code a "single instance"
+ application or daemon, and to launch applications and daemons on demand when
+ their services are needed.
+endef
+
+define Package/libdbus
+$(call Package/dbus/Default)
+ CATEGORY:=Libraries
+ TITLE+= (library)
+ DEPENDS:= +librt
+endef
+
+define Package/libdbus/Description
+$(call Package/dbus/Default/description)
+ This package contains the D-Bus shared library.
+endef
+
+define Package/dbus
+$(call Package/dbus/Default)
+ TITLE+= (daemon)
+ DEPENDS:= +libexpat +libdbus
+endef
+
+define Package/dbus/Description
+$(call Package/dbus/Default/description)
+ This package contains the D-Bus daemon.
+endef
+
+define Package/dbus-utils
+$(call Package/dbus/Default)
+ TITLE+= (utilities)
+ DEPENDS:= dbus
+endef
+
+define Package/dbus-utils/Description
+$(call Package/dbus/Default/description)
+ This package contains D-Bus utilities.
+endef
+
+
+define Build/Prepare
+ $(Build/Prepare/Default)
+ $(SED) 's/-Wl,--gc-sections/--gc-sections/' $(PKG_BUILD_DIR)/configure
+endef
+
+CONFIGURE_ARGS += \
+ --enable-shared \
+ --enable-static \
+ --disable-abstract-sockets \
+ --disable-ansi \
+ --disable-asserts \
+ --disable-console-owner-file \
+ --disable-doxygen-docs \
+ --disable-compiler_coverage \
+ --disable-selinux \
+ --disable-tests \
+ --disable-verbose-mode \
+ --disable-xml-docs \
+ --with-xml="expat" \
+ --with-dbus-user=root \
+ --with-dbus-daemondir="/usr/sbin" \
+ --with-system-socket="/var/run/dbus/system_bus_socket" \
+ --with-system-pid-file="/var/run/dbus.pid" \
+ --without-x \
+ --libexecdir=/usr/lib/dbus-1
+
+CONFIGURE_VARS+= \
+ ac_cv_have_abstract_sockets="yes" \
+ ac_cv_lib_expat_XML_ParserCreate_MM="yes" \
+
+
+define Build/InstallDev
+ $(INSTALL_DIR) $(1)/usr/include
+ $(CP) \
+ $(PKG_INSTALL_DIR)/usr/include/dbus-1.0 \
+ $(1)/usr/include/
+ $(INSTALL_DIR) $(1)/usr/lib/dbus-1.0/include/dbus/
+ $(INSTALL_DATA) \
+ $(PKG_INSTALL_DIR)/usr/lib/dbus-1.0/include/dbus/*.h \
+ $(1)/usr/lib/dbus-1.0/include/dbus/
+
+ $(INSTALL_DIR) $(1)/usr/lib
+ $(INSTALL_DATA) \
+ $(PKG_INSTALL_DIR)/usr/lib/libdbus-1.{so*,la,a} \
+ $(1)/usr/lib/
+ $(CP) \
+ $(PKG_INSTALL_DIR)/usr/lib/dbus-1.0 \
+ $(1)/usr/lib/
+ $(INSTALL_DIR) $(1)/usr/lib/pkgconfig
+ $(INSTALL_DATA) \
+ $(PKG_INSTALL_DIR)/usr/lib/pkgconfig/dbus-1.pc \
+ $(1)/usr/lib/pkgconfig/
+endef
+
+define Package/dbus/conffiles
+/etc/dbus-1/session.conf
+/etc/dbus-1/system.conf
+endef
+
+define Package/libdbus/install
+ $(INSTALL_DIR) $(1)/usr/lib
+ $(CP) \
+ $(PKG_INSTALL_DIR)/usr/lib/libdbus-1.so.* \
+ $(1)/usr/lib/
+endef
+
+define Package/dbus/install
+ $(INSTALL_DIR) $(1)/etc
+ $(CP) \
+ $(PKG_INSTALL_DIR)/etc/dbus-1 \
+ $(1)/etc/
+
+ $(INSTALL_DIR) $(1)/usr/lib/dbus-1
+ $(INSTALL_BIN) \
+ $(PKG_INSTALL_DIR)/usr/lib/dbus-1/dbus-daemon-launch-helper \
+ $(1)/usr/lib/dbus-1/
+
+ $(INSTALL_DIR) $(1)/usr/sbin
+ $(INSTALL_BIN) \
+ $(PKG_INSTALL_DIR)/usr/sbin/dbus-daemon \
+ $(1)/usr/sbin/
+
+ $(INSTALL_DIR) $(1)/usr/bin
+ $(INSTALL_BIN) \
+ $(PKG_INSTALL_DIR)/usr/bin/dbus-uuidgen \
+ $(1)/usr/bin/
+
+ $(INSTALL_BIN) \
+ $(PKG_INSTALL_DIR)/usr/bin/dbus-launch \
+ $(1)/usr/bin/dbus-launch.real
+ $(INSTALL_BIN) \
+ ./files/dbus-launch \
+ $(1)/usr/bin/
+
+ $(INSTALL_DIR) $(1)/etc/init.d
+ $(INSTALL_BIN) \
+ ./files/dbus.init \
+ $(1)/etc/init.d/dbus
+endef
+
+define Package/dbus-utils/install
+ $(INSTALL_DIR) $(1)/usr/bin
+ $(INSTALL_BIN) \
+ $(PKG_INSTALL_DIR)/usr/bin/dbus-{send,monitor,cleanup-sockets} \
+ $(1)/usr/bin/
+endef
+
+$(eval $(call BuildPackage,libdbus))
+$(eval $(call BuildPackage,dbus))
+$(eval $(call BuildPackage,dbus-utils))
diff --git a/utils/dbus/files/dbus-launch b/utils/dbus/files/dbus-launch
@@ -0,0 +1,12 @@
+#!/bin/sh
+#
+# Simple wrapper script which allows us to build dbus without general x support
+# If an application needs x support in dbus-launch it has to depend on the
+# dbus-launch-x package. The script is used to prefer dbus-launch with x over
+# the dbus-lauch without x.
+
+if [ -f /usr/bin/dbus-launch-x ]; then
+ exec /usr/bin/dbus-launch-x $@
+else
+ exec /usr/bin/dbus-launch.real $@
+fi
diff --git a/utils/dbus/files/dbus.init b/utils/dbus/files/dbus.init
@@ -0,0 +1,17 @@
+#!/bin/sh /etc/rc.common
+# Copyright (C) 2007-2011 OpenWrt.org
+
+START=60
+
+SERVICE_PID_FILE=/var/run/dbus.pid
+
+start() {
+ 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/sbin/dbus-daemon --system
+}
+
+stop() {
+ service_stop /usr/sbin/dbus-daemon && rm $SERVICE_PID_FILE
+}