diff options
Diffstat (limited to 'meta/recipes-core/dbus/dbus_1.12.22.bb')
-rw-r--r-- | meta/recipes-core/dbus/dbus_1.12.22.bb | 153 |
1 files changed, 153 insertions, 0 deletions
diff --git a/meta/recipes-core/dbus/dbus_1.12.22.bb b/meta/recipes-core/dbus/dbus_1.12.22.bb new file mode 100644 index 0000000000..48947209d9 --- /dev/null +++ b/meta/recipes-core/dbus/dbus_1.12.22.bb | |||
@@ -0,0 +1,153 @@ | |||
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 = "https://dbus.freedesktop.org" | ||
4 | SECTION = "base" | ||
5 | |||
6 | require dbus.inc | ||
7 | |||
8 | DEPENDS = "expat virtual/libintl autoconf-archive" | ||
9 | PACKAGES += "${@bb.utils.contains('DISTRO_FEATURES', 'ptest', '${PN}-ptest', '', d)}" | ||
10 | ALLOW_EMPTY:dbus-ptest = "1" | ||
11 | RDEPENDS:dbus-ptest:class-target = "dbus-test-ptest" | ||
12 | RDEPENDS:${PN} += "${PN}-common ${PN}-tools" | ||
13 | RDEPENDS:${PN}:class-native = "" | ||
14 | |||
15 | inherit useradd update-rc.d | ||
16 | |||
17 | INITSCRIPT_NAME = "dbus-1" | ||
18 | INITSCRIPT_PARAMS = "start 02 5 3 2 . stop 20 0 1 6 ." | ||
19 | |||
20 | python __anonymous() { | ||
21 | if not bb.utils.contains('DISTRO_FEATURES', 'sysvinit', True, False, d): | ||
22 | d.setVar("INHIBIT_UPDATERCD_BBCLASS", "1") | ||
23 | } | ||
24 | |||
25 | PACKAGES =+ "${PN}-lib ${PN}-common ${PN}-tools" | ||
26 | |||
27 | USERADD_PACKAGES = "dbus-common" | ||
28 | USERADD_PARAM:dbus-common = "--system --home ${localstatedir}/lib/dbus \ | ||
29 | --no-create-home --shell /bin/false \ | ||
30 | --user-group messagebus" | ||
31 | |||
32 | CONFFILES:${PN} = "${sysconfdir}/dbus-1/system.conf ${sysconfdir}/dbus-1/session.conf" | ||
33 | |||
34 | DEBIANNAME:${PN} = "dbus-1" | ||
35 | |||
36 | OLDPKGNAME = "dbus-x11" | ||
37 | OLDPKGNAME:class-nativesdk = "" | ||
38 | |||
39 | # for compatibility | ||
40 | RPROVIDES:${PN} = "${OLDPKGNAME}" | ||
41 | RREPLACES:${PN} += "${OLDPKGNAME}" | ||
42 | |||
43 | FILES:${PN} = "${bindir}/dbus-daemon* \ | ||
44 | ${bindir}/dbus-cleanup-sockets \ | ||
45 | ${bindir}/dbus-launch \ | ||
46 | ${bindir}/dbus-run-session \ | ||
47 | ${libexecdir}/dbus* \ | ||
48 | ${sysconfdir} \ | ||
49 | ${localstatedir} \ | ||
50 | ${systemd_system_unitdir} \ | ||
51 | ${systemd_user_unitdir} \ | ||
52 | ${nonarch_libdir}/tmpfiles.d/dbus.conf \ | ||
53 | " | ||
54 | FILES:${PN}-common = "${sysconfdir}/dbus-1 \ | ||
55 | ${datadir}/dbus-1/services \ | ||
56 | ${datadir}/dbus-1/system-services \ | ||
57 | ${datadir}/dbus-1/session.d \ | ||
58 | ${datadir}/dbus-1/session.conf \ | ||
59 | ${datadir}/dbus-1/system.d \ | ||
60 | ${datadir}/dbus-1/system.conf \ | ||
61 | ${systemd_system_unitdir}/dbus.socket \ | ||
62 | ${systemd_system_unitdir}/sockets.target.wants \ | ||
63 | ${systemd_user_unitdir}/dbus.socket \ | ||
64 | ${systemd_user_unitdir}/sockets.target.wants \ | ||
65 | ${nonarch_libdir}/sysusers.d/dbus.conf \ | ||
66 | " | ||
67 | FILES:${PN}-tools = "${bindir}/dbus-uuidgen \ | ||
68 | ${bindir}/dbus-send \ | ||
69 | ${bindir}/dbus-monitor \ | ||
70 | ${bindir}/dbus-update-activation-environment \ | ||
71 | " | ||
72 | FILES:${PN}-lib = "${libdir}/lib*.so.*" | ||
73 | RRECOMMENDS:${PN}-lib = "${PN}" | ||
74 | FILES:${PN}-dev += "${libdir}/dbus-1.0/include ${bindir}/dbus-test-tool ${datadir}/xml/dbus-1" | ||
75 | |||
76 | PACKAGE_WRITE_DEPS += "${@bb.utils.contains('DISTRO_FEATURES','systemd sysvinit','systemd-systemctl-native','',d)}" | ||
77 | pkg_postinst:dbus() { | ||
78 | # If both systemd and sysvinit are enabled, mask the dbus-1 init script | ||
79 | if ${@bb.utils.contains('DISTRO_FEATURES','systemd sysvinit','true','false',d)}; then | ||
80 | if [ -n "$D" ]; then | ||
81 | OPTS="--root=$D" | ||
82 | fi | ||
83 | systemctl $OPTS mask dbus-1.service | ||
84 | fi | ||
85 | |||
86 | if [ -z "$D" ] && [ -e /etc/init.d/populate-volatile.sh ] ; then | ||
87 | /etc/init.d/populate-volatile.sh update | ||
88 | fi | ||
89 | } | ||
90 | |||
91 | |||
92 | EXTRA_OECONF += "--disable-tests" | ||
93 | |||
94 | do_install() { | ||
95 | autotools_do_install | ||
96 | |||
97 | if ${@bb.utils.contains('DISTRO_FEATURES', 'sysvinit', 'true', 'false', d)}; then | ||
98 | install -d ${D}${sysconfdir}/init.d | ||
99 | sed 's:@bindir@:${bindir}:' < ${WORKDIR}/dbus-1.init >${WORKDIR}/dbus-1.init.sh | ||
100 | install -m 0755 ${WORKDIR}/dbus-1.init.sh ${D}${sysconfdir}/init.d/dbus-1 | ||
101 | install -d ${D}${sysconfdir}/default/volatiles | ||
102 | echo "d messagebus messagebus 0755 ${localstatedir}/run/dbus none" \ | ||
103 | > ${D}${sysconfdir}/default/volatiles/99_dbus | ||
104 | fi | ||
105 | |||
106 | if ${@bb.utils.contains('DISTRO_FEATURES', 'systemd', 'true', 'false', d)}; then | ||
107 | for i in dbus.target.wants sockets.target.wants multi-user.target.wants; do \ | ||
108 | install -d ${D}${systemd_system_unitdir}/$i; done | ||
109 | install -m 0644 ${B}/bus/dbus.service ${B}/bus/dbus.socket ${D}${systemd_system_unitdir}/ | ||
110 | ln -fs ../dbus.socket ${D}${systemd_system_unitdir}/dbus.target.wants/dbus.socket | ||
111 | ln -fs ../dbus.socket ${D}${systemd_system_unitdir}/sockets.target.wants/dbus.socket | ||
112 | ln -fs ../dbus.service ${D}${systemd_system_unitdir}/multi-user.target.wants/dbus.service | ||
113 | fi | ||
114 | |||
115 | |||
116 | mkdir -p ${D}${localstatedir}/lib/dbus | ||
117 | |||
118 | chown messagebus:messagebus ${D}${localstatedir}/lib/dbus | ||
119 | |||
120 | chown root:messagebus ${D}${libexecdir}/dbus-daemon-launch-helper | ||
121 | chmod 4755 ${D}${libexecdir}/dbus-daemon-launch-helper | ||
122 | |||
123 | # Remove Red Hat initscript | ||
124 | rm -rf ${D}${sysconfdir}/rc.d | ||
125 | |||
126 | # Remove empty testexec directory as we don't build tests | ||
127 | rm -rf ${D}${libdir}/dbus-1.0/test | ||
128 | |||
129 | # Remove /var/run as it is created on startup | ||
130 | rm -rf ${D}${localstatedir}/run | ||
131 | } | ||
132 | |||
133 | do_install:class-native() { | ||
134 | autotools_do_install | ||
135 | |||
136 | # dbus-launch has no X support so lets not install it in case the host | ||
137 | # has a more featured and useful version | ||
138 | rm -f ${D}${bindir}/dbus-launch | ||
139 | } | ||
140 | |||
141 | do_install:class-nativesdk() { | ||
142 | autotools_do_install | ||
143 | |||
144 | # dbus-launch has no X support so lets not install it in case the host | ||
145 | # has a more featured and useful version | ||
146 | rm -f ${D}${bindir}/dbus-launch | ||
147 | |||
148 | # Remove /var/run to avoid QA error | ||
149 | rm -rf ${D}${localstatedir}/run | ||
150 | } | ||
151 | BBCLASSEXTEND = "native nativesdk" | ||
152 | |||
153 | INSANE_SKIP:${PN}-ptest += "build-deps" | ||