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