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" |
| 9 | RDEPENDS_dbus_class-native = "" |
| 10 | RDEPENDS_dbus_class-nativesdk = "" |
| 11 | PACKAGES += "${@bb.utils.contains('DISTRO_FEATURES', 'ptest', '${PN}-ptest', '', d)}" |
| 12 | ALLOW_EMPTY_dbus-ptest = "1" |
| 13 | RDEPENDS_dbus-ptest_class-target = "dbus-test-ptest" |
Andrew Geissler | 6ce62a2 | 2020-11-30 19:58:47 -0600 | [diff] [blame] | 14 | RDEPENDS_${PN} += "${PN}-common ${PN}-tools" |
| 15 | RDEPENDS_${PN}_class-native = "" |
Brad Bishop | 1932369 | 2019-04-05 15:28:33 -0400 | [diff] [blame] | 16 | |
Andrew Geissler | d25ed32 | 2020-06-27 00:28:28 -0500 | [diff] [blame] | 17 | inherit useradd update-rc.d |
Brad Bishop | 1932369 | 2019-04-05 15:28:33 -0400 | [diff] [blame] | 18 | |
| 19 | INITSCRIPT_NAME = "dbus-1" |
| 20 | INITSCRIPT_PARAMS = "start 02 5 3 2 . stop 20 0 1 6 ." |
| 21 | |
| 22 | python __anonymous() { |
| 23 | if not bb.utils.contains('DISTRO_FEATURES', 'sysvinit', True, False, d): |
| 24 | d.setVar("INHIBIT_UPDATERCD_BBCLASS", "1") |
| 25 | } |
| 26 | |
Andrew Geissler | 09209ee | 2020-12-13 08:44:15 -0600 | [diff] [blame^] | 27 | PACKAGES =+ "${PN}-lib ${PN}-common ${PN}-tools" |
| 28 | |
| 29 | USERADD_PACKAGES = "dbus-common" |
| 30 | USERADD_PARAM_dbus-common = "--system --home ${localstatedir}/lib/dbus \ |
| 31 | --no-create-home --shell /bin/false \ |
| 32 | --user-group messagebus" |
Brad Bishop | 1932369 | 2019-04-05 15:28:33 -0400 | [diff] [blame] | 33 | |
| 34 | CONFFILES_${PN} = "${sysconfdir}/dbus-1/system.conf ${sysconfdir}/dbus-1/session.conf" |
| 35 | |
| 36 | DEBIANNAME_${PN} = "dbus-1" |
| 37 | |
Brad Bishop | 1932369 | 2019-04-05 15:28:33 -0400 | [diff] [blame] | 38 | OLDPKGNAME = "dbus-x11" |
| 39 | OLDPKGNAME_class-nativesdk = "" |
| 40 | |
| 41 | # for compatibility |
| 42 | RPROVIDES_${PN} = "${OLDPKGNAME}" |
| 43 | RREPLACES_${PN} += "${OLDPKGNAME}" |
| 44 | |
| 45 | FILES_${PN} = "${bindir}/dbus-daemon* \ |
Brad Bishop | 1932369 | 2019-04-05 15:28:33 -0400 | [diff] [blame] | 46 | ${bindir}/dbus-cleanup-sockets \ |
Brad Bishop | 1932369 | 2019-04-05 15:28:33 -0400 | [diff] [blame] | 47 | ${bindir}/dbus-launch \ |
| 48 | ${bindir}/dbus-run-session \ |
Brad Bishop | 1932369 | 2019-04-05 15:28:33 -0400 | [diff] [blame] | 49 | ${libexecdir}/dbus* \ |
| 50 | ${sysconfdir} \ |
| 51 | ${localstatedir} \ |
Brad Bishop | 1932369 | 2019-04-05 15:28:33 -0400 | [diff] [blame] | 52 | ${systemd_system_unitdir} \ |
| 53 | ${systemd_user_unitdir} \ |
Brad Bishop | 1932369 | 2019-04-05 15:28:33 -0400 | [diff] [blame] | 54 | ${nonarch_libdir}/tmpfiles.d/dbus.conf \ |
| 55 | " |
Andrew Geissler | 6ce62a2 | 2020-11-30 19:58:47 -0600 | [diff] [blame] | 56 | FILES_${PN}-common = "${sysconfdir}/dbus-1 \ |
| 57 | ${datadir}/dbus-1/services \ |
| 58 | ${datadir}/dbus-1/system-services \ |
| 59 | ${datadir}/dbus-1/session.d \ |
| 60 | ${datadir}/dbus-1/session.conf \ |
| 61 | ${datadir}/dbus-1/system.d \ |
| 62 | ${datadir}/dbus-1/system.conf \ |
| 63 | ${systemd_system_unitdir}/dbus.socket \ |
| 64 | ${systemd_system_unitdir}/sockets.target.wants \ |
| 65 | ${systemd_user_unitdir}/dbus.socket \ |
| 66 | ${systemd_user_unitdir}/sockets.target.wants \ |
| 67 | ${nonarch_libdir}/sysusers.d/dbus.conf \ |
| 68 | " |
| 69 | FILES_${PN}-tools = "${bindir}/dbus-uuidgen \ |
| 70 | ${bindir}/dbus-send \ |
| 71 | ${bindir}/dbus-monitor \ |
| 72 | ${bindir}/dbus-update-activation-environment \ |
| 73 | " |
Brad Bishop | 1932369 | 2019-04-05 15:28:33 -0400 | [diff] [blame] | 74 | FILES_${PN}-lib = "${libdir}/lib*.so.*" |
| 75 | RRECOMMENDS_${PN}-lib = "${PN}" |
Andrew Geissler | 6ce62a2 | 2020-11-30 19:58:47 -0600 | [diff] [blame] | 76 | FILES_${PN}-dev += "${libdir}/dbus-1.0/include ${libdir}/cmake/DBus1 ${bindir}/dbus-test-tool ${datadir}/xml/dbus-1" |
Brad Bishop | 1932369 | 2019-04-05 15:28:33 -0400 | [diff] [blame] | 77 | |
| 78 | PACKAGE_WRITE_DEPS += "${@bb.utils.contains('DISTRO_FEATURES','systemd sysvinit','systemd-systemctl-native','',d)}" |
| 79 | pkg_postinst_dbus() { |
| 80 | # If both systemd and sysvinit are enabled, mask the dbus-1 init script |
| 81 | if ${@bb.utils.contains('DISTRO_FEATURES','systemd sysvinit','true','false',d)}; then |
| 82 | if [ -n "$D" ]; then |
| 83 | OPTS="--root=$D" |
| 84 | fi |
| 85 | systemctl $OPTS mask dbus-1.service |
| 86 | fi |
| 87 | |
| 88 | if [ -z "$D" ] && [ -e /etc/init.d/populate-volatile.sh ] ; then |
| 89 | /etc/init.d/populate-volatile.sh update |
| 90 | fi |
| 91 | } |
| 92 | |
Brad Bishop | f3f93bb | 2019-10-16 14:33:32 -0400 | [diff] [blame] | 93 | |
Andrew Geissler | d25ed32 | 2020-06-27 00:28:28 -0500 | [diff] [blame] | 94 | EXTRA_OECONF += "--disable-tests" |
Brad Bishop | 1932369 | 2019-04-05 15:28:33 -0400 | [diff] [blame] | 95 | |
| 96 | do_install() { |
| 97 | autotools_do_install |
| 98 | |
| 99 | if ${@bb.utils.contains('DISTRO_FEATURES', 'sysvinit', 'true', 'false', d)}; then |
| 100 | install -d ${D}${sysconfdir}/init.d |
| 101 | sed 's:@bindir@:${bindir}:' < ${WORKDIR}/dbus-1.init >${WORKDIR}/dbus-1.init.sh |
| 102 | install -m 0755 ${WORKDIR}/dbus-1.init.sh ${D}${sysconfdir}/init.d/dbus-1 |
| 103 | install -d ${D}${sysconfdir}/default/volatiles |
| 104 | echo "d messagebus messagebus 0755 ${localstatedir}/run/dbus none" \ |
| 105 | > ${D}${sysconfdir}/default/volatiles/99_dbus |
| 106 | fi |
| 107 | |
| 108 | if ${@bb.utils.contains('DISTRO_FEATURES', 'systemd', 'true', 'false', d)}; then |
| 109 | for i in dbus.target.wants sockets.target.wants multi-user.target.wants; do \ |
| 110 | install -d ${D}${systemd_system_unitdir}/$i; done |
| 111 | install -m 0644 ${B}/bus/dbus.service ${B}/bus/dbus.socket ${D}${systemd_system_unitdir}/ |
| 112 | ln -fs ../dbus.socket ${D}${systemd_system_unitdir}/dbus.target.wants/dbus.socket |
| 113 | ln -fs ../dbus.socket ${D}${systemd_system_unitdir}/sockets.target.wants/dbus.socket |
| 114 | ln -fs ../dbus.service ${D}${systemd_system_unitdir}/multi-user.target.wants/dbus.service |
| 115 | fi |
| 116 | |
| 117 | |
| 118 | mkdir -p ${D}${localstatedir}/lib/dbus |
| 119 | |
| 120 | chown messagebus:messagebus ${D}${localstatedir}/lib/dbus |
| 121 | |
| 122 | chown root:messagebus ${D}${libexecdir}/dbus-daemon-launch-helper |
| 123 | chmod 4755 ${D}${libexecdir}/dbus-daemon-launch-helper |
| 124 | |
| 125 | # Remove Red Hat initscript |
| 126 | rm -rf ${D}${sysconfdir}/rc.d |
| 127 | |
| 128 | # Remove empty testexec directory as we don't build tests |
| 129 | rm -rf ${D}${libdir}/dbus-1.0/test |
| 130 | |
| 131 | # Remove /var/run as it is created on startup |
| 132 | rm -rf ${D}${localstatedir}/run |
| 133 | } |
| 134 | |
| 135 | do_install_class-native() { |
| 136 | autotools_do_install |
| 137 | |
| 138 | # dbus-launch has no X support so lets not install it in case the host |
| 139 | # has a more featured and useful version |
| 140 | rm -f ${D}${bindir}/dbus-launch |
| 141 | } |
| 142 | |
| 143 | do_install_class-nativesdk() { |
| 144 | autotools_do_install |
| 145 | |
| 146 | # dbus-launch has no X support so lets not install it in case the host |
| 147 | # has a more featured and useful version |
| 148 | rm -f ${D}${bindir}/dbus-launch |
| 149 | |
| 150 | # Remove /var/run to avoid QA error |
| 151 | rm -rf ${D}${localstatedir}/run |
| 152 | } |
| 153 | BBCLASSEXTEND = "native nativesdk" |
| 154 | |
| 155 | INSANE_SKIP_${PN}-ptest += "build-deps" |