summaryrefslogtreecommitdiffstats
path: root/meta/recipes-core/dbus/dbus.inc
diff options
context:
space:
mode:
Diffstat (limited to 'meta/recipes-core/dbus/dbus.inc')
-rw-r--r--meta/recipes-core/dbus/dbus.inc157
1 files changed, 157 insertions, 0 deletions
diff --git a/meta/recipes-core/dbus/dbus.inc b/meta/recipes-core/dbus/dbus.inc
new file mode 100644
index 0000000..035221f
--- /dev/null
+++ b/meta/recipes-core/dbus/dbus.inc
@@ -0,0 +1,157 @@
1SUMMARY = "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('PTEST_ENABLED', '1', 'dbus-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://Set-correct-address-when-using-address-systemd.patch \
21 file://fixed-memory-freeing-if-error-during-listing-service.patch \
22"
23
24inherit useradd autotools pkgconfig gettext update-rc.d
25
26INITSCRIPT_NAME = "dbus-1"
27INITSCRIPT_PARAMS = "start 02 5 3 2 . stop 20 0 1 6 ."
28
29python __anonymous() {
30 if not oe.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 ${libexecdir}/dbus* \
60 ${sysconfdir} \
61 ${localstatedir} \
62 ${datadir}/dbus-1/services \
63 ${datadir}/dbus-1/system-services \
64 ${systemd_unitdir}/system/"
65FILES_${PN}-lib = "${libdir}/lib*.so.*"
66RRECOMMENDS_${PN}-lib = "${PN}"
67FILES_${PN}-dev += "${libdir}/dbus-1.0/include ${bindir}/dbus-glib-tool"
68
69pkg_postinst_dbus() {
70 # If both systemd and sysvinit are enabled, mask the dbus-1 init script
71 if ${@base_contains('DISTRO_FEATURES','systemd sysvinit','true','false',d)}; then
72 if [ -n "$D" ]; then
73 OPTS="--root=$D"
74 fi
75 systemctl $OPTS mask dbus-1.service
76 fi
77
78 if [ -z "$D" ] && [ -e /etc/init.d/populate-volatile.sh ] ; then
79 /etc/init.d/populate-volatile.sh update
80 fi
81}
82
83EXTRA_OECONF = "--disable-tests \
84 --disable-xml-docs \
85 --disable-doxygen-docs \
86 --disable-libaudit \
87 --with-xml=expat \
88 --disable-systemd"
89
90PACKAGECONFIG ??= "${@base_contains('DISTRO_FEATURES', 'systemd', 'systemd', '', d)} \
91 ${@base_contains('DISTRO_FEATURES', 'x11', 'x11', '', d)}"
92PACKAGECONFIG_class-native = ""
93PACKAGECONFIG_class-nativesdk = ""
94
95# Would like to --enable-systemd but that's a circular build-dependency between
96# systemd<->dbus
97PACKAGECONFIG[systemd] = "--with-systemdsystemunitdir=${systemd_unitdir}/system/,--without-systemdsystemunitdir"
98PACKAGECONFIG[x11] = "--with-x --enable-x11-autolaunch,--without-x --disable-x11-autolaunch, virtual/libx11 libsm"
99
100do_install() {
101 autotools_do_install
102
103 if ${@base_contains('DISTRO_FEATURES', 'sysvinit', 'true', 'false', d)}; then
104 install -d ${D}${sysconfdir}/init.d
105 sed 's:@bindir@:${bindir}:' < ${WORKDIR}/dbus-1.init >${WORKDIR}/dbus-1.init.sh
106 install -m 0755 ${WORKDIR}/dbus-1.init.sh ${D}${sysconfdir}/init.d/dbus-1
107 fi
108
109 install -d ${D}${sysconfdir}/default/volatiles
110 echo "d messagebus messagebus 0755 ${localstatedir}/run/dbus none" \
111 > ${D}${sysconfdir}/default/volatiles/99_dbus
112
113
114 mkdir -p ${D}${localstatedir}/lib/dbus
115
116 chown messagebus:messagebus ${D}${localstatedir}/lib/dbus
117
118 chown root:messagebus ${D}${libexecdir}/dbus-daemon-launch-helper
119 chmod 4755 ${D}${libexecdir}/dbus-daemon-launch-helper
120
121 # Remove Red Hat initscript
122 rm -rf ${D}${sysconfdir}/rc.d
123
124 # Remove empty testexec directory as we don't build tests
125 rm -rf ${D}${libdir}/dbus-1.0/test
126
127 # Remove /var/run as it is created on startup
128 rm -rf ${D}${localstatedir}/run
129}
130
131do_install_class-native() {
132 autotools_do_install
133
134 # for dbus-glib-native introspection generation
135 install -d ${STAGING_DATADIR_NATIVE}/dbus/
136 # N.B. is below install actually required?
137 install -m 0644 bus/session.conf ${STAGING_DATADIR_NATIVE}/dbus/session.conf
138
139 # dbus-glib-native and dbus-glib need this xml file
140 ./bus/dbus-daemon --introspect > ${STAGING_DATADIR_NATIVE}/dbus/dbus-bus-introspect.xml
141
142 # dbus-launch has no X support so lets not install it in case the host
143 # has a more featured and useful version
144 rm -f ${D}${bindir}/dbus-launch
145}
146
147do_install_class-nativesdk() {
148 autotools_do_install
149
150 # dbus-launch has no X support so lets not install it in case the host
151 # has a more featured and useful version
152 rm -f ${D}${bindir}/dbus-launch
153
154 # Remove /var/run to avoid QA error
155 rm -rf ${D}${localstatedir}/run
156}
157BBCLASSEXTEND = "native nativesdk"