blob: cf6f7dc0ef8b5e16060cac136636e399d707dbf6 [file] [log] [blame]
Brad Bishop19323692019-04-05 15:28:33 -04001SUMMARY = "D-Bus message bus"
2DESCRIPTION = "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."
Andrew Geissler82c905d2020-04-13 13:39:40 -05003HOMEPAGE = "https://dbus.freedesktop.org"
Brad Bishop19323692019-04-05 15:28:33 -04004SECTION = "base"
Andrew Geisslerd25ed322020-06-27 00:28:28 -05005
6require dbus.inc
7
Brad Bishop19323692019-04-05 15:28:33 -04008DEPENDS = "expat virtual/libintl autoconf-archive"
9RDEPENDS_dbus_class-native = ""
10RDEPENDS_dbus_class-nativesdk = ""
11PACKAGES += "${@bb.utils.contains('DISTRO_FEATURES', 'ptest', '${PN}-ptest', '', d)}"
12ALLOW_EMPTY_dbus-ptest = "1"
13RDEPENDS_dbus-ptest_class-target = "dbus-test-ptest"
14
Andrew Geisslerd25ed322020-06-27 00:28:28 -050015inherit useradd update-rc.d
Brad Bishop19323692019-04-05 15:28:33 -040016
17INITSCRIPT_NAME = "dbus-1"
18INITSCRIPT_PARAMS = "start 02 5 3 2 . stop 20 0 1 6 ."
19
20python __anonymous() {
21 if not bb.utils.contains('DISTRO_FEATURES', 'sysvinit', True, False, d):
22 d.setVar("INHIBIT_UPDATERCD_BBCLASS", "1")
23}
24
25USERADD_PACKAGES = "${PN}"
Brad Bishop19323692019-04-05 15:28:33 -040026USERADD_PARAM_${PN} = "--system --home ${localstatedir}/lib/dbus \
27 --no-create-home --shell /bin/false \
28 --user-group messagebus"
29
30CONFFILES_${PN} = "${sysconfdir}/dbus-1/system.conf ${sysconfdir}/dbus-1/session.conf"
31
32DEBIANNAME_${PN} = "dbus-1"
33
34PACKAGES =+ "${PN}-lib"
35
36OLDPKGNAME = "dbus-x11"
37OLDPKGNAME_class-nativesdk = ""
38
39# for compatibility
40RPROVIDES_${PN} = "${OLDPKGNAME}"
41RREPLACES_${PN} += "${OLDPKGNAME}"
42
43FILES_${PN} = "${bindir}/dbus-daemon* \
44 ${bindir}/dbus-uuidgen \
45 ${bindir}/dbus-cleanup-sockets \
46 ${bindir}/dbus-send \
47 ${bindir}/dbus-monitor \
48 ${bindir}/dbus-launch \
49 ${bindir}/dbus-run-session \
50 ${bindir}/dbus-update-activation-environment \
51 ${libexecdir}/dbus* \
52 ${sysconfdir} \
53 ${localstatedir} \
54 ${datadir}/dbus-1/services \
55 ${datadir}/dbus-1/system-services \
56 ${datadir}/dbus-1/session.d \
57 ${datadir}/dbus-1/session.conf \
58 ${datadir}/dbus-1/system.d \
59 ${datadir}/dbus-1/system.conf \
60 ${datadir}/xml/dbus-1 \
61 ${systemd_system_unitdir} \
62 ${systemd_user_unitdir} \
63 ${nonarch_libdir}/sysusers.d/dbus.conf \
64 ${nonarch_libdir}/tmpfiles.d/dbus.conf \
65"
66FILES_${PN}-lib = "${libdir}/lib*.so.*"
67RRECOMMENDS_${PN}-lib = "${PN}"
68FILES_${PN}-dev += "${libdir}/dbus-1.0/include ${libdir}/cmake/DBus1 ${bindir}/dbus-test-tool"
69
70PACKAGE_WRITE_DEPS += "${@bb.utils.contains('DISTRO_FEATURES','systemd sysvinit','systemd-systemctl-native','',d)}"
71pkg_postinst_dbus() {
72 # If both systemd and sysvinit are enabled, mask the dbus-1 init script
73 if ${@bb.utils.contains('DISTRO_FEATURES','systemd sysvinit','true','false',d)}; then
74 if [ -n "$D" ]; then
75 OPTS="--root=$D"
76 fi
77 systemctl $OPTS mask dbus-1.service
78 fi
79
80 if [ -z "$D" ] && [ -e /etc/init.d/populate-volatile.sh ] ; then
81 /etc/init.d/populate-volatile.sh update
82 fi
83}
84
Brad Bishopf3f93bb2019-10-16 14:33:32 -040085
Andrew Geisslerd25ed322020-06-27 00:28:28 -050086EXTRA_OECONF += "--disable-tests"
Brad Bishop19323692019-04-05 15:28:33 -040087
88do_install() {
89 autotools_do_install
90
91 if ${@bb.utils.contains('DISTRO_FEATURES', 'sysvinit', 'true', 'false', d)}; then
92 install -d ${D}${sysconfdir}/init.d
93 sed 's:@bindir@:${bindir}:' < ${WORKDIR}/dbus-1.init >${WORKDIR}/dbus-1.init.sh
94 install -m 0755 ${WORKDIR}/dbus-1.init.sh ${D}${sysconfdir}/init.d/dbus-1
95 install -d ${D}${sysconfdir}/default/volatiles
96 echo "d messagebus messagebus 0755 ${localstatedir}/run/dbus none" \
97 > ${D}${sysconfdir}/default/volatiles/99_dbus
98 fi
99
100 if ${@bb.utils.contains('DISTRO_FEATURES', 'systemd', 'true', 'false', d)}; then
101 for i in dbus.target.wants sockets.target.wants multi-user.target.wants; do \
102 install -d ${D}${systemd_system_unitdir}/$i; done
103 install -m 0644 ${B}/bus/dbus.service ${B}/bus/dbus.socket ${D}${systemd_system_unitdir}/
104 ln -fs ../dbus.socket ${D}${systemd_system_unitdir}/dbus.target.wants/dbus.socket
105 ln -fs ../dbus.socket ${D}${systemd_system_unitdir}/sockets.target.wants/dbus.socket
106 ln -fs ../dbus.service ${D}${systemd_system_unitdir}/multi-user.target.wants/dbus.service
107 fi
108
109
110 mkdir -p ${D}${localstatedir}/lib/dbus
111
112 chown messagebus:messagebus ${D}${localstatedir}/lib/dbus
113
114 chown root:messagebus ${D}${libexecdir}/dbus-daemon-launch-helper
115 chmod 4755 ${D}${libexecdir}/dbus-daemon-launch-helper
116
117 # Remove Red Hat initscript
118 rm -rf ${D}${sysconfdir}/rc.d
119
120 # Remove empty testexec directory as we don't build tests
121 rm -rf ${D}${libdir}/dbus-1.0/test
122
123 # Remove /var/run as it is created on startup
124 rm -rf ${D}${localstatedir}/run
125}
126
127do_install_class-native() {
128 autotools_do_install
129
130 # dbus-launch has no X support so lets not install it in case the host
131 # has a more featured and useful version
132 rm -f ${D}${bindir}/dbus-launch
133}
134
135do_install_class-nativesdk() {
136 autotools_do_install
137
138 # dbus-launch has no X support so lets not install it in case the host
139 # has a more featured and useful version
140 rm -f ${D}${bindir}/dbus-launch
141
142 # Remove /var/run to avoid QA error
143 rm -rf ${D}${localstatedir}/run
144}
145BBCLASSEXTEND = "native nativesdk"
146
147INSANE_SKIP_${PN}-ptest += "build-deps"