blob: 9ee8005c1ed1f1fb9d12c95f8eec32f8c1c1c80a [file] [log] [blame]
# Copyright 2017 The Chromium OS Authors. All rights reserved.
# Distributed under the terms of the GNU General Public License v2
EAPI=5
CROS_WORKON_INCREMENTAL_BUILD="1"
CROS_WORKON_LOCALNAME="platform2"
CROS_WORKON_PROJECT="chromiumos/platform2"
CROS_WORKON_OUTOFTREE_BUILD=1
CROS_WORKON_SUBTREE="common-mk virtual_file_provider"
PLATFORM_SUBDIR="virtual_file_provider"
inherit cros-workon platform user
DESCRIPTION="D-Bus service to provide virtual file"
HOMEPAGE="https://chromium.googlesource.com/chromiumos/platform2/+/master/virtual_file_provider"
LICENSE="BSD-Google"
SLOT="0"
KEYWORDS="~*"
RDEPEND="
chromeos-base/libbrillo
sys-fs/fuse
sys-libs/libcap
"
DEPEND="${RDEPEND}
chromeos-base/system_api"
MOUNTPOINTS="/opt/google/containers/virtual-file-provider/mountpoints"
src_install() {
dobin "${OUT}"/virtual-file-provider
newbin virtual-file-provider-jailed.sh virtual-file-provider-jailed
insinto /usr/share/virtual-file-provider
doins "${OUT}"/rootfs.squashfs
insinto /etc/dbus-1/system.d
doins org.chromium.VirtualFileProvider.conf
insinto /usr/share/dbus-1/system-services
doins org.chromium.VirtualFileProvider.service
# Keep the parent directory of mountpoints inaccessible from non-root
# users because mountpoints themselves are often world-readable but we
# do not want to expose them.
# container-root is where the root filesystem of the container in which
# virtual-file-provider daemon runs is mounted.
diropts --mode=0700 --owner=root --group=root
keepdir "${MOUNTPOINTS}"
keepdir "${MOUNTPOINTS}"/container-root
}
pkg_preinst() {
enewuser "virtual-file-provider"
enewgroup "virtual-file-provider"
}
platform_pkg_test() {
platform_test "run" "${OUT}/virtual-file-provider_testrunner"
}