Andrew Geissler | 9aee500 | 2022-03-30 16:27:02 +0000 | [diff] [blame] | 1 | SUMMARY = "D-Bus message bus" |
| 2 | DESCRIPTION = "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." |
| 3 | HOMEPAGE = "https://dbus.freedesktop.org" |
| 4 | SECTION = "base" |
| 5 | |
| 6 | inherit autotools pkgconfig gettext upstream-version-is-even ptest-gnome |
| 7 | |
| 8 | LICENSE = "AFL-2.1 | GPL-2.0-or-later" |
| 9 | LIC_FILES_CHKSUM = "file://COPYING;md5=10dded3b58148f3f1fd804b26354af3e \ |
| 10 | file://dbus/dbus.h;beginline=6;endline=20;md5=866739837ccd835350af94dccd6457d8" |
| 11 | |
| 12 | SRC_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 | |
| 18 | SRC_URI[sha256sum] = "ccd7cce37596e0a19558fd6648d1272ab43f011d80c8635aea8fd0bad58aebd4" |
| 19 | |
| 20 | EXTRA_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 \ |
Andrew Geissler | 78b7279 | 2022-06-14 06:47:25 -0500 | [diff] [blame] | 27 | --runstatedir=/run \ |
Andrew Geissler | 9aee500 | 2022-03-30 16:27:02 +0000 | [diff] [blame] | 28 | " |
| 29 | EXTRA_OECONF:append:class-target = " SYSTEMCTL=${base_bindir}/systemctl" |
| 30 | |
| 31 | PACKAGECONFIG ??= "${@bb.utils.filter('DISTRO_FEATURES', 'systemd x11', d)} \ |
| 32 | user-session \ |
| 33 | " |
| 34 | PACKAGECONFIG:class-native = "" |
| 35 | PACKAGECONFIG:class-nativesdk = "" |
| 36 | |
| 37 | PACKAGECONFIG[systemd] = "--enable-systemd --with-systemdsystemunitdir=${systemd_system_unitdir},--disable-systemd --without-systemdsystemunitdir,systemd" |
| 38 | PACKAGECONFIG[x11] = "--enable-x11-autolaunch,--without-x --disable-x11-autolaunch, virtual/libx11 libsm" |
| 39 | PACKAGECONFIG[user-session] = "--enable-user-session --with-systemduserunitdir=${systemd_user_unitdir},--disable-user-session" |
| 40 | PACKAGECONFIG[verbose-mode] = "--enable-verbose-mode,,," |
| 41 | PACKAGECONFIG[audit] = "--enable-libaudit,--disable-libaudit,audit" |
| 42 | PACKAGECONFIG[selinux] = "--enable-selinux,--disable-selinux,libselinux" |
| 43 | |
| 44 | DEPENDS = "expat virtual/libintl autoconf-archive glib-2.0" |
| 45 | RDEPENDS:${PN} += "${PN}-common ${PN}-tools" |
| 46 | RDEPENDS:${PN}:class-native = "" |
| 47 | |
| 48 | inherit useradd update-rc.d |
| 49 | |
| 50 | INITSCRIPT_NAME = "dbus-1" |
| 51 | INITSCRIPT_PARAMS = "start 02 5 3 2 . stop 20 0 1 6 ." |
| 52 | |
| 53 | python __anonymous() { |
| 54 | if not bb.utils.contains('DISTRO_FEATURES', 'sysvinit', True, False, d): |
| 55 | d.setVar("INHIBIT_UPDATERCD_BBCLASS", "1") |
| 56 | } |
| 57 | |
| 58 | PACKAGES =+ "${PN}-lib ${PN}-common ${PN}-tools" |
| 59 | |
| 60 | USERADD_PACKAGES = "dbus-common" |
| 61 | USERADD_PARAM:dbus-common = "--system --home ${localstatedir}/lib/dbus \ |
| 62 | --no-create-home --shell /bin/false \ |
| 63 | --user-group messagebus" |
| 64 | |
| 65 | CONFFILES:${PN} = "${sysconfdir}/dbus-1/system.conf ${sysconfdir}/dbus-1/session.conf" |
| 66 | |
| 67 | DEBIANNAME:${PN} = "dbus-1" |
| 68 | |
| 69 | OLDPKGNAME = "dbus-x11" |
| 70 | OLDPKGNAME:class-nativesdk = "" |
| 71 | |
| 72 | # for compatibility |
| 73 | RPROVIDES:${PN} = "${OLDPKGNAME}" |
| 74 | RREPLACES:${PN} += "${OLDPKGNAME}" |
| 75 | |
| 76 | FILES:${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 | " |
| 87 | FILES:${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 | " |
| 100 | FILES:${PN}-tools = "${bindir}/dbus-uuidgen \ |
| 101 | ${bindir}/dbus-send \ |
| 102 | ${bindir}/dbus-monitor \ |
| 103 | ${bindir}/dbus-update-activation-environment \ |
| 104 | " |
| 105 | FILES:${PN}-lib = "${libdir}/lib*.so.*" |
| 106 | RRECOMMENDS:${PN}-lib = "${PN}" |
| 107 | FILES:${PN}-dev += "${libdir}/dbus-1.0/include ${bindir}/dbus-test-tool ${datadir}/xml/dbus-1" |
| 108 | |
| 109 | RDEPENDS:${PN}-ptest += "bash make dbus" |
| 110 | |
| 111 | PACKAGE_WRITE_DEPS += "${@bb.utils.contains('DISTRO_FEATURES','systemd sysvinit','systemd-systemctl-native','',d)}" |
| 112 | pkg_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 | |
| 127 | do_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 |
Andrew Geissler | 78b7279 | 2022-06-14 06:47:25 -0500 | [diff] [blame] | 135 | echo "d messagebus messagebus 0755 /run/dbus none" \ |
Andrew Geissler | 9aee500 | 2022-03-30 16:27:02 +0000 | [diff] [blame] | 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 | |
| 166 | do_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 | |
| 174 | do_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 | } |
| 184 | BBCLASSEXTEND = "native nativesdk" |