dbus.mk 3.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141
  1. ################################################################################
  2. #
  3. # dbus
  4. #
  5. ################################################################################
  6. # When updating dbus, check if there are changes in session.conf and
  7. # system.conf, and update the versions in the dbus-broker package accordingly.
  8. DBUS_VERSION = 1.14.10
  9. DBUS_SOURCE = dbus-$(DBUS_VERSION).tar.xz
  10. DBUS_SITE = https://dbus.freedesktop.org/releases/dbus
  11. DBUS_LICENSE = AFL-2.1 or GPL-2.0+ (library, tools), GPL-2.0+ (tools)
  12. DBUS_LICENSE_FILES = COPYING
  13. DBUS_CPE_ID_VENDOR = freedesktop
  14. DBUS_INSTALL_STAGING = YES
  15. define DBUS_PERMISSIONS
  16. /usr/libexec/dbus-daemon-launch-helper f 4750 0 dbus - - - - -
  17. endef
  18. define DBUS_USERS
  19. dbus -1 dbus -1 * /run/dbus - dbus DBus messagebus user
  20. endef
  21. DBUS_DEPENDENCIES = host-pkgconf expat
  22. DBUS_SELINUX_MODULES = dbus
  23. DBUS_CONF_OPTS = \
  24. --with-dbus-user=dbus \
  25. --disable-tests \
  26. --disable-asserts \
  27. --disable-xml-docs \
  28. --disable-doxygen-docs \
  29. --with-system-socket=/run/dbus/system_bus_socket \
  30. --with-system-pid-file=/run/messagebus.pid
  31. ifeq ($(BR2_STATIC_LIBS),y)
  32. DBUS_CONF_OPTS += LIBS='-pthread'
  33. endif
  34. ifeq ($(BR2_microblaze),y)
  35. # microblaze toolchain doesn't provide inotify_rm_* but does have sys/inotify.h
  36. DBUS_CONF_OPTS += --disable-inotify
  37. endif
  38. ifeq ($(BR2_PACKAGE_LIBSELINUX),y)
  39. DBUS_CONF_OPTS += --enable-selinux
  40. DBUS_DEPENDENCIES += libselinux
  41. else
  42. DBUS_CONF_OPTS += --disable-selinux
  43. endif
  44. ifeq ($(BR2_PACKAGE_AUDIT)$(BR2_PACKAGE_LIBCAP_NG),yy)
  45. DBUS_CONF_OPTS += --enable-libaudit
  46. DBUS_DEPENDENCIES += audit libcap-ng
  47. else
  48. DBUS_CONF_OPTS += --disable-libaudit
  49. endif
  50. ifeq ($(BR2_PACKAGE_XLIB_LIBX11),y)
  51. DBUS_CONF_OPTS += --with-x
  52. DBUS_DEPENDENCIES += xlib_libX11
  53. ifeq ($(BR2_PACKAGE_XLIB_LIBSM),y)
  54. DBUS_DEPENDENCIES += xlib_libSM
  55. endif
  56. else
  57. DBUS_CONF_OPTS += --without-x
  58. endif
  59. ifeq ($(BR2_INIT_SYSTEMD),y)
  60. DBUS_CONF_OPTS += \
  61. --enable-systemd \
  62. --with-systemdsystemunitdir=/usr/lib/systemd/system
  63. DBUS_DEPENDENCIES += systemd
  64. else
  65. DBUS_CONF_OPTS += --disable-systemd
  66. endif
  67. # fix rebuild (dbus makefile errors out if /var/lib/dbus is a symlink)
  68. define DBUS_REMOVE_VAR_LIB_DBUS
  69. rm -rf $(TARGET_DIR)/var/lib/dbus
  70. endef
  71. DBUS_PRE_INSTALL_TARGET_HOOKS += DBUS_REMOVE_VAR_LIB_DBUS
  72. define DBUS_REMOVE_DEVFILES
  73. rm -rf $(TARGET_DIR)/usr/lib/dbus-1.0
  74. endef
  75. DBUS_POST_INSTALL_TARGET_HOOKS += DBUS_REMOVE_DEVFILES
  76. define DBUS_INSTALL_INIT_SYSV
  77. $(INSTALL) -m 0755 -D package/dbus/S30dbus \
  78. $(TARGET_DIR)/etc/init.d/S30dbus
  79. mkdir -p $(TARGET_DIR)/var/lib
  80. rm -rf $(TARGET_DIR)/var/lib/dbus
  81. ln -sf /tmp/dbus $(TARGET_DIR)/var/lib/dbus
  82. endef
  83. # If dbus-broker is installed, don't install the activation links for
  84. # dbus itself, not the configuration files. They will be overwritten
  85. # by dbus-broker
  86. ifeq ($(BR2_PACKAGE_DBUS_BROKER),y)
  87. define DBUS_REMOVE_SYSTEMD_ACTIVATION_LINKS
  88. rm -f $(TARGET_DIR)/usr/lib/systemd/system/multi-user.target.wants/dbus.service
  89. rm -f $(TARGET_DIR)/usr/lib/systemd/system/sockets.target.wants/dbus.socket
  90. rm -f $(TARGET_DIR)/usr/lib/systemd/system/dbus.socket
  91. rm -f $(TARGET_DIR)/usr/share/dbus-1/session.conf
  92. rm -f $(TARGET_DIR)/usr/share/dbus-1/system.conf
  93. endef
  94. DBUS_POST_INSTALL_TARGET_HOOKS += DBUS_REMOVE_SYSTEMD_ACTIVATION_LINKS
  95. endif
  96. define DBUS_INSTALL_INIT_SYSTEMD
  97. mkdir -p $(TARGET_DIR)/var/lib/dbus
  98. ln -sf /etc/machine-id $(TARGET_DIR)/var/lib/dbus/machine-id
  99. endef
  100. HOST_DBUS_DEPENDENCIES = host-pkgconf host-expat
  101. HOST_DBUS_CONF_OPTS = \
  102. --with-dbus-user=dbus \
  103. --disable-tests \
  104. --disable-asserts \
  105. --disable-selinux \
  106. --disable-xml-docs \
  107. --disable-doxygen-docs \
  108. --disable-systemd \
  109. --without-x
  110. # dbus for the host
  111. DBUS_HOST_INTROSPECT = $(HOST_DBUS_DIR)/introspect.xml
  112. HOST_DBUS_GEN_INTROSPECT = \
  113. $(HOST_DIR)/bin/dbus-daemon --introspect > $(DBUS_HOST_INTROSPECT)
  114. HOST_DBUS_POST_INSTALL_HOOKS += HOST_DBUS_GEN_INTROSPECT
  115. $(eval $(autotools-package))
  116. $(eval $(host-autotools-package))