fb8656ec0a241982f34e3795799b6d233098ff95
[vuplus_openembedded] / recipes / dbus / dbus.inc
1 DESCRIPTION = "A message bus system for inter-process communication"
2 HOMEPAGE = "http://dbus.freedesktop.org"
3 SECTION = "base"
4 LICENSE = "GPL"
5 DEPENDS = "expat glib-2.0 virtual/libintl libsm libice virtual/libx11"
6 DEPENDS_opendreambox = "expat glib-2.0 virtual/libintl"
7
8 INC_PR = "r19"
9
10 SRC_URI = "\
11   http://dbus.freedesktop.org/releases/dbus/dbus-${PV}.tar.gz \
12   file://cross.patch;patch=1 \
13   file://tmpdir.patch;patch=1 \
14   file://fix-install-daemon.patch;patch=1 \
15   file://0001-Make-the-default-DBus-reply-timeout-configurable.patch;patch=1 \
16   file://dbus-1.init \
17 "
18
19 S = "${WORKDIR}/dbus-${PV}"
20
21 inherit autotools pkgconfig update-rc.d gettext
22
23 EXTRA_OECONF_X = "--with-x"
24 EXTRA_OECONF_X_opendreambox = ""
25
26 EXTRA_OECONF = "\
27   --disable-qt \
28   --disable-qt3 \
29   --disable-gtk \
30   --disable-tests \
31   --disable-checks \
32   --disable-xml-docs \
33   --disable-doxygen-docs \
34   --disable-libaudit \
35   --with-xml=expat \
36   --with-dbus-default-reply-timeout=200000 \
37   ${EXTRA_OECONF_X} \
38 "
39
40 do_configure_prepend_mipsel() {
41         #this fixes error like "cannot make stub section: File format not recognized" with gcc 4.4.3
42         sed -i -e 's/-Wl,--gc-sections/--gc-sections/' configure.in
43 }
44
45 do_compile_prepend_mipsel() {
46         sed -i -e 's/\-fPIE//' -e 's/\-pie\ \-Wl\,\-z\,relro//' bus/Makefile
47 }
48
49 do_install_append() {
50         install -d ${D}${sysconfdir}/init.d
51         install -m 0755 ${WORKDIR}/dbus-1.init ${D}${sysconfdir}/init.d/dbus-1
52         # the stock install seems to install the libtool wrapper script, so we have to copy this manually :M:
53         if [ -e bus/.libs/dbus-daemon-launch-helper ]; then
54                 install -d  ${D}${libexecdir}/
55                 install -m 0755 bus/.libs/dbus-daemon-launch-helper ${D}${libexecdir}/
56         fi
57 }
58 do_stage() {
59         oe_libinstall -so -C dbus libdbus-1 ${STAGING_LIBDIR}
60         autotools_stage_includes
61         mkdir -p ${STAGING_LIBDIR}/dbus-1.0/include/dbus/
62         install -m 0644 dbus/dbus-arch-deps.h ${STAGING_LIBDIR}/dbus-1.0/include/dbus/
63 }
64
65 RDEPENDS_${PN}-x11 = "${PN}"
66 RRECOMMENDS_${PN}-lib = "${PN}"
67 RCONFLICTS_${PN} = "dbus-1"
68 RREPLACES_${PN} = "dbus-1"
69 RPROVIDES_${PN} = "dbus-1"
70
71 PACKAGES =+ "${PN}-lib ${PN}-x11"
72
73 FILES_${PN} = "\
74 ${bindir}/dbus-daemon* \
75 ${bindir}/dbus-uuidgen \
76 ${bindir}/dbus-cleanup-sockets \
77 ${bindir}/dbus-send \
78 ${bindir}/dbus-monitor \
79 ${libexecdir}/dbus* \
80 ${sysconfdir} \
81 ${datadir}/dbus-1/services \
82 ${datadir}/dbus-1/system-services \
83 "
84 FILES_${PN}-lib = "${libdir}/lib*.so.*"
85 FILES_${PN}-x11 = "\
86 ${bindir}/dbus-launch \
87 "
88 FILES_${PN}-dev += "${libdir}/dbus-1.0/include ${bindir}/dbus-glib-tool ${libdir}/"
89
90 pkg_postinst_${PN}() {
91 #!/bin/sh
92 # can't do adduser stuff offline
93 if [ "x$D" != "x" ]; then
94   exit 1
95 fi
96 MESSAGEUSER=messagebus
97 MESSAGEHOME=/var/run/dbus
98 mkdir -p $MESSAGEHOME || true
99 grep -q ^$MESSAGEUSER: /etc/group || addgroup "$MESSAGEUSER"
100 chgrp "$MESSAGEUSER" "$MESSAGEHOME"
101 grep -q ^$MESSAGEUSER: /etc/passwd || adduser --system --home "$MESSAGEHOME" --no-create-home --disabled-password --ingroup "$MESSAGEUSER" "$MESSAGEUSER"
102 chown "$MESSAGEUSER"."$MESSAGEUSER" "$MESSAGEHOME"
103 grep -q netdev: /etc/group || addgroup netdev
104 chmod u+s /usr/libexec/dbus-daemon-launch-helper
105 }
106
107 CONFFILES_${PN} = "${sysconfdir}/dbus-1/system.conf ${sysconfdir}/dbus-1/session.conf"
108
109 INITSCRIPT_NAME = "dbus-1"
110 INITSCRIPT_PARAMS = "start 02 5 2 . stop 20 0 1 6 ."
111 INITSCRIPT_PARAMS_opendreambox = "start 02 5 2 3 . stop 20 0 1 6 ."