blob: a508229a34043a93caecfd90243b1ddbde1b7053 [file] [log] [blame]
Patrick Williamsc124f4f2015-09-15 14:41:29 -05001SUMMARY = "Linux Bluetooth Stack Userland V5"
2DESCRIPTION = "Linux Bluetooth stack V5 userland components. These include a system configurations, daemons, tools and system libraries."
3HOMEPAGE = "http://www.bluez.org"
4SECTION = "libs"
5LICENSE = "GPLv2+ & LGPLv2.1+"
6LIC_FILES_CHKSUM = "file://COPYING;md5=12f884d2ae1ff87c09e5b7ccc2c4ca7e \
7 file://COPYING.LIB;md5=fb504b67c50331fc78734fed90fb0e09 \
8 file://src/main.c;beginline=1;endline=24;md5=9bc54b93cd7e17bf03f52513f39f926e"
9DEPENDS = "udev libusb dbus-glib glib-2.0 libcheck readline"
10PROVIDES += "bluez-hcidump"
11RPROVIDES_${PN} += "bluez-hcidump"
12
13RCONFLICTS_${PN} = "bluez4"
14
15PACKAGECONFIG ??= "obex-profiles"
16PACKAGECONFIG[obex-profiles] = "--enable-obex,--disable-obex,libical"
17PACKAGECONFIG[experimental] = "--enable-experimental,--disable-experimental,"
18
19SRC_URI = "\
20 ${KERNELORG_MIRROR}/linux/bluetooth/bluez-${PV}.tar.xz \
Patrick Williamsd8c66bc2016-06-20 12:57:21 -050021 file://init \
22 file://run-ptest \
23 ${@bb.utils.contains('DISTRO_FEATURES', 'systemd', '', 'file://0001-Allow-using-obexd-without-systemd-in-the-user-sessio.patch', d)} \
24 file://0001-tests-add-a-target-for-building-tests-without-runnin.patch \
Patrick Williamsc124f4f2015-09-15 14:41:29 -050025"
26S = "${WORKDIR}/bluez-${PV}"
27
Patrick Williamsd8c66bc2016-06-20 12:57:21 -050028inherit autotools-brokensep pkgconfig systemd update-rc.d distro_features_check ptest
Patrick Williamsc124f4f2015-09-15 14:41:29 -050029
30EXTRA_OECONF = "\
31 --enable-tools \
32 --disable-cups \
33 --enable-test \
34 --enable-datafiles \
35 ${@bb.utils.contains('DISTRO_FEATURES', 'systemd', '--enable-systemd', '--disable-systemd', d)} \
36 --enable-library \
37"
38
39# bluez5 builds a large number of useful utilities but does not
40# install them. Specify which ones we want put into ${PN}-noinst-tools.
41NOINST_TOOLS_READLINE ??= ""
42NOINST_TOOLS_EXPERIMENTAL ??= ""
43NOINST_TOOLS = " \
44 ${NOINST_TOOLS_READLINE} \
45 ${@bb.utils.contains('PACKAGECONFIG', 'experimental', '${NOINST_TOOLS_EXPERIMENTAL}', '', d)} \
46"
47
48do_install_append() {
Patrick Williamsd8c66bc2016-06-20 12:57:21 -050049 install -d ${D}${INIT_D_DIR}
50 install -m 0755 ${WORKDIR}/init ${D}${INIT_D_DIR}/bluetooth
51
Patrick Williamsc124f4f2015-09-15 14:41:29 -050052 install -d ${D}${sysconfdir}/bluetooth/
53 if [ -f ${S}/profiles/audio/audio.conf ]; then
54 install -m 0644 ${S}/profiles/audio/audio.conf ${D}/${sysconfdir}/bluetooth/
55 fi
56 if [ -f ${S}/profiles/network/network.conf ]; then
57 install -m 0644 ${S}/profiles/network/network.conf ${D}/${sysconfdir}/bluetooth/
58 fi
59 if [ -f ${S}/profiles/input/input.conf ]; then
60 install -m 0644 ${S}/profiles/input/input.conf ${D}/${sysconfdir}/bluetooth/
61 fi
Patrick Williamsf1e5d692016-03-30 15:21:19 -050062
Patrick Williamsc124f4f2015-09-15 14:41:29 -050063 # Install desired tools that upstream leaves in build area
64 for f in ${NOINST_TOOLS} ; do
65 install -m 755 ${B}/$f ${D}/${bindir}
66 done
67}
68
69ALLOW_EMPTY_libasound-module-bluez = "1"
70PACKAGES =+ "libasound-module-bluez ${PN}-testtools ${PN}-obex ${PN}-noinst-tools"
71
72FILES_libasound-module-bluez = "${libdir}/alsa-lib/lib*.so ${datadir}/alsa"
73FILES_${PN} += "${libdir}/bluetooth/plugins/*.so ${base_libdir}/udev/ ${nonarch_base_libdir}/udev/ ${systemd_unitdir}/ ${datadir}/dbus-1"
74FILES_${PN}-dev += "\
75 ${libdir}/bluetooth/plugins/*.la \
76 ${libdir}/alsa-lib/*.la \
77"
78
79FILES_${PN}-obex = "${libexecdir}/bluetooth/obexd \
80 ${exec_prefix}/lib/systemd/user/obex.service \
81 ${datadir}/dbus-1/services/org.bluez.obex.service \
82 "
83SYSTEMD_SERVICE_${PN}-obex = "obex.service"
84
85FILES_${PN}-testtools = "${libdir}/bluez/test/*"
86
87def get_noinst_tools_paths (d, bb, tools):
88 s = list()
89 bindir = d.getVar("bindir", True)
90 for bdp in tools.split():
91 f = os.path.basename(bdp)
92 s.append("%s/%s" % (bindir, f))
93 return "\n".join(s)
94
95FILES_${PN}-noinst-tools = "${@get_noinst_tools_paths(d, bb, d.getVar('NOINST_TOOLS', True))}"
96
Patrick Williamsc124f4f2015-09-15 14:41:29 -050097RDEPENDS_${PN}-testtools += "python python-dbus python-pygobject"
98
99SYSTEMD_SERVICE_${PN} = "bluetooth.service"
Patrick Williamsd8c66bc2016-06-20 12:57:21 -0500100INITSCRIPT_PACKAGES = "${PN}"
101INITSCRIPT_NAME_${PN} = "bluetooth"
Patrick Williamsc124f4f2015-09-15 14:41:29 -0500102
103EXCLUDE_FROM_WORLD = "1"
Patrick Williamsd8c66bc2016-06-20 12:57:21 -0500104
105do_compile_ptest() {
106 oe_runmake buildtests
107}
108
109do_install_ptest() {
110 cp -r ${B}/unit/ ${D}${PTEST_PATH}
111 rm ${D}${PTEST_PATH}/unit/*.c ${D}${PTEST_PATH}/unit/*.o
112}