blob: 7598c45f8e1cc3d9656b8795a09d9a798795b078 [file] [log] [blame]
Andrew Geissler9aee5002022-03-30 16:27:02 +00001SUMMARY = "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."
3HOMEPAGE = "https://dbus.freedesktop.org"
4SECTION = "base"
5
6inherit autotools pkgconfig gettext upstream-version-is-even ptest-gnome
7
8LICENSE = "AFL-2.1 | GPL-2.0-or-later"
9LIC_FILES_CHKSUM = "file://COPYING;md5=10dded3b58148f3f1fd804b26354af3e \
10 file://dbus/dbus.h;beginline=6;endline=20;md5=866739837ccd835350af94dccd6457d8"
11
12SRC_URI = "https://dbus.freedesktop.org/releases/dbus/dbus-${PV}.tar.xz \
13 file://run-ptest \
14 file://tmpdir.patch \
15 file://dbus-1.init \
16"
17
18SRC_URI[sha256sum] = "ccd7cce37596e0a19558fd6648d1272ab43f011d80c8635aea8fd0bad58aebd4"
19
20EXTRA_OECONF = "--disable-xml-docs \
21 --disable-doxygen-docs \
22 --enable-largefile \
23 --with-system-socket=/run/dbus/system_bus_socket \
24 --enable-tests \
25 --enable-checks \
26 --enable-asserts \
27 "
28EXTRA_OECONF:append:class-target = " SYSTEMCTL=${base_bindir}/systemctl"
29
30PACKAGECONFIG ??= "${@bb.utils.filter('DISTRO_FEATURES', 'systemd x11', d)} \
31 user-session \
32 "
33PACKAGECONFIG:class-native = ""
34PACKAGECONFIG:class-nativesdk = ""
35
36PACKAGECONFIG[systemd] = "--enable-systemd --with-systemdsystemunitdir=${systemd_system_unitdir},--disable-systemd --without-systemdsystemunitdir,systemd"
37PACKAGECONFIG[x11] = "--enable-x11-autolaunch,--without-x --disable-x11-autolaunch, virtual/libx11 libsm"
38PACKAGECONFIG[user-session] = "--enable-user-session --with-systemduserunitdir=${systemd_user_unitdir},--disable-user-session"
39PACKAGECONFIG[verbose-mode] = "--enable-verbose-mode,,,"
40PACKAGECONFIG[audit] = "--enable-libaudit,--disable-libaudit,audit"
41PACKAGECONFIG[selinux] = "--enable-selinux,--disable-selinux,libselinux"
42
43DEPENDS = "expat virtual/libintl autoconf-archive glib-2.0"
44RDEPENDS:${PN} += "${PN}-common ${PN}-tools"
45RDEPENDS:${PN}:class-native = ""
46
47inherit useradd update-rc.d
48
49INITSCRIPT_NAME = "dbus-1"
50INITSCRIPT_PARAMS = "start 02 5 3 2 . stop 20 0 1 6 ."
51
52python __anonymous() {
53 if not bb.utils.contains('DISTRO_FEATURES', 'sysvinit', True, False, d):
54 d.setVar("INHIBIT_UPDATERCD_BBCLASS", "1")
55}
56
57PACKAGES =+ "${PN}-lib ${PN}-common ${PN}-tools"
58
59USERADD_PACKAGES = "dbus-common"
60USERADD_PARAM:dbus-common = "--system --home ${localstatedir}/lib/dbus \
61 --no-create-home --shell /bin/false \
62 --user-group messagebus"
63
64CONFFILES:${PN} = "${sysconfdir}/dbus-1/system.conf ${sysconfdir}/dbus-1/session.conf"
65
66DEBIANNAME:${PN} = "dbus-1"
67
68OLDPKGNAME = "dbus-x11"
69OLDPKGNAME:class-nativesdk = ""
70
71# for compatibility
72RPROVIDES:${PN} = "${OLDPKGNAME}"
73RREPLACES:${PN} += "${OLDPKGNAME}"
74
75FILES:${PN} = "${bindir}/dbus-daemon* \
76 ${bindir}/dbus-cleanup-sockets \
77 ${bindir}/dbus-launch \
78 ${bindir}/dbus-run-session \
79 ${libexecdir}/dbus* \
80 ${sysconfdir} \
81 ${localstatedir} \
82 ${systemd_system_unitdir} \
83 ${systemd_user_unitdir} \
84 ${nonarch_libdir}/tmpfiles.d/dbus.conf \
85"
86FILES:${PN}-common = "${sysconfdir}/dbus-1 \
87 ${datadir}/dbus-1/services \
88 ${datadir}/dbus-1/system-services \
89 ${datadir}/dbus-1/session.d \
90 ${datadir}/dbus-1/session.conf \
91 ${datadir}/dbus-1/system.d \
92 ${datadir}/dbus-1/system.conf \
93 ${systemd_system_unitdir}/dbus.socket \
94 ${systemd_system_unitdir}/sockets.target.wants \
95 ${systemd_user_unitdir}/dbus.socket \
96 ${systemd_user_unitdir}/sockets.target.wants \
97 ${nonarch_libdir}/sysusers.d/dbus.conf \
98"
99FILES:${PN}-tools = "${bindir}/dbus-uuidgen \
100 ${bindir}/dbus-send \
101 ${bindir}/dbus-monitor \
102 ${bindir}/dbus-update-activation-environment \
103"
104FILES:${PN}-lib = "${libdir}/lib*.so.*"
105RRECOMMENDS:${PN}-lib = "${PN}"
106FILES:${PN}-dev += "${libdir}/dbus-1.0/include ${bindir}/dbus-test-tool ${datadir}/xml/dbus-1"
107
108RDEPENDS:${PN}-ptest += "bash make dbus"
109
110PACKAGE_WRITE_DEPS += "${@bb.utils.contains('DISTRO_FEATURES','systemd sysvinit','systemd-systemctl-native','',d)}"
111pkg_postinst:dbus() {
112 # If both systemd and sysvinit are enabled, mask the dbus-1 init script
113 if ${@bb.utils.contains('DISTRO_FEATURES','systemd sysvinit','true','false',d)}; then
114 if [ -n "$D" ]; then
115 OPTS="--root=$D"
116 fi
117 systemctl $OPTS mask dbus-1.service
118 fi
119
120 if [ -z "$D" ] && [ -e /etc/init.d/populate-volatile.sh ] ; then
121 /etc/init.d/populate-volatile.sh update
122 fi
123}
124
125
126do_install() {
127 autotools_do_install
128
129 if ${@bb.utils.contains('DISTRO_FEATURES', 'sysvinit', 'true', 'false', d)}; then
130 install -d ${D}${sysconfdir}/init.d
131 sed 's:@bindir@:${bindir}:' < ${WORKDIR}/dbus-1.init >${WORKDIR}/dbus-1.init.sh
132 install -m 0755 ${WORKDIR}/dbus-1.init.sh ${D}${sysconfdir}/init.d/dbus-1
133 install -d ${D}${sysconfdir}/default/volatiles
134 echo "d messagebus messagebus 0755 ${localstatedir}/run/dbus none" \
135 > ${D}${sysconfdir}/default/volatiles/99_dbus
136 fi
137
138 if ${@bb.utils.contains('DISTRO_FEATURES', 'systemd', 'true', 'false', d)}; then
139 for i in dbus.target.wants sockets.target.wants multi-user.target.wants; do \
140 install -d ${D}${systemd_system_unitdir}/$i; done
141 install -m 0644 ${B}/bus/dbus.service ${B}/bus/dbus.socket ${D}${systemd_system_unitdir}/
142 ln -fs ../dbus.socket ${D}${systemd_system_unitdir}/dbus.target.wants/dbus.socket
143 ln -fs ../dbus.socket ${D}${systemd_system_unitdir}/sockets.target.wants/dbus.socket
144 ln -fs ../dbus.service ${D}${systemd_system_unitdir}/multi-user.target.wants/dbus.service
145 fi
146
147
148 mkdir -p ${D}${localstatedir}/lib/dbus
149
150 chown messagebus:messagebus ${D}${localstatedir}/lib/dbus
151
152 chown root:messagebus ${D}${libexecdir}/dbus-daemon-launch-helper
153 chmod 4755 ${D}${libexecdir}/dbus-daemon-launch-helper
154
155 # Remove Red Hat initscript
156 rm -rf ${D}${sysconfdir}/rc.d
157
158 # Remove empty testexec directory as we don't build tests
159 rm -rf ${D}${libdir}/dbus-1.0/test
160
161 # Remove /var/run as it is created on startup
162 rm -rf ${D}${localstatedir}/run
163}
164
165do_install:class-native() {
166 autotools_do_install
167
168 # dbus-launch has no X support so lets not install it in case the host
169 # has a more featured and useful version
170 rm -f ${D}${bindir}/dbus-launch
171}
172
173do_install:class-nativesdk() {
174 autotools_do_install
175
176 # dbus-launch has no X support so lets not install it in case the host
177 # has a more featured and useful version
178 rm -f ${D}${bindir}/dbus-launch
179
180 # Remove /var/run to avoid QA error
181 rm -rf ${D}${localstatedir}/run
182}
183BBCLASSEXTEND = "native nativesdk"