dbus_1.12.10.bb 6.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177
  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 = "http://dbus.freedesktop.org"
  4. SECTION = "base"
  5. LICENSE = "AFL-2 | GPLv2+"
  6. LIC_FILES_CHKSUM = "file://COPYING;md5=10dded3b58148f3f1fd804b26354af3e \
  7. file://dbus/dbus.h;beginline=6;endline=20;md5=7755c9d7abccd5dbd25a6a974538bb3c"
  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"
  14. SRC_URI = "http://dbus.freedesktop.org/releases/dbus/dbus-${PV}.tar.gz \
  15. file://tmpdir.patch \
  16. file://dbus-1.init \
  17. file://clear-guid_from_server-if-send_negotiate_unix_f.patch \
  18. file://CVE-2019-12749.patch \
  19. "
  20. SRC_URI[md5sum] = "c3e12b4206e2a7da39d7cc42567790ef"
  21. SRC_URI[sha256sum] = "4b693d24976258c3f2fa9cc33ad9288c5fbfa7a16481dbd9a8a429f7aa8cdcf7"
  22. inherit useradd autotools pkgconfig gettext update-rc.d upstream-version-is-even
  23. INITSCRIPT_NAME = "dbus-1"
  24. INITSCRIPT_PARAMS = "start 02 5 3 2 . stop 20 0 1 6 ."
  25. python __anonymous() {
  26. if not bb.utils.contains('DISTRO_FEATURES', 'sysvinit', True, False, d):
  27. d.setVar("INHIBIT_UPDATERCD_BBCLASS", "1")
  28. }
  29. USERADD_PACKAGES = "${PN}"
  30. GROUPADD_PARAM_${PN} = "-r netdev"
  31. USERADD_PARAM_${PN} = "--system --home ${localstatedir}/lib/dbus \
  32. --no-create-home --shell /bin/false \
  33. --user-group messagebus"
  34. CONFFILES_${PN} = "${sysconfdir}/dbus-1/system.conf ${sysconfdir}/dbus-1/session.conf"
  35. DEBIANNAME_${PN} = "dbus-1"
  36. PACKAGES =+ "${PN}-lib"
  37. OLDPKGNAME = "dbus-x11"
  38. OLDPKGNAME_class-nativesdk = ""
  39. # for compatibility
  40. RPROVIDES_${PN} = "${OLDPKGNAME}"
  41. RREPLACES_${PN} += "${OLDPKGNAME}"
  42. FILES_${PN} = "${bindir}/dbus-daemon* \
  43. ${bindir}/dbus-uuidgen \
  44. ${bindir}/dbus-cleanup-sockets \
  45. ${bindir}/dbus-send \
  46. ${bindir}/dbus-monitor \
  47. ${bindir}/dbus-launch \
  48. ${bindir}/dbus-run-session \
  49. ${bindir}/dbus-update-activation-environment \
  50. ${libexecdir}/dbus* \
  51. ${sysconfdir} \
  52. ${localstatedir} \
  53. ${datadir}/dbus-1/services \
  54. ${datadir}/dbus-1/system-services \
  55. ${datadir}/dbus-1/session.d \
  56. ${datadir}/dbus-1/session.conf \
  57. ${datadir}/dbus-1/system.d \
  58. ${datadir}/dbus-1/system.conf \
  59. ${datadir}/xml/dbus-1 \
  60. ${systemd_system_unitdir} \
  61. ${systemd_user_unitdir} \
  62. ${nonarch_libdir}/sysusers.d/dbus.conf \
  63. ${nonarch_libdir}/tmpfiles.d/dbus.conf \
  64. "
  65. FILES_${PN}-lib = "${libdir}/lib*.so.*"
  66. RRECOMMENDS_${PN}-lib = "${PN}"
  67. FILES_${PN}-dev += "${libdir}/dbus-1.0/include ${libdir}/cmake/DBus1 ${bindir}/dbus-test-tool"
  68. PACKAGE_WRITE_DEPS += "${@bb.utils.contains('DISTRO_FEATURES','systemd sysvinit','systemd-systemctl-native','',d)}"
  69. pkg_postinst_dbus() {
  70. # If both systemd and sysvinit are enabled, mask the dbus-1 init script
  71. if ${@bb.utils.contains('DISTRO_FEATURES','systemd sysvinit','true','false',d)}; then
  72. if [ -n "$D" ]; then
  73. OPTS="--root=$D"
  74. fi
  75. systemctl $OPTS mask dbus-1.service
  76. fi
  77. if [ -z "$D" ] && [ -e /etc/init.d/populate-volatile.sh ] ; then
  78. /etc/init.d/populate-volatile.sh update
  79. fi
  80. }
  81. EXTRA_OECONF = "--disable-tests \
  82. --disable-xml-docs \
  83. --disable-doxygen-docs \
  84. --disable-libaudit \
  85. --enable-largefile \
  86. "
  87. EXTRA_OECONF_append_class-target = " SYSTEMCTL=${base_bindir}/systemctl"
  88. EXTRA_OECONF_append_class-native = " --disable-selinux"
  89. PACKAGECONFIG ??= "${@bb.utils.filter('DISTRO_FEATURES', 'systemd x11', d)} \
  90. user-session \
  91. "
  92. PACKAGECONFIG_class-native = ""
  93. PACKAGECONFIG_class-nativesdk = ""
  94. PACKAGECONFIG[systemd] = "--enable-systemd --with-systemdsystemunitdir=${systemd_system_unitdir},--disable-systemd --without-systemdsystemunitdir,systemd"
  95. PACKAGECONFIG[x11] = "--with-x --enable-x11-autolaunch,--without-x --disable-x11-autolaunch, virtual/libx11 libsm"
  96. PACKAGECONFIG[user-session] = "--enable-user-session --with-systemduserunitdir=${systemd_user_unitdir},--disable-user-session"
  97. do_install() {
  98. autotools_do_install
  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. fi
  104. if ${@bb.utils.contains('DISTRO_FEATURES', 'systemd', 'true', 'false', d)}; then
  105. for i in dbus.target.wants sockets.target.wants multi-user.target.wants; do \
  106. install -d ${D}${systemd_system_unitdir}/$i; done
  107. install -m 0644 ${B}/bus/dbus.service ${B}/bus/dbus.socket ${D}${systemd_system_unitdir}/
  108. ln -fs ../dbus.socket ${D}${systemd_system_unitdir}/dbus.target.wants/dbus.socket
  109. ln -fs ../dbus.socket ${D}${systemd_system_unitdir}/sockets.target.wants/dbus.socket
  110. ln -fs ../dbus.service ${D}${systemd_system_unitdir}/multi-user.target.wants/dbus.service
  111. fi
  112. install -d ${D}${sysconfdir}/default/volatiles
  113. echo "d messagebus messagebus 0755 ${localstatedir}/run/dbus none" \
  114. > ${D}${sysconfdir}/default/volatiles/99_dbus
  115. mkdir -p ${D}${localstatedir}/lib/dbus
  116. chown messagebus:messagebus ${D}${localstatedir}/lib/dbus
  117. chown root:messagebus ${D}${libexecdir}/dbus-daemon-launch-helper
  118. chmod 4755 ${D}${libexecdir}/dbus-daemon-launch-helper
  119. # Remove Red Hat initscript
  120. rm -rf ${D}${sysconfdir}/rc.d
  121. # Remove empty testexec directory as we don't build tests
  122. rm -rf ${D}${libdir}/dbus-1.0/test
  123. # Remove /var/run as it is created on startup
  124. rm -rf ${D}${localstatedir}/run
  125. }
  126. do_install_class-native() {
  127. autotools_do_install
  128. # dbus-launch has no X support so lets not install it in case the host
  129. # has a more featured and useful version
  130. rm -f ${D}${bindir}/dbus-launch
  131. }
  132. do_install_class-nativesdk() {
  133. autotools_do_install
  134. # dbus-launch has no X support so lets not install it in case the host
  135. # has a more featured and useful version
  136. rm -f ${D}${bindir}/dbus-launch
  137. # Remove /var/run to avoid QA error
  138. rm -rf ${D}${localstatedir}/run
  139. }
  140. BBCLASSEXTEND = "native nativesdk"
  141. INSANE_SKIP_${PN}-ptest += "build-deps"