blob: 09049301cc740d65e56e35c34d52d5e6884d482e [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"
Andrew Geissler6ce62a22020-11-30 19:58:47 -060014RDEPENDS_${PN} += "${PN}-common ${PN}-tools"
15RDEPENDS_${PN}_class-native = ""
Brad Bishop19323692019-04-05 15:28:33 -040016
Andrew Geisslerd25ed322020-06-27 00:28:28 -050017inherit useradd update-rc.d
Brad Bishop19323692019-04-05 15:28:33 -040018
19INITSCRIPT_NAME = "dbus-1"
20INITSCRIPT_PARAMS = "start 02 5 3 2 . stop 20 0 1 6 ."
21
22python __anonymous() {
23 if not bb.utils.contains('DISTRO_FEATURES', 'sysvinit', True, False, d):
24 d.setVar("INHIBIT_UPDATERCD_BBCLASS", "1")
25}
26
Andrew Geissler09209ee2020-12-13 08:44:15 -060027PACKAGES =+ "${PN}-lib ${PN}-common ${PN}-tools"
28
29USERADD_PACKAGES = "dbus-common"
30USERADD_PARAM_dbus-common = "--system --home ${localstatedir}/lib/dbus \
31 --no-create-home --shell /bin/false \
32 --user-group messagebus"
Brad Bishop19323692019-04-05 15:28:33 -040033
34CONFFILES_${PN} = "${sysconfdir}/dbus-1/system.conf ${sysconfdir}/dbus-1/session.conf"
35
36DEBIANNAME_${PN} = "dbus-1"
37
Brad Bishop19323692019-04-05 15:28:33 -040038OLDPKGNAME = "dbus-x11"
39OLDPKGNAME_class-nativesdk = ""
40
41# for compatibility
42RPROVIDES_${PN} = "${OLDPKGNAME}"
43RREPLACES_${PN} += "${OLDPKGNAME}"
44
45FILES_${PN} = "${bindir}/dbus-daemon* \
Brad Bishop19323692019-04-05 15:28:33 -040046 ${bindir}/dbus-cleanup-sockets \
Brad Bishop19323692019-04-05 15:28:33 -040047 ${bindir}/dbus-launch \
48 ${bindir}/dbus-run-session \
Brad Bishop19323692019-04-05 15:28:33 -040049 ${libexecdir}/dbus* \
50 ${sysconfdir} \
51 ${localstatedir} \
Brad Bishop19323692019-04-05 15:28:33 -040052 ${systemd_system_unitdir} \
53 ${systemd_user_unitdir} \
Brad Bishop19323692019-04-05 15:28:33 -040054 ${nonarch_libdir}/tmpfiles.d/dbus.conf \
55"
Andrew Geissler6ce62a22020-11-30 19:58:47 -060056FILES_${PN}-common = "${sysconfdir}/dbus-1 \
57 ${datadir}/dbus-1/services \
58 ${datadir}/dbus-1/system-services \
59 ${datadir}/dbus-1/session.d \
60 ${datadir}/dbus-1/session.conf \
61 ${datadir}/dbus-1/system.d \
62 ${datadir}/dbus-1/system.conf \
63 ${systemd_system_unitdir}/dbus.socket \
64 ${systemd_system_unitdir}/sockets.target.wants \
65 ${systemd_user_unitdir}/dbus.socket \
66 ${systemd_user_unitdir}/sockets.target.wants \
67 ${nonarch_libdir}/sysusers.d/dbus.conf \
68"
69FILES_${PN}-tools = "${bindir}/dbus-uuidgen \
70 ${bindir}/dbus-send \
71 ${bindir}/dbus-monitor \
72 ${bindir}/dbus-update-activation-environment \
73"
Brad Bishop19323692019-04-05 15:28:33 -040074FILES_${PN}-lib = "${libdir}/lib*.so.*"
75RRECOMMENDS_${PN}-lib = "${PN}"
Andrew Geissler6ce62a22020-11-30 19:58:47 -060076FILES_${PN}-dev += "${libdir}/dbus-1.0/include ${libdir}/cmake/DBus1 ${bindir}/dbus-test-tool ${datadir}/xml/dbus-1"
Brad Bishop19323692019-04-05 15:28:33 -040077
78PACKAGE_WRITE_DEPS += "${@bb.utils.contains('DISTRO_FEATURES','systemd sysvinit','systemd-systemctl-native','',d)}"
79pkg_postinst_dbus() {
80 # If both systemd and sysvinit are enabled, mask the dbus-1 init script
81 if ${@bb.utils.contains('DISTRO_FEATURES','systemd sysvinit','true','false',d)}; then
82 if [ -n "$D" ]; then
83 OPTS="--root=$D"
84 fi
85 systemctl $OPTS mask dbus-1.service
86 fi
87
88 if [ -z "$D" ] && [ -e /etc/init.d/populate-volatile.sh ] ; then
89 /etc/init.d/populate-volatile.sh update
90 fi
91}
92
Brad Bishopf3f93bb2019-10-16 14:33:32 -040093
Andrew Geisslerd25ed322020-06-27 00:28:28 -050094EXTRA_OECONF += "--disable-tests"
Brad Bishop19323692019-04-05 15:28:33 -040095
96do_install() {
97 autotools_do_install
98
99 if ${@bb.utils.contains('DISTRO_FEATURES', 'sysvinit', 'true', 'false', d)}; then
100 install -d ${D}${sysconfdir}/init.d
101 sed 's:@bindir@:${bindir}:' < ${WORKDIR}/dbus-1.init >${WORKDIR}/dbus-1.init.sh
102 install -m 0755 ${WORKDIR}/dbus-1.init.sh ${D}${sysconfdir}/init.d/dbus-1
103 install -d ${D}${sysconfdir}/default/volatiles
104 echo "d messagebus messagebus 0755 ${localstatedir}/run/dbus none" \
105 > ${D}${sysconfdir}/default/volatiles/99_dbus
106 fi
107
108 if ${@bb.utils.contains('DISTRO_FEATURES', 'systemd', 'true', 'false', d)}; then
109 for i in dbus.target.wants sockets.target.wants multi-user.target.wants; do \
110 install -d ${D}${systemd_system_unitdir}/$i; done
111 install -m 0644 ${B}/bus/dbus.service ${B}/bus/dbus.socket ${D}${systemd_system_unitdir}/
112 ln -fs ../dbus.socket ${D}${systemd_system_unitdir}/dbus.target.wants/dbus.socket
113 ln -fs ../dbus.socket ${D}${systemd_system_unitdir}/sockets.target.wants/dbus.socket
114 ln -fs ../dbus.service ${D}${systemd_system_unitdir}/multi-user.target.wants/dbus.service
115 fi
116
117
118 mkdir -p ${D}${localstatedir}/lib/dbus
119
120 chown messagebus:messagebus ${D}${localstatedir}/lib/dbus
121
122 chown root:messagebus ${D}${libexecdir}/dbus-daemon-launch-helper
123 chmod 4755 ${D}${libexecdir}/dbus-daemon-launch-helper
124
125 # Remove Red Hat initscript
126 rm -rf ${D}${sysconfdir}/rc.d
127
128 # Remove empty testexec directory as we don't build tests
129 rm -rf ${D}${libdir}/dbus-1.0/test
130
131 # Remove /var/run as it is created on startup
132 rm -rf ${D}${localstatedir}/run
133}
134
135do_install_class-native() {
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
143do_install_class-nativesdk() {
144 autotools_do_install
145
146 # dbus-launch has no X support so lets not install it in case the host
147 # has a more featured and useful version
148 rm -f ${D}${bindir}/dbus-launch
149
150 # Remove /var/run to avoid QA error
151 rm -rf ${D}${localstatedir}/run
152}
153BBCLASSEXTEND = "native nativesdk"
154
155INSANE_SKIP_${PN}-ptest += "build-deps"