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