blob: 62efb02cf5522f76a190ddda0cfe11479763da54 [file] [log] [blame]
# Copyright 2017 The Chromium OS Authors. All rights reserved.
# Distributed under the terms of the GNU General Public License v2
EAPI=7
CROS_WORKON_USE_VCSID="1"
CROS_WORKON_LOCALNAME="platform2"
CROS_WORKON_PROJECT="chromiumos/platform2"
CROS_WORKON_OUTOFTREE_BUILD=1
CROS_WORKON_INCREMENTAL_BUILD=1
# TODO(crbug.com/809389): Avoid directly including headers from other packages.
CROS_WORKON_SUBTREE="common-mk trunks libhwsec metrics u2fd .gn"
PLATFORM_SUBDIR="u2fd"
inherit cros-workon platform user
DESCRIPTION="U2FHID Emulation Daemon"
HOMEPAGE="https://chromium.googlesource.com/chromiumos/platform2/+/master/u2fhid"
LICENSE="BSD-Google"
KEYWORDS="~*"
IUSE="fuzzer"
COMMON_DEPEND="
chromeos-base/attestation:=
chromeos-base/attestation-client:=
chromeos-base/cbor:=
chromeos-base/libhwsec:=
>=chromeos-base/metrics-0.0.1-r3152:=
chromeos-base/power_manager-client:=
chromeos-base/trunks:=
dev-libs/hidapi:=
"
RDEPEND="${COMMON_DEPEND}"
DEPEND="${COMMON_DEPEND}
chromeos-base/attestation-client:=
chromeos-base/system_api:=[fuzzer?]
"
pkg_setup() {
# Has to be done in pkg_setup() instead of pkg_preinst() since
# src_install() needs the u2f user and group.
enewuser "u2f"
enewgroup "u2f"
cros-workon_pkg_setup
}
src_install() {
dobin "${OUT}"/u2fd
insinto /etc/init
doins init/*.conf
insinto /etc/dbus-1/system.d
doins org.chromium.U2F.conf
local daemon_store="/etc/daemon-store/u2f"
dodir "${daemon_store}"
fperms 0700 "${daemon_store}"
fowners u2f:u2f "${daemon_store}"
platform_fuzzer_install "${S}"/OWNERS "${OUT}"/u2f_adpu_fuzzer
}
platform_pkg_test() {
platform_test "run" "${OUT}/u2fd_test_runner"
}