blob: 882873a486e230efbd0014535f7fb21ae23fdd3a [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"
Brad Bishop6e60e8b2018-02-01 10:27:11 -05009DEPENDS = "udev libusb dbus-glib glib-2.0 libcheck"
Patrick Williamsc124f4f2015-09-15 14:41:29 -050010PROVIDES += "bluez-hcidump"
11RPROVIDES_${PN} += "bluez-hcidump"
12
13RCONFLICTS_${PN} = "bluez4"
14
Brad Bishop6e60e8b2018-02-01 10:27:11 -050015PACKAGECONFIG ??= "obex-profiles readline"
Patrick Williamsc124f4f2015-09-15 14:41:29 -050016PACKAGECONFIG[obex-profiles] = "--enable-obex,--disable-obex,libical"
17PACKAGECONFIG[experimental] = "--enable-experimental,--disable-experimental,"
Brad Bishop6e60e8b2018-02-01 10:27:11 -050018PACKAGECONFIG[readline] = "--enable-client,--disable-client,readline,"
Patrick Williamsc124f4f2015-09-15 14:41:29 -050019
20SRC_URI = "\
21 ${KERNELORG_MIRROR}/linux/bluetooth/bluez-${PV}.tar.xz \
Patrick Williamsc0f7c042017-02-23 20:41:17 -060022 file://out-of-tree.patch \
Patrick Williamsd8c66bc2016-06-20 12:57:21 -050023 file://init \
24 file://run-ptest \
25 ${@bb.utils.contains('DISTRO_FEATURES', 'systemd', '', 'file://0001-Allow-using-obexd-without-systemd-in-the-user-sessio.patch', d)} \
26 file://0001-tests-add-a-target-for-building-tests-without-runnin.patch \
Brad Bishop6e60e8b2018-02-01 10:27:11 -050027 file://cve-2017-1000250.patch \
Patrick Williamsc124f4f2015-09-15 14:41:29 -050028"
29S = "${WORKDIR}/bluez-${PV}"
30
Brad Bishop6e60e8b2018-02-01 10:27:11 -050031CVE_PRODUCT = "bluez"
32
Patrick Williamsc0f7c042017-02-23 20:41:17 -060033inherit autotools pkgconfig systemd update-rc.d distro_features_check ptest
Patrick Williamsc124f4f2015-09-15 14:41:29 -050034
35EXTRA_OECONF = "\
36 --enable-tools \
37 --disable-cups \
38 --enable-test \
39 --enable-datafiles \
40 ${@bb.utils.contains('DISTRO_FEATURES', 'systemd', '--enable-systemd', '--disable-systemd', d)} \
41 --enable-library \
42"
43
44# bluez5 builds a large number of useful utilities but does not
45# install them. Specify which ones we want put into ${PN}-noinst-tools.
46NOINST_TOOLS_READLINE ??= ""
47NOINST_TOOLS_EXPERIMENTAL ??= ""
48NOINST_TOOLS = " \
Brad Bishop6e60e8b2018-02-01 10:27:11 -050049 ${@bb.utils.contains('PACKAGECONFIG', 'readline', '${NOINST_TOOLS_READLINE}', '', d)} \
Patrick Williamsc124f4f2015-09-15 14:41:29 -050050 ${@bb.utils.contains('PACKAGECONFIG', 'experimental', '${NOINST_TOOLS_EXPERIMENTAL}', '', d)} \
51"
52
53do_install_append() {
Patrick Williamsd8c66bc2016-06-20 12:57:21 -050054 install -d ${D}${INIT_D_DIR}
55 install -m 0755 ${WORKDIR}/init ${D}${INIT_D_DIR}/bluetooth
56
Patrick Williamsc124f4f2015-09-15 14:41:29 -050057 install -d ${D}${sysconfdir}/bluetooth/
58 if [ -f ${S}/profiles/audio/audio.conf ]; then
59 install -m 0644 ${S}/profiles/audio/audio.conf ${D}/${sysconfdir}/bluetooth/
60 fi
61 if [ -f ${S}/profiles/network/network.conf ]; then
62 install -m 0644 ${S}/profiles/network/network.conf ${D}/${sysconfdir}/bluetooth/
63 fi
64 if [ -f ${S}/profiles/input/input.conf ]; then
65 install -m 0644 ${S}/profiles/input/input.conf ${D}/${sysconfdir}/bluetooth/
66 fi
Patrick Williamsf1e5d692016-03-30 15:21:19 -050067
Patrick Williamsc0f7c042017-02-23 20:41:17 -060068 if [ -f ${D}/${sysconfdir}/init.d/bluetooth ]; then
69 sed -i -e 's#@LIBEXECDIR@#${libexecdir}#g' ${D}/${sysconfdir}/init.d/bluetooth
70 fi
71
Patrick Williamsc124f4f2015-09-15 14:41:29 -050072 # Install desired tools that upstream leaves in build area
73 for f in ${NOINST_TOOLS} ; do
74 install -m 755 ${B}/$f ${D}/${bindir}
75 done
Patrick Williamsc0f7c042017-02-23 20:41:17 -060076
77 # Patch python tools to use Python 3; they should be source compatible, but
78 # still refer to Python 2 in the shebang
79 sed -i -e '1s,#!.*python.*,#!${bindir}/python3,' ${D}${libdir}/bluez/test/*
Patrick Williamsc124f4f2015-09-15 14:41:29 -050080}
81
82ALLOW_EMPTY_libasound-module-bluez = "1"
83PACKAGES =+ "libasound-module-bluez ${PN}-testtools ${PN}-obex ${PN}-noinst-tools"
84
85FILES_libasound-module-bluez = "${libdir}/alsa-lib/lib*.so ${datadir}/alsa"
Patrick Williamsc0f7c042017-02-23 20:41:17 -060086FILES_${PN} += "${libdir}/bluetooth/plugins/*.so ${systemd_unitdir}/ ${datadir}/dbus-1"
Patrick Williamsc124f4f2015-09-15 14:41:29 -050087FILES_${PN}-dev += "\
88 ${libdir}/bluetooth/plugins/*.la \
89 ${libdir}/alsa-lib/*.la \
90"
91
92FILES_${PN}-obex = "${libexecdir}/bluetooth/obexd \
93 ${exec_prefix}/lib/systemd/user/obex.service \
94 ${datadir}/dbus-1/services/org.bluez.obex.service \
95 "
96SYSTEMD_SERVICE_${PN}-obex = "obex.service"
97
98FILES_${PN}-testtools = "${libdir}/bluez/test/*"
99
100def get_noinst_tools_paths (d, bb, tools):
101 s = list()
Brad Bishop6e60e8b2018-02-01 10:27:11 -0500102 bindir = d.getVar("bindir")
Patrick Williamsc124f4f2015-09-15 14:41:29 -0500103 for bdp in tools.split():
104 f = os.path.basename(bdp)
105 s.append("%s/%s" % (bindir, f))
106 return "\n".join(s)
107
Brad Bishop6e60e8b2018-02-01 10:27:11 -0500108FILES_${PN}-noinst-tools = "${@get_noinst_tools_paths(d, bb, d.getVar('NOINST_TOOLS'))}"
Patrick Williamsc124f4f2015-09-15 14:41:29 -0500109
Patrick Williamsc0f7c042017-02-23 20:41:17 -0600110RDEPENDS_${PN}-testtools += "python3 python3-dbus python3-pygobject"
Patrick Williamsc124f4f2015-09-15 14:41:29 -0500111
112SYSTEMD_SERVICE_${PN} = "bluetooth.service"
Patrick Williamsd8c66bc2016-06-20 12:57:21 -0500113INITSCRIPT_PACKAGES = "${PN}"
114INITSCRIPT_NAME_${PN} = "bluetooth"
Patrick Williamsc124f4f2015-09-15 14:41:29 -0500115
116EXCLUDE_FROM_WORLD = "1"
Patrick Williamsd8c66bc2016-06-20 12:57:21 -0500117
118do_compile_ptest() {
119 oe_runmake buildtests
120}
121
122do_install_ptest() {
123 cp -r ${B}/unit/ ${D}${PTEST_PATH}
Patrick Williamsc0f7c042017-02-23 20:41:17 -0600124 rm -f ${D}${PTEST_PATH}/unit/*.o
Patrick Williamsd8c66bc2016-06-20 12:57:21 -0500125}