blob: e21f2cd4ad5f5e50c51b2492a5db154574f7665d [file] [log] [blame]
# Copyright 2018 The Chromium OS Authors. All rights reserved.
# Distributed under the terms of the GNU General Public License v2
EAPI=5
CROS_WORKON_LOCALNAME="platform2"
CROS_WORKON_PROJECT="chromiumos/platform2"
CROS_WORKON_OUTOFTREE_BUILD=1
CROS_WORKON_INCREMENTAL_BUILD=1
CROS_WORKON_SUBTREE="common-mk bluetooth"
PLATFORM_SUBDIR="bluetooth"
inherit cros-workon platform
DESCRIPTION="Bluetooth service for Chromium OS"
HOMEPAGE="https://chromium.googlesource.com/chromiumos/platform2/+/master/bluetooth"
LICENSE="BSD-Google"
SLOT="0"
KEYWORDS="~*"
IUSE="seccomp"
RDEPEND="
chromeos-base/libbrillo
net-wireless/bluez"
DEPEND="${RDEPEND}
chromeos-base/system_api"
src_install() {
dobin "${OUT}"/btdispatch
dobin "${OUT}"/newblued
insinto /etc/dbus-1/system.d
doins dbus/org.chromium.Bluetooth.conf
doins dbus/org.chromium.Newblue.conf
insinto /etc/init
doins init/upstart/btdispatch.conf
if use seccomp; then
# Install seccomp policy files.
insinto /usr/share/policy
newins "seccomp_filters/btdispatch-seccomp-${ARCH}.policy" btdispatch-seccomp.policy
newins "seccomp_filters/newblued-seccomp-${ARCH}.policy" newblued-seccomp.policy
else
# Remove seccomp flags from minijail parameters.
sed -i '/^env seccomp_flags=/s:=.*:="":' "${ED}"/etc/init/btdispatch.conf || die
fi
}
platform_pkg_test() {
platform_test "run" "${OUT}/btdispatch_test"
}