diff options
Diffstat (limited to 'meta/recipes-core/dbus/dbus.inc')
-rw-r--r-- | meta/recipes-core/dbus/dbus.inc | 148 |
1 files changed, 148 insertions, 0 deletions
diff --git a/meta/recipes-core/dbus/dbus.inc b/meta/recipes-core/dbus/dbus.inc new file mode 100644 index 0000000000..5864643996 --- /dev/null +++ b/meta/recipes-core/dbus/dbus.inc | |||
@@ -0,0 +1,148 @@ | |||
1 | SUMMARY = "D-Bus message bus" | ||
2 | DESCRIPTION = "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." | ||
3 | HOMEPAGE = "http://dbus.freedesktop.org" | ||
4 | SECTION = "base" | ||
5 | LICENSE = "AFL-2 | GPLv2+" | ||
6 | LIC_FILES_CHKSUM = "file://COPYING;md5=10dded3b58148f3f1fd804b26354af3e \ | ||
7 | file://dbus/dbus.h;beginline=6;endline=20;md5=7755c9d7abccd5dbd25a6a974538bb3c" | ||
8 | X11DEPENDS = "virtual/libx11 libsm" | ||
9 | DEPENDS = "expat virtual/libintl ${@base_contains('DISTRO_FEATURES', 'x11', '${X11DEPENDS}', '', d)}" | ||
10 | DEPENDS_class-native = "expat-native virtual/libintl-native" | ||
11 | DEPENDS_class-nativesdk = "nativesdk-expat virtual/nativesdk-libintl" | ||
12 | RDEPENDS_dbus = "${@base_contains('DISTRO_FEATURES', 'ptest', 'dbus-ptest-ptest', '', d)}" | ||
13 | RDEPENDS_class-native = "" | ||
14 | |||
15 | INC_PR = "r6" | ||
16 | |||
17 | SRC_URI = "http://dbus.freedesktop.org/releases/dbus/dbus-${PV}.tar.gz \ | ||
18 | file://tmpdir.patch; \ | ||
19 | file://dbus-1.init \ | ||
20 | file://os-test.patch \ | ||
21 | " | ||
22 | |||
23 | inherit useradd autotools pkgconfig gettext update-rc.d | ||
24 | |||
25 | INITSCRIPT_NAME = "dbus-1" | ||
26 | INITSCRIPT_PARAMS = "start 02 5 3 2 . stop 20 0 1 6 ." | ||
27 | |||
28 | python __anonymous() { | ||
29 | features = d.getVar("DISTRO_FEATURES", True).split() | ||
30 | if "sysvinit" not in features: | ||
31 | d.setVar("INHIBIT_UPDATERCD_BBCLASS", "1") | ||
32 | } | ||
33 | |||
34 | USERADD_PACKAGES = "${PN}" | ||
35 | GROUPADD_PARAM_${PN} = "-r netdev" | ||
36 | USERADD_PARAM_${PN} = "--system --home ${localstatedir}/lib/dbus \ | ||
37 | --no-create-home --shell /bin/false \ | ||
38 | --user-group messagebus" | ||
39 | |||
40 | CONFFILES_${PN} = "${sysconfdir}/dbus-1/system.conf ${sysconfdir}/dbus-1/session.conf" | ||
41 | |||
42 | DEBIANNAME_${PN} = "dbus-1" | ||
43 | |||
44 | PACKAGES =+ "${PN}-lib" | ||
45 | |||
46 | OLDPKGNAME = "dbus-x11" | ||
47 | OLDPKGNAME_class-nativesdk = "" | ||
48 | |||
49 | # for compatibility | ||
50 | RPROVIDES_${PN} = "${OLDPKGNAME}" | ||
51 | RREPLACES_${PN} += "${OLDPKGNAME}" | ||
52 | |||
53 | FILES_${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/" | ||
65 | FILES_${PN}-lib = "${libdir}/lib*.so.*" | ||
66 | RRECOMMENDS_${PN}-lib = "${PN}" | ||
67 | FILES_${PN}-dev += "${libdir}/dbus-1.0/include ${bindir}/dbus-glib-tool" | ||
68 | |||
69 | pkg_postinst_dbus() { | ||
70 | if [ -z "$D" ] && [ -e /etc/init.d/populate-volatile.sh ] ; then | ||
71 | /etc/init.d/populate-volatile.sh update | ||
72 | fi | ||
73 | } | ||
74 | |||
75 | EXTRA_OECONF_X = "${@base_contains('DISTRO_FEATURES', 'x11', '--with-x', '--without-x', d)}" | ||
76 | EXTRA_OECONF_X_class-native = "--without-x --disable-x11-autolaunch" | ||
77 | # TODO: would like to --enable-systemd but that's a circular build-dependency | ||
78 | # between systemd<->dbus | ||
79 | EXTRA_OECONF_SYSTEMD = "${@base_contains('DISTRO_FEATURES', 'systemd', '--with-systemdsystemunitdir=${systemd_unitdir}/system/', '--without-systemdsystemunitdir', d)}" | ||
80 | |||
81 | EXTRA_OECONF = "--disable-tests \ | ||
82 | --disable-checks \ | ||
83 | --disable-xml-docs \ | ||
84 | --disable-doxygen-docs \ | ||
85 | --disable-libaudit \ | ||
86 | --with-xml=expat \ | ||
87 | --disable-systemd \ | ||
88 | ${EXTRA_OECONF_SYSTEMD} \ | ||
89 | ${EXTRA_OECONF_X}" | ||
90 | |||
91 | do_install() { | ||
92 | autotools_do_install | ||
93 | |||
94 | if ${@base_contains('DISTRO_FEATURES', 'sysvinit', 'true', 'false', d)}; then | ||
95 | install -d ${D}${sysconfdir}/init.d | ||
96 | sed 's:@bindir@:${bindir}:' < ${WORKDIR}/dbus-1.init >${WORKDIR}/dbus-1.init.sh | ||
97 | install -m 0755 ${WORKDIR}/dbus-1.init.sh ${D}${sysconfdir}/init.d/dbus-1 | ||
98 | fi | ||
99 | |||
100 | install -d ${D}${sysconfdir}/default/volatiles | ||
101 | echo "d messagebus messagebus 0755 ${localstatedir}/run/dbus none" \ | ||
102 | > ${D}${sysconfdir}/default/volatiles/99_dbus | ||
103 | |||
104 | |||
105 | mkdir -p ${D}${localstatedir}/lib/dbus | ||
106 | |||
107 | chown messagebus:messagebus ${D}${localstatedir}/lib/dbus | ||
108 | |||
109 | chown root:messagebus ${D}${libexecdir}/dbus-daemon-launch-helper | ||
110 | chmod 4755 ${D}${libexecdir}/dbus-daemon-launch-helper | ||
111 | |||
112 | # Remove Red Hat initscript | ||
113 | rm -rf ${D}${sysconfdir}/rc.d | ||
114 | |||
115 | # Remove empty testexec directory as we don't build tests | ||
116 | rm -rf ${D}${libdir}/dbus-1.0/test | ||
117 | |||
118 | # Remove /var/run as it is created on startup | ||
119 | rm -rf ${D}${localstatedir}/run | ||
120 | } | ||
121 | |||
122 | do_install_class-native() { | ||
123 | autotools_do_install | ||
124 | |||
125 | # for dbus-glib-native introspection generation | ||
126 | install -d ${STAGING_DATADIR_NATIVE}/dbus/ | ||
127 | # N.B. is below install actually required? | ||
128 | install -m 0644 bus/session.conf ${STAGING_DATADIR_NATIVE}/dbus/session.conf | ||
129 | |||
130 | # dbus-glib-native and dbus-glib need this xml file | ||
131 | ./bus/dbus-daemon --introspect > ${STAGING_DATADIR_NATIVE}/dbus/dbus-bus-introspect.xml | ||
132 | |||
133 | # dbus-launch has no X support so lets not install it in case the host | ||
134 | # has a more featured and useful version | ||
135 | rm -f ${D}${bindir}/dbus-launch | ||
136 | } | ||
137 | |||
138 | do_install_class-nativesdk() { | ||
139 | autotools_do_install | ||
140 | |||
141 | # dbus-launch has no X support so lets not install it in case the host | ||
142 | # has a more featured and useful version | ||
143 | rm -f ${D}${bindir}/dbus-launch | ||
144 | |||
145 | # Remove /var/run to avoid QA error | ||
146 | rm -rf ${D}${localstatedir}/run | ||
147 | } | ||
148 | BBCLASSEXTEND = "native nativesdk" | ||