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