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