blob: b096a6b66f43ac8075775ea40ef82cb7fb8a3984 [file] [log] [blame]
# Copyright 2012 The ChromiumOS Authors
# Distributed under the terms of the GNU General Public License v2
EAPI=7
CROS_WORKON_LOCALNAME="platform2"
CROS_WORKON_PROJECT="chromiumos/platform2"
CROS_WORKON_OUTOFTREE_BUILD=1
CROS_WORKON_INCREMENTAL_BUILD=1
CROS_WORKON_SUBTREE="common-mk mtpd .gn"
PLATFORM_SUBDIR="mtpd"
PLATFORM_NATIVE_TEST="yes"
inherit cros-workon platform cros-protobuf systemd user
DESCRIPTION="MTP daemon for Chromium OS"
HOMEPAGE="https://chromium.googlesource.com/chromiumos/platform2/+/HEAD/mtpd"
LICENSE="BSD-Google"
KEYWORDS="~*"
IUSE="-asan +seccomp systemd test"
COMMON_DEPEND="
media-libs/libmtp:=
virtual/libudev:=
"
RDEPEND="
${COMMON_DEPEND}
virtual/udev
"
DEPEND="${COMMON_DEPEND}
chromeos-base/system_api:="
BDEPEND="
chromeos-base/chromeos-dbus-bindings
seccomp? ( chromeos-base/minijail )
"
src_install() {
platform_src_install
dosbin "${OUT}"/mtpd
# Install seccomp policy file.
insinto /usr/share/policy
use seccomp && newins "mtpd-seccomp-${ARCH}.policy" mtpd-seccomp.policy
# Install the init scripts.
if use systemd; then
systemd_dounit mtpd.service
systemd_enable_service system-services.target mtpd.service
else
insinto /etc/init
doins mtpd.conf
fi
# Install D-Bus config file.
insinto /etc/dbus-1/system.d
doins dbus/org.chromium.Mtpd.conf
}
platform_pkg_test() {
platform_test "run" "${OUT}/mtpd_testrunner"
}
pkg_preinst() {
enewuser "mtp"
enewgroup "mtp"
}