Patrick Williams | c124f4f | 2015-09-15 14:41:29 -0500 | [diff] [blame] | 1 | SUMMARY = "Linux Bluetooth Stack Userland V5" |
| 2 | DESCRIPTION = "Linux Bluetooth stack V5 userland components. These include a system configurations, daemons, tools and system libraries." |
| 3 | HOMEPAGE = "http://www.bluez.org" |
| 4 | SECTION = "libs" |
| 5 | LICENSE = "GPLv2+ & LGPLv2.1+" |
| 6 | LIC_FILES_CHKSUM = "file://COPYING;md5=12f884d2ae1ff87c09e5b7ccc2c4ca7e \ |
| 7 | file://COPYING.LIB;md5=fb504b67c50331fc78734fed90fb0e09 \ |
| 8 | file://src/main.c;beginline=1;endline=24;md5=9bc54b93cd7e17bf03f52513f39f926e" |
Brad Bishop | 6e60e8b | 2018-02-01 10:27:11 -0500 | [diff] [blame] | 9 | DEPENDS = "udev libusb dbus-glib glib-2.0 libcheck" |
Patrick Williams | c124f4f | 2015-09-15 14:41:29 -0500 | [diff] [blame] | 10 | PROVIDES += "bluez-hcidump" |
| 11 | RPROVIDES_${PN} += "bluez-hcidump" |
| 12 | |
| 13 | RCONFLICTS_${PN} = "bluez4" |
| 14 | |
Brad Bishop | 6e60e8b | 2018-02-01 10:27:11 -0500 | [diff] [blame] | 15 | PACKAGECONFIG ??= "obex-profiles readline" |
Patrick Williams | c124f4f | 2015-09-15 14:41:29 -0500 | [diff] [blame] | 16 | PACKAGECONFIG[obex-profiles] = "--enable-obex,--disable-obex,libical" |
| 17 | PACKAGECONFIG[experimental] = "--enable-experimental,--disable-experimental," |
Brad Bishop | 6e60e8b | 2018-02-01 10:27:11 -0500 | [diff] [blame] | 18 | PACKAGECONFIG[readline] = "--enable-client,--disable-client,readline," |
Patrick Williams | c124f4f | 2015-09-15 14:41:29 -0500 | [diff] [blame] | 19 | |
| 20 | SRC_URI = "\ |
| 21 | ${KERNELORG_MIRROR}/linux/bluetooth/bluez-${PV}.tar.xz \ |
Patrick Williams | c0f7c04 | 2017-02-23 20:41:17 -0600 | [diff] [blame] | 22 | file://out-of-tree.patch \ |
Patrick Williams | d8c66bc | 2016-06-20 12:57:21 -0500 | [diff] [blame] | 23 | 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 Bishop | 6e60e8b | 2018-02-01 10:27:11 -0500 | [diff] [blame] | 27 | file://cve-2017-1000250.patch \ |
Patrick Williams | c124f4f | 2015-09-15 14:41:29 -0500 | [diff] [blame] | 28 | " |
| 29 | S = "${WORKDIR}/bluez-${PV}" |
| 30 | |
Brad Bishop | 6e60e8b | 2018-02-01 10:27:11 -0500 | [diff] [blame] | 31 | CVE_PRODUCT = "bluez" |
| 32 | |
Patrick Williams | c0f7c04 | 2017-02-23 20:41:17 -0600 | [diff] [blame] | 33 | inherit autotools pkgconfig systemd update-rc.d distro_features_check ptest |
Patrick Williams | c124f4f | 2015-09-15 14:41:29 -0500 | [diff] [blame] | 34 | |
| 35 | EXTRA_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. |
| 46 | NOINST_TOOLS_READLINE ??= "" |
| 47 | NOINST_TOOLS_EXPERIMENTAL ??= "" |
| 48 | NOINST_TOOLS = " \ |
Brad Bishop | 6e60e8b | 2018-02-01 10:27:11 -0500 | [diff] [blame] | 49 | ${@bb.utils.contains('PACKAGECONFIG', 'readline', '${NOINST_TOOLS_READLINE}', '', d)} \ |
Patrick Williams | c124f4f | 2015-09-15 14:41:29 -0500 | [diff] [blame] | 50 | ${@bb.utils.contains('PACKAGECONFIG', 'experimental', '${NOINST_TOOLS_EXPERIMENTAL}', '', d)} \ |
| 51 | " |
| 52 | |
| 53 | do_install_append() { |
Patrick Williams | d8c66bc | 2016-06-20 12:57:21 -0500 | [diff] [blame] | 54 | install -d ${D}${INIT_D_DIR} |
| 55 | install -m 0755 ${WORKDIR}/init ${D}${INIT_D_DIR}/bluetooth |
| 56 | |
Patrick Williams | c124f4f | 2015-09-15 14:41:29 -0500 | [diff] [blame] | 57 | 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 Williams | f1e5d69 | 2016-03-30 15:21:19 -0500 | [diff] [blame] | 67 | |
Patrick Williams | c0f7c04 | 2017-02-23 20:41:17 -0600 | [diff] [blame] | 68 | 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 Williams | c124f4f | 2015-09-15 14:41:29 -0500 | [diff] [blame] | 72 | # 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 Williams | c0f7c04 | 2017-02-23 20:41:17 -0600 | [diff] [blame] | 76 | |
| 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 Williams | c124f4f | 2015-09-15 14:41:29 -0500 | [diff] [blame] | 80 | } |
| 81 | |
| 82 | ALLOW_EMPTY_libasound-module-bluez = "1" |
| 83 | PACKAGES =+ "libasound-module-bluez ${PN}-testtools ${PN}-obex ${PN}-noinst-tools" |
| 84 | |
| 85 | FILES_libasound-module-bluez = "${libdir}/alsa-lib/lib*.so ${datadir}/alsa" |
Patrick Williams | c0f7c04 | 2017-02-23 20:41:17 -0600 | [diff] [blame] | 86 | FILES_${PN} += "${libdir}/bluetooth/plugins/*.so ${systemd_unitdir}/ ${datadir}/dbus-1" |
Patrick Williams | c124f4f | 2015-09-15 14:41:29 -0500 | [diff] [blame] | 87 | FILES_${PN}-dev += "\ |
| 88 | ${libdir}/bluetooth/plugins/*.la \ |
| 89 | ${libdir}/alsa-lib/*.la \ |
| 90 | " |
| 91 | |
| 92 | FILES_${PN}-obex = "${libexecdir}/bluetooth/obexd \ |
| 93 | ${exec_prefix}/lib/systemd/user/obex.service \ |
| 94 | ${datadir}/dbus-1/services/org.bluez.obex.service \ |
| 95 | " |
| 96 | SYSTEMD_SERVICE_${PN}-obex = "obex.service" |
| 97 | |
| 98 | FILES_${PN}-testtools = "${libdir}/bluez/test/*" |
| 99 | |
| 100 | def get_noinst_tools_paths (d, bb, tools): |
| 101 | s = list() |
Brad Bishop | 6e60e8b | 2018-02-01 10:27:11 -0500 | [diff] [blame] | 102 | bindir = d.getVar("bindir") |
Patrick Williams | c124f4f | 2015-09-15 14:41:29 -0500 | [diff] [blame] | 103 | 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 Bishop | 6e60e8b | 2018-02-01 10:27:11 -0500 | [diff] [blame] | 108 | FILES_${PN}-noinst-tools = "${@get_noinst_tools_paths(d, bb, d.getVar('NOINST_TOOLS'))}" |
Patrick Williams | c124f4f | 2015-09-15 14:41:29 -0500 | [diff] [blame] | 109 | |
Patrick Williams | c0f7c04 | 2017-02-23 20:41:17 -0600 | [diff] [blame] | 110 | RDEPENDS_${PN}-testtools += "python3 python3-dbus python3-pygobject" |
Patrick Williams | c124f4f | 2015-09-15 14:41:29 -0500 | [diff] [blame] | 111 | |
| 112 | SYSTEMD_SERVICE_${PN} = "bluetooth.service" |
Patrick Williams | d8c66bc | 2016-06-20 12:57:21 -0500 | [diff] [blame] | 113 | INITSCRIPT_PACKAGES = "${PN}" |
| 114 | INITSCRIPT_NAME_${PN} = "bluetooth" |
Patrick Williams | c124f4f | 2015-09-15 14:41:29 -0500 | [diff] [blame] | 115 | |
| 116 | EXCLUDE_FROM_WORLD = "1" |
Patrick Williams | d8c66bc | 2016-06-20 12:57:21 -0500 | [diff] [blame] | 117 | |
| 118 | do_compile_ptest() { |
| 119 | oe_runmake buildtests |
| 120 | } |
| 121 | |
| 122 | do_install_ptest() { |
| 123 | cp -r ${B}/unit/ ${D}${PTEST_PATH} |
Patrick Williams | c0f7c04 | 2017-02-23 20:41:17 -0600 | [diff] [blame] | 124 | rm -f ${D}${PTEST_PATH}/unit/*.o |
Patrick Williams | d8c66bc | 2016-06-20 12:57:21 -0500 | [diff] [blame] | 125 | } |