blob: 48947209d934db50251d562ec4e1a85252a425d9 [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"
Brad Bishop19323692019-04-05 15:28:33 -04009PACKAGES += "${@bb.utils.contains('DISTRO_FEATURES', 'ptest', '${PN}-ptest', '', d)}"
Patrick Williams213cb262021-08-07 19:21:33 -050010ALLOW_EMPTY:dbus-ptest = "1"
11RDEPENDS:dbus-ptest:class-target = "dbus-test-ptest"
12RDEPENDS:${PN} += "${PN}-common ${PN}-tools"
13RDEPENDS:${PN}:class-native = ""
Brad Bishop19323692019-04-05 15:28:33 -040014
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
Andrew Geissler09209ee2020-12-13 08:44:15 -060025PACKAGES =+ "${PN}-lib ${PN}-common ${PN}-tools"
26
27USERADD_PACKAGES = "dbus-common"
Patrick Williams213cb262021-08-07 19:21:33 -050028USERADD_PARAM:dbus-common = "--system --home ${localstatedir}/lib/dbus \
Andrew Geissler09209ee2020-12-13 08:44:15 -060029 --no-create-home --shell /bin/false \
30 --user-group messagebus"
Brad Bishop19323692019-04-05 15:28:33 -040031
Patrick Williams213cb262021-08-07 19:21:33 -050032CONFFILES:${PN} = "${sysconfdir}/dbus-1/system.conf ${sysconfdir}/dbus-1/session.conf"
Brad Bishop19323692019-04-05 15:28:33 -040033
Patrick Williams213cb262021-08-07 19:21:33 -050034DEBIANNAME:${PN} = "dbus-1"
Brad Bishop19323692019-04-05 15:28:33 -040035
Brad Bishop19323692019-04-05 15:28:33 -040036OLDPKGNAME = "dbus-x11"
Patrick Williams213cb262021-08-07 19:21:33 -050037OLDPKGNAME:class-nativesdk = ""
Brad Bishop19323692019-04-05 15:28:33 -040038
39# for compatibility
Patrick Williams213cb262021-08-07 19:21:33 -050040RPROVIDES:${PN} = "${OLDPKGNAME}"
41RREPLACES:${PN} += "${OLDPKGNAME}"
Brad Bishop19323692019-04-05 15:28:33 -040042
Patrick Williams213cb262021-08-07 19:21:33 -050043FILES:${PN} = "${bindir}/dbus-daemon* \
Brad Bishop19323692019-04-05 15:28:33 -040044 ${bindir}/dbus-cleanup-sockets \
Brad Bishop19323692019-04-05 15:28:33 -040045 ${bindir}/dbus-launch \
46 ${bindir}/dbus-run-session \
Brad Bishop19323692019-04-05 15:28:33 -040047 ${libexecdir}/dbus* \
48 ${sysconfdir} \
49 ${localstatedir} \
Brad Bishop19323692019-04-05 15:28:33 -040050 ${systemd_system_unitdir} \
51 ${systemd_user_unitdir} \
Brad Bishop19323692019-04-05 15:28:33 -040052 ${nonarch_libdir}/tmpfiles.d/dbus.conf \
53"
Patrick Williams213cb262021-08-07 19:21:33 -050054FILES:${PN}-common = "${sysconfdir}/dbus-1 \
Andrew Geissler6ce62a22020-11-30 19:58:47 -060055 ${datadir}/dbus-1/services \
56 ${datadir}/dbus-1/system-services \
57 ${datadir}/dbus-1/session.d \
58 ${datadir}/dbus-1/session.conf \
59 ${datadir}/dbus-1/system.d \
60 ${datadir}/dbus-1/system.conf \
61 ${systemd_system_unitdir}/dbus.socket \
62 ${systemd_system_unitdir}/sockets.target.wants \
63 ${systemd_user_unitdir}/dbus.socket \
64 ${systemd_user_unitdir}/sockets.target.wants \
65 ${nonarch_libdir}/sysusers.d/dbus.conf \
66"
Patrick Williams213cb262021-08-07 19:21:33 -050067FILES:${PN}-tools = "${bindir}/dbus-uuidgen \
Andrew Geissler6ce62a22020-11-30 19:58:47 -060068 ${bindir}/dbus-send \
69 ${bindir}/dbus-monitor \
70 ${bindir}/dbus-update-activation-environment \
71"
Patrick Williams213cb262021-08-07 19:21:33 -050072FILES:${PN}-lib = "${libdir}/lib*.so.*"
73RRECOMMENDS:${PN}-lib = "${PN}"
74FILES:${PN}-dev += "${libdir}/dbus-1.0/include ${bindir}/dbus-test-tool ${datadir}/xml/dbus-1"
Brad Bishop19323692019-04-05 15:28:33 -040075
76PACKAGE_WRITE_DEPS += "${@bb.utils.contains('DISTRO_FEATURES','systemd sysvinit','systemd-systemctl-native','',d)}"
Patrick Williams213cb262021-08-07 19:21:33 -050077pkg_postinst:dbus() {
Brad Bishop19323692019-04-05 15:28:33 -040078 # If both systemd and sysvinit are enabled, mask the dbus-1 init script
79 if ${@bb.utils.contains('DISTRO_FEATURES','systemd sysvinit','true','false',d)}; then
80 if [ -n "$D" ]; then
81 OPTS="--root=$D"
82 fi
83 systemctl $OPTS mask dbus-1.service
84 fi
85
86 if [ -z "$D" ] && [ -e /etc/init.d/populate-volatile.sh ] ; then
87 /etc/init.d/populate-volatile.sh update
88 fi
89}
90
Brad Bishopf3f93bb2019-10-16 14:33:32 -040091
Andrew Geisslerd25ed322020-06-27 00:28:28 -050092EXTRA_OECONF += "--disable-tests"
Brad Bishop19323692019-04-05 15:28:33 -040093
94do_install() {
95 autotools_do_install
96
97 if ${@bb.utils.contains('DISTRO_FEATURES', 'sysvinit', 'true', 'false', d)}; then
98 install -d ${D}${sysconfdir}/init.d
99 sed 's:@bindir@:${bindir}:' < ${WORKDIR}/dbus-1.init >${WORKDIR}/dbus-1.init.sh
100 install -m 0755 ${WORKDIR}/dbus-1.init.sh ${D}${sysconfdir}/init.d/dbus-1
101 install -d ${D}${sysconfdir}/default/volatiles
102 echo "d messagebus messagebus 0755 ${localstatedir}/run/dbus none" \
103 > ${D}${sysconfdir}/default/volatiles/99_dbus
104 fi
105
106 if ${@bb.utils.contains('DISTRO_FEATURES', 'systemd', 'true', 'false', d)}; then
107 for i in dbus.target.wants sockets.target.wants multi-user.target.wants; do \
108 install -d ${D}${systemd_system_unitdir}/$i; done
109 install -m 0644 ${B}/bus/dbus.service ${B}/bus/dbus.socket ${D}${systemd_system_unitdir}/
110 ln -fs ../dbus.socket ${D}${systemd_system_unitdir}/dbus.target.wants/dbus.socket
111 ln -fs ../dbus.socket ${D}${systemd_system_unitdir}/sockets.target.wants/dbus.socket
112 ln -fs ../dbus.service ${D}${systemd_system_unitdir}/multi-user.target.wants/dbus.service
113 fi
114
115
116 mkdir -p ${D}${localstatedir}/lib/dbus
117
118 chown messagebus:messagebus ${D}${localstatedir}/lib/dbus
119
120 chown root:messagebus ${D}${libexecdir}/dbus-daemon-launch-helper
121 chmod 4755 ${D}${libexecdir}/dbus-daemon-launch-helper
122
123 # Remove Red Hat initscript
124 rm -rf ${D}${sysconfdir}/rc.d
125
126 # Remove empty testexec directory as we don't build tests
127 rm -rf ${D}${libdir}/dbus-1.0/test
128
129 # Remove /var/run as it is created on startup
130 rm -rf ${D}${localstatedir}/run
131}
132
Patrick Williams213cb262021-08-07 19:21:33 -0500133do_install:class-native() {
Brad Bishop19323692019-04-05 15:28:33 -0400134 autotools_do_install
135
136 # dbus-launch has no X support so lets not install it in case the host
137 # has a more featured and useful version
138 rm -f ${D}${bindir}/dbus-launch
139}
140
Patrick Williams213cb262021-08-07 19:21:33 -0500141do_install:class-nativesdk() {
Brad Bishop19323692019-04-05 15:28:33 -0400142 autotools_do_install
143
144 # dbus-launch has no X support so lets not install it in case the host
145 # has a more featured and useful version
146 rm -f ${D}${bindir}/dbus-launch
147
148 # Remove /var/run to avoid QA error
149 rm -rf ${D}${localstatedir}/run
150}
151BBCLASSEXTEND = "native nativesdk"
152
Patrick Williams213cb262021-08-07 19:21:33 -0500153INSANE_SKIP:${PN}-ptest += "build-deps"