Brad Bishop | 1932369 | 2019-04-05 15:28:33 -0400 | [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." |
Andrew Geissler | 82c905d | 2020-04-13 13:39:40 -0500 | [diff] [blame] | 3 | HOMEPAGE = "https://dbus.freedesktop.org" |
Brad Bishop | 1932369 | 2019-04-05 15:28:33 -0400 | [diff] [blame] | 4 | SECTION = "base" |
Andrew Geissler | d25ed32 | 2020-06-27 00:28:28 -0500 | [diff] [blame] | 5 | |
| 6 | require dbus.inc |
| 7 | |
Brad Bishop | 1932369 | 2019-04-05 15:28:33 -0400 | [diff] [blame] | 8 | DEPENDS = "expat virtual/libintl autoconf-archive" |
Brad Bishop | 1932369 | 2019-04-05 15:28:33 -0400 | [diff] [blame] | 9 | PACKAGES += "${@bb.utils.contains('DISTRO_FEATURES', 'ptest', '${PN}-ptest', '', d)}" |
Patrick Williams | 213cb26 | 2021-08-07 19:21:33 -0500 | [diff] [blame] | 10 | ALLOW_EMPTY:dbus-ptest = "1" |
| 11 | RDEPENDS:dbus-ptest:class-target = "dbus-test-ptest" |
| 12 | RDEPENDS:${PN} += "${PN}-common ${PN}-tools" |
| 13 | RDEPENDS:${PN}:class-native = "" |
Brad Bishop | 1932369 | 2019-04-05 15:28:33 -0400 | [diff] [blame] | 14 | |
Andrew Geissler | d25ed32 | 2020-06-27 00:28:28 -0500 | [diff] [blame] | 15 | inherit useradd update-rc.d |
Brad Bishop | 1932369 | 2019-04-05 15:28:33 -0400 | [diff] [blame] | 16 | |
| 17 | INITSCRIPT_NAME = "dbus-1" |
| 18 | INITSCRIPT_PARAMS = "start 02 5 3 2 . stop 20 0 1 6 ." |
| 19 | |
| 20 | python __anonymous() { |
| 21 | if not bb.utils.contains('DISTRO_FEATURES', 'sysvinit', True, False, d): |
| 22 | d.setVar("INHIBIT_UPDATERCD_BBCLASS", "1") |
| 23 | } |
| 24 | |
Andrew Geissler | 09209ee | 2020-12-13 08:44:15 -0600 | [diff] [blame] | 25 | PACKAGES =+ "${PN}-lib ${PN}-common ${PN}-tools" |
| 26 | |
| 27 | USERADD_PACKAGES = "dbus-common" |
Patrick Williams | 213cb26 | 2021-08-07 19:21:33 -0500 | [diff] [blame] | 28 | USERADD_PARAM:dbus-common = "--system --home ${localstatedir}/lib/dbus \ |
Andrew Geissler | 09209ee | 2020-12-13 08:44:15 -0600 | [diff] [blame] | 29 | --no-create-home --shell /bin/false \ |
| 30 | --user-group messagebus" |
Brad Bishop | 1932369 | 2019-04-05 15:28:33 -0400 | [diff] [blame] | 31 | |
Patrick Williams | 213cb26 | 2021-08-07 19:21:33 -0500 | [diff] [blame] | 32 | CONFFILES:${PN} = "${sysconfdir}/dbus-1/system.conf ${sysconfdir}/dbus-1/session.conf" |
Brad Bishop | 1932369 | 2019-04-05 15:28:33 -0400 | [diff] [blame] | 33 | |
Patrick Williams | 213cb26 | 2021-08-07 19:21:33 -0500 | [diff] [blame] | 34 | DEBIANNAME:${PN} = "dbus-1" |
Brad Bishop | 1932369 | 2019-04-05 15:28:33 -0400 | [diff] [blame] | 35 | |
Brad Bishop | 1932369 | 2019-04-05 15:28:33 -0400 | [diff] [blame] | 36 | OLDPKGNAME = "dbus-x11" |
Patrick Williams | 213cb26 | 2021-08-07 19:21:33 -0500 | [diff] [blame] | 37 | OLDPKGNAME:class-nativesdk = "" |
Brad Bishop | 1932369 | 2019-04-05 15:28:33 -0400 | [diff] [blame] | 38 | |
| 39 | # for compatibility |
Patrick Williams | 213cb26 | 2021-08-07 19:21:33 -0500 | [diff] [blame] | 40 | RPROVIDES:${PN} = "${OLDPKGNAME}" |
| 41 | RREPLACES:${PN} += "${OLDPKGNAME}" |
Brad Bishop | 1932369 | 2019-04-05 15:28:33 -0400 | [diff] [blame] | 42 | |
Patrick Williams | 213cb26 | 2021-08-07 19:21:33 -0500 | [diff] [blame] | 43 | FILES:${PN} = "${bindir}/dbus-daemon* \ |
Brad Bishop | 1932369 | 2019-04-05 15:28:33 -0400 | [diff] [blame] | 44 | ${bindir}/dbus-cleanup-sockets \ |
Brad Bishop | 1932369 | 2019-04-05 15:28:33 -0400 | [diff] [blame] | 45 | ${bindir}/dbus-launch \ |
| 46 | ${bindir}/dbus-run-session \ |
Brad Bishop | 1932369 | 2019-04-05 15:28:33 -0400 | [diff] [blame] | 47 | ${libexecdir}/dbus* \ |
| 48 | ${sysconfdir} \ |
| 49 | ${localstatedir} \ |
Brad Bishop | 1932369 | 2019-04-05 15:28:33 -0400 | [diff] [blame] | 50 | ${systemd_system_unitdir} \ |
| 51 | ${systemd_user_unitdir} \ |
Brad Bishop | 1932369 | 2019-04-05 15:28:33 -0400 | [diff] [blame] | 52 | ${nonarch_libdir}/tmpfiles.d/dbus.conf \ |
| 53 | " |
Patrick Williams | 213cb26 | 2021-08-07 19:21:33 -0500 | [diff] [blame] | 54 | FILES:${PN}-common = "${sysconfdir}/dbus-1 \ |
Andrew Geissler | 6ce62a2 | 2020-11-30 19:58:47 -0600 | [diff] [blame] | 55 | ${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 Williams | 213cb26 | 2021-08-07 19:21:33 -0500 | [diff] [blame] | 67 | FILES:${PN}-tools = "${bindir}/dbus-uuidgen \ |
Andrew Geissler | 6ce62a2 | 2020-11-30 19:58:47 -0600 | [diff] [blame] | 68 | ${bindir}/dbus-send \ |
| 69 | ${bindir}/dbus-monitor \ |
| 70 | ${bindir}/dbus-update-activation-environment \ |
| 71 | " |
Patrick Williams | 213cb26 | 2021-08-07 19:21:33 -0500 | [diff] [blame] | 72 | FILES:${PN}-lib = "${libdir}/lib*.so.*" |
| 73 | RRECOMMENDS:${PN}-lib = "${PN}" |
| 74 | FILES:${PN}-dev += "${libdir}/dbus-1.0/include ${bindir}/dbus-test-tool ${datadir}/xml/dbus-1" |
Brad Bishop | 1932369 | 2019-04-05 15:28:33 -0400 | [diff] [blame] | 75 | |
| 76 | PACKAGE_WRITE_DEPS += "${@bb.utils.contains('DISTRO_FEATURES','systemd sysvinit','systemd-systemctl-native','',d)}" |
Patrick Williams | 213cb26 | 2021-08-07 19:21:33 -0500 | [diff] [blame] | 77 | pkg_postinst:dbus() { |
Brad Bishop | 1932369 | 2019-04-05 15:28:33 -0400 | [diff] [blame] | 78 | # 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 Bishop | f3f93bb | 2019-10-16 14:33:32 -0400 | [diff] [blame] | 91 | |
Andrew Geissler | d25ed32 | 2020-06-27 00:28:28 -0500 | [diff] [blame] | 92 | EXTRA_OECONF += "--disable-tests" |
Brad Bishop | 1932369 | 2019-04-05 15:28:33 -0400 | [diff] [blame] | 93 | |
| 94 | do_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 Williams | 213cb26 | 2021-08-07 19:21:33 -0500 | [diff] [blame] | 133 | do_install:class-native() { |
Brad Bishop | 1932369 | 2019-04-05 15:28:33 -0400 | [diff] [blame] | 134 | 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 Williams | 213cb26 | 2021-08-07 19:21:33 -0500 | [diff] [blame] | 141 | do_install:class-nativesdk() { |
Brad Bishop | 1932369 | 2019-04-05 15:28:33 -0400 | [diff] [blame] | 142 | 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 | } |
| 151 | BBCLASSEXTEND = "native nativesdk" |
| 152 | |
Patrick Williams | 213cb26 | 2021-08-07 19:21:33 -0500 | [diff] [blame] | 153 | INSANE_SKIP:${PN}-ptest += "build-deps" |