blob: a224c9dee8f65cfb8d701290c55b8c0fd60f603c [file] [log] [blame]
# Copyright 2020 The Chromium OS Authors. All rights reserved.
# Distributed under the terms of the GNU General Public License v2
EAPI="7"
CROS_WORKON_INCREMENTAL_BUILD="1"
CROS_WORKON_LOCALNAME="platform2"
CROS_WORKON_PROJECT="chromiumos/platform2"
CROS_WORKON_SUBTREE="common-mk ocr .gn"
CROS_WORKON_OUTOFTREE_BUILD=1
PLATFORM_SUBDIR="ocr"
inherit cros-workon platform user
DESCRIPTION="Optical Character Recognition service for Chrome OS"
HOMEPAGE="https://chromium.googlesource.com/chromiumos/platform2/+/HEAD/ocr/"
LICENSE="BSD-Google"
SLOT="0/0"
KEYWORDS="~*"
IUSE=""
COMMON_DEPEND="
app-text/tesseract:=
"
RDEPEND="${COMMON_DEPEND}"
DEPEND="${COMMON_DEPEND}
chromeos-base/system_api:=
"
pkg_preinst() {
enewuser ocr_service
enewgroup ocr_service
}
src_install() {
dobin "${OUT}"/ocr_service
dobin "${OUT}"/ocr_tool
# Install upstart configuration.
insinto /etc/init
doins init/ocr_service.conf
# Install D-Bus configuration file.
insinto /etc/dbus-1/system.d
doins dbus_permissions/org.chromium.OpticalCharacterRecognition.conf
# Install D-Bus service activation configuration.
insinto /usr/share/dbus-1/system-services
doins dbus_permissions/org.chromium.OpticalCharacterRecognition.service
}
platform_pkg_test() {
local tests=(
"ocr_service_test"
)
local test_bin
for test_bin in "${tests[@]}"; do
platform_test "run" "${OUT}/${test_bin}"
done
}