xref: /OK3568_Linux_fs/buildroot/package/dbus/dbus.mk (revision 4882a59341e53eb6f0b4789bf948001014eff981)
1################################################################################
2#
3# dbus
4#
5################################################################################
6
7DBUS_VERSION = 1.12.20
8DBUS_SITE = https://dbus.freedesktop.org/releases/dbus
9DBUS_LICENSE = AFL-2.1 or GPL-2.0+ (library, tools), GPL-2.0+ (tools)
10DBUS_LICENSE_FILES = COPYING
11DBUS_CPE_ID_VENDOR = d-bus_project
12DBUS_CPE_ID_PRODUCT = d-bus
13DBUS_INSTALL_STAGING = YES
14
15define DBUS_PERMISSIONS
16	/usr/libexec/dbus-daemon-launch-helper f 4750 0 dbus - - - - -
17endef
18
19define DBUS_USERS
20	dbus -1 dbus -1 * /run/dbus - dbus DBus messagebus user
21endef
22
23DBUS_DEPENDENCIES = host-pkgconf expat
24
25DBUS_SELINUX_MODULES = dbus
26
27DBUS_CONF_OPTS = \
28	--with-dbus-user=dbus \
29	--disable-tests \
30	--disable-asserts \
31	--disable-xml-docs \
32	--disable-doxygen-docs \
33	--with-system-socket=/run/dbus/system_bus_socket \
34	--with-system-pid-file=/run/messagebus.pid
35
36ifeq ($(BR2_STATIC_LIBS),y)
37DBUS_CONF_OPTS += LIBS='-pthread'
38endif
39
40ifeq ($(BR2_microblaze),y)
41# microblaze toolchain doesn't provide inotify_rm_* but does have sys/inotify.h
42DBUS_CONF_OPTS += --disable-inotify
43endif
44
45ifeq ($(BR2_PACKAGE_LIBSELINUX),y)
46DBUS_CONF_OPTS += --enable-selinux
47DBUS_DEPENDENCIES += libselinux
48else
49DBUS_CONF_OPTS += --disable-selinux
50endif
51
52ifeq ($(BR2_PACKAGE_AUDIT)$(BR2_PACKAGE_LIBCAP_NG),yy)
53DBUS_CONF_OPTS += --enable-libaudit
54DBUS_DEPENDENCIES += audit libcap-ng
55else
56DBUS_CONF_OPTS += --disable-libaudit
57endif
58
59ifeq ($(BR2_PACKAGE_XLIB_LIBX11),y)
60DBUS_CONF_OPTS += --with-x
61DBUS_DEPENDENCIES += xlib_libX11
62ifeq ($(BR2_PACKAGE_XLIB_LIBSM),y)
63DBUS_DEPENDENCIES += xlib_libSM
64endif
65else
66DBUS_CONF_OPTS += --without-x
67endif
68
69ifeq ($(BR2_INIT_SYSTEMD),y)
70DBUS_CONF_OPTS += \
71	--enable-systemd \
72	--with-systemdsystemunitdir=/usr/lib/systemd/system
73DBUS_DEPENDENCIES += systemd
74else
75DBUS_CONF_OPTS += --disable-systemd
76endif
77
78# fix rebuild (dbus makefile errors out if /var/lib/dbus is a symlink)
79define DBUS_REMOVE_VAR_LIB_DBUS
80	rm -rf $(TARGET_DIR)/var/lib/dbus
81endef
82
83DBUS_PRE_INSTALL_TARGET_HOOKS += DBUS_REMOVE_VAR_LIB_DBUS
84
85define DBUS_REMOVE_DEVFILES
86	rm -rf $(TARGET_DIR)/usr/lib/dbus-1.0
87endef
88
89DBUS_POST_INSTALL_TARGET_HOOKS += DBUS_REMOVE_DEVFILES
90
91define DBUS_INSTALL_INIT_SYSV
92	$(INSTALL) -m 0755 -D package/dbus/S30dbus \
93		$(TARGET_DIR)/etc/init.d/S30dbus
94
95	mkdir -p $(TARGET_DIR)/var/lib
96	rm -rf $(TARGET_DIR)/var/lib/dbus
97	ln -sf /tmp/dbus $(TARGET_DIR)/var/lib/dbus
98endef
99
100define DBUS_INSTALL_INIT_SYSTEMD
101	mkdir -p $(TARGET_DIR)/var/lib/dbus
102	ln -sf /etc/machine-id $(TARGET_DIR)/var/lib/dbus/machine-id
103endef
104
105HOST_DBUS_DEPENDENCIES = host-pkgconf host-expat
106HOST_DBUS_CONF_OPTS = \
107	--with-dbus-user=dbus \
108	--disable-tests \
109	--disable-asserts \
110	--disable-selinux \
111	--disable-xml-docs \
112	--disable-doxygen-docs \
113	--disable-systemd \
114	--without-x
115
116# dbus for the host
117DBUS_HOST_INTROSPECT = $(HOST_DBUS_DIR)/introspect.xml
118
119HOST_DBUS_GEN_INTROSPECT = \
120	$(HOST_DIR)/bin/dbus-daemon --introspect > $(DBUS_HOST_INTROSPECT)
121
122HOST_DBUS_POST_INSTALL_HOOKS += HOST_DBUS_GEN_INTROSPECT
123
124$(eval $(autotools-package))
125$(eval $(host-autotools-package))
126