blob: f4fec2365c2e5c7896d8f6a4ce155825c649c741 [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
Brad Bishopf3f93bb2019-10-16 14:33:32 -040095
Brad Bishop19323692019-04-05 15:28:33 -040096EXTRA_OECONF = "--disable-tests \
97 --disable-xml-docs \
98 --disable-doxygen-docs \
99 --disable-libaudit \
100 --enable-largefile \
Brad Bishopf3f93bb2019-10-16 14:33:32 -0400101 --with-system-socket=/run/dbus/system_bus_socket \
Brad Bishop19323692019-04-05 15:28:33 -0400102 "
103
104EXTRA_OECONF_append_class-target = " SYSTEMCTL=${base_bindir}/systemctl"
105EXTRA_OECONF_append_class-native = " --disable-selinux"
106
107PACKAGECONFIG ??= "${@bb.utils.filter('DISTRO_FEATURES', 'systemd x11', d)} \
108 user-session \
109 "
110
111PACKAGECONFIG_class-native = ""
112PACKAGECONFIG_class-nativesdk = ""
113
114PACKAGECONFIG[systemd] = "--enable-systemd --with-systemdsystemunitdir=${systemd_system_unitdir},--disable-systemd --without-systemdsystemunitdir,systemd"
115PACKAGECONFIG[x11] = "--with-x --enable-x11-autolaunch,--without-x --disable-x11-autolaunch, virtual/libx11 libsm"
116PACKAGECONFIG[user-session] = "--enable-user-session --with-systemduserunitdir=${systemd_user_unitdir},--disable-user-session"
117
118do_install() {
119 autotools_do_install
120
121 if ${@bb.utils.contains('DISTRO_FEATURES', 'sysvinit', 'true', 'false', d)}; then
122 install -d ${D}${sysconfdir}/init.d
123 sed 's:@bindir@:${bindir}:' < ${WORKDIR}/dbus-1.init >${WORKDIR}/dbus-1.init.sh
124 install -m 0755 ${WORKDIR}/dbus-1.init.sh ${D}${sysconfdir}/init.d/dbus-1
125 install -d ${D}${sysconfdir}/default/volatiles
126 echo "d messagebus messagebus 0755 ${localstatedir}/run/dbus none" \
127 > ${D}${sysconfdir}/default/volatiles/99_dbus
128 fi
129
130 if ${@bb.utils.contains('DISTRO_FEATURES', 'systemd', 'true', 'false', d)}; then
131 for i in dbus.target.wants sockets.target.wants multi-user.target.wants; do \
132 install -d ${D}${systemd_system_unitdir}/$i; done
133 install -m 0644 ${B}/bus/dbus.service ${B}/bus/dbus.socket ${D}${systemd_system_unitdir}/
134 ln -fs ../dbus.socket ${D}${systemd_system_unitdir}/dbus.target.wants/dbus.socket
135 ln -fs ../dbus.socket ${D}${systemd_system_unitdir}/sockets.target.wants/dbus.socket
136 ln -fs ../dbus.service ${D}${systemd_system_unitdir}/multi-user.target.wants/dbus.service
137 fi
138
139
140 mkdir -p ${D}${localstatedir}/lib/dbus
141
142 chown messagebus:messagebus ${D}${localstatedir}/lib/dbus
143
144 chown root:messagebus ${D}${libexecdir}/dbus-daemon-launch-helper
145 chmod 4755 ${D}${libexecdir}/dbus-daemon-launch-helper
146
147 # Remove Red Hat initscript
148 rm -rf ${D}${sysconfdir}/rc.d
149
150 # Remove empty testexec directory as we don't build tests
151 rm -rf ${D}${libdir}/dbus-1.0/test
152
153 # Remove /var/run as it is created on startup
154 rm -rf ${D}${localstatedir}/run
155}
156
157do_install_class-native() {
158 autotools_do_install
159
160 # dbus-launch has no X support so lets not install it in case the host
161 # has a more featured and useful version
162 rm -f ${D}${bindir}/dbus-launch
163}
164
165do_install_class-nativesdk() {
166 autotools_do_install
167
168 # dbus-launch has no X support so lets not install it in case the host
169 # has a more featured and useful version
170 rm -f ${D}${bindir}/dbus-launch
171
172 # Remove /var/run to avoid QA error
173 rm -rf ${D}${localstatedir}/run
174}
175BBCLASSEXTEND = "native nativesdk"
176
177INSANE_SKIP_${PN}-ptest += "build-deps"