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