blob: 05716608b0a01a2a156df33ae38896224bc86715 [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}"
35GROUPADD_PARAM_${PN} = "-r netdev"
36USERADD_PARAM_${PN} = "--system --home ${localstatedir}/lib/dbus \
37 --no-create-home --shell /bin/false \
38 --user-group messagebus"
39
40CONFFILES_${PN} = "${sysconfdir}/dbus-1/system.conf ${sysconfdir}/dbus-1/session.conf"
41
42DEBIANNAME_${PN} = "dbus-1"
43
44PACKAGES =+ "${PN}-lib"
45
46OLDPKGNAME = "dbus-x11"
47OLDPKGNAME_class-nativesdk = ""
48
49# for compatibility
50RPROVIDES_${PN} = "${OLDPKGNAME}"
51RREPLACES_${PN} += "${OLDPKGNAME}"
52
53FILES_${PN} = "${bindir}/dbus-daemon* \
54 ${bindir}/dbus-uuidgen \
55 ${bindir}/dbus-cleanup-sockets \
56 ${bindir}/dbus-send \
57 ${bindir}/dbus-monitor \
58 ${bindir}/dbus-launch \
59 ${bindir}/dbus-run-session \
60 ${bindir}/dbus-update-activation-environment \
61 ${libexecdir}/dbus* \
62 ${sysconfdir} \
63 ${localstatedir} \
64 ${datadir}/dbus-1/services \
65 ${datadir}/dbus-1/system-services \
66 ${datadir}/dbus-1/session.d \
67 ${datadir}/dbus-1/session.conf \
68 ${datadir}/dbus-1/system.d \
69 ${datadir}/dbus-1/system.conf \
70 ${datadir}/xml/dbus-1 \
71 ${systemd_system_unitdir} \
72 ${systemd_user_unitdir} \
73 ${nonarch_libdir}/sysusers.d/dbus.conf \
74 ${nonarch_libdir}/tmpfiles.d/dbus.conf \
75"
76FILES_${PN}-lib = "${libdir}/lib*.so.*"
77RRECOMMENDS_${PN}-lib = "${PN}"
78FILES_${PN}-dev += "${libdir}/dbus-1.0/include ${libdir}/cmake/DBus1 ${bindir}/dbus-test-tool"
79
80PACKAGE_WRITE_DEPS += "${@bb.utils.contains('DISTRO_FEATURES','systemd sysvinit','systemd-systemctl-native','',d)}"
81pkg_postinst_dbus() {
82 # If both systemd and sysvinit are enabled, mask the dbus-1 init script
83 if ${@bb.utils.contains('DISTRO_FEATURES','systemd sysvinit','true','false',d)}; then
84 if [ -n "$D" ]; then
85 OPTS="--root=$D"
86 fi
87 systemctl $OPTS mask dbus-1.service
88 fi
89
90 if [ -z "$D" ] && [ -e /etc/init.d/populate-volatile.sh ] ; then
91 /etc/init.d/populate-volatile.sh update
92 fi
93}
94
95EXTRA_OECONF = "--disable-tests \
96 --disable-xml-docs \
97 --disable-doxygen-docs \
98 --disable-libaudit \
99 --enable-largefile \
100 "
101
102EXTRA_OECONF_append_class-target = " SYSTEMCTL=${base_bindir}/systemctl"
103EXTRA_OECONF_append_class-native = " --disable-selinux"
104
105PACKAGECONFIG ??= "${@bb.utils.filter('DISTRO_FEATURES', 'systemd x11', d)} \
106 user-session \
107 "
108
109PACKAGECONFIG_class-native = ""
110PACKAGECONFIG_class-nativesdk = ""
111
112PACKAGECONFIG[systemd] = "--enable-systemd --with-systemdsystemunitdir=${systemd_system_unitdir},--disable-systemd --without-systemdsystemunitdir,systemd"
113PACKAGECONFIG[x11] = "--with-x --enable-x11-autolaunch,--without-x --disable-x11-autolaunch, virtual/libx11 libsm"
114PACKAGECONFIG[user-session] = "--enable-user-session --with-systemduserunitdir=${systemd_user_unitdir},--disable-user-session"
115
116do_install() {
117 autotools_do_install
118
119 if ${@bb.utils.contains('DISTRO_FEATURES', 'sysvinit', 'true', 'false', d)}; then
120 install -d ${D}${sysconfdir}/init.d
121 sed 's:@bindir@:${bindir}:' < ${WORKDIR}/dbus-1.init >${WORKDIR}/dbus-1.init.sh
122 install -m 0755 ${WORKDIR}/dbus-1.init.sh ${D}${sysconfdir}/init.d/dbus-1
123 install -d ${D}${sysconfdir}/default/volatiles
124 echo "d messagebus messagebus 0755 ${localstatedir}/run/dbus none" \
125 > ${D}${sysconfdir}/default/volatiles/99_dbus
126 fi
127
128 if ${@bb.utils.contains('DISTRO_FEATURES', 'systemd', 'true', 'false', d)}; then
129 for i in dbus.target.wants sockets.target.wants multi-user.target.wants; do \
130 install -d ${D}${systemd_system_unitdir}/$i; done
131 install -m 0644 ${B}/bus/dbus.service ${B}/bus/dbus.socket ${D}${systemd_system_unitdir}/
132 ln -fs ../dbus.socket ${D}${systemd_system_unitdir}/dbus.target.wants/dbus.socket
133 ln -fs ../dbus.socket ${D}${systemd_system_unitdir}/sockets.target.wants/dbus.socket
134 ln -fs ../dbus.service ${D}${systemd_system_unitdir}/multi-user.target.wants/dbus.service
135 fi
136
137
138 mkdir -p ${D}${localstatedir}/lib/dbus
139
140 chown messagebus:messagebus ${D}${localstatedir}/lib/dbus
141
142 chown root:messagebus ${D}${libexecdir}/dbus-daemon-launch-helper
143 chmod 4755 ${D}${libexecdir}/dbus-daemon-launch-helper
144
145 # Remove Red Hat initscript
146 rm -rf ${D}${sysconfdir}/rc.d
147
148 # Remove empty testexec directory as we don't build tests
149 rm -rf ${D}${libdir}/dbus-1.0/test
150
151 # Remove /var/run as it is created on startup
152 rm -rf ${D}${localstatedir}/run
153}
154
155do_install_class-native() {
156 autotools_do_install
157
158 # dbus-launch has no X support so lets not install it in case the host
159 # has a more featured and useful version
160 rm -f ${D}${bindir}/dbus-launch
161}
162
163do_install_class-nativesdk() {
164 autotools_do_install
165
166 # dbus-launch has no X support so lets not install it in case the host
167 # has a more featured and useful version
168 rm -f ${D}${bindir}/dbus-launch
169
170 # Remove /var/run to avoid QA error
171 rm -rf ${D}${localstatedir}/run
172}
173BBCLASSEXTEND = "native nativesdk"
174
175INSANE_SKIP_${PN}-ptest += "build-deps"