| # Copyright 2021 The Chromium OS Authors. All rights reserved. |
| # Distributed under the terms of the GNU General Public License v2 |
| |
| EAPI=7 |
| |
| CROS_WORKON_COMMIT="b7ed0ed288d39556e6141108005d048b913afed7" |
| CROS_WORKON_TREE="961160ce2e8a12a1638b285a02df45af520acf92" |
| CROS_WORKON_INCREMENTAL_BUILD=1 |
| CROS_WORKON_LOCALNAME="platform2" |
| CROS_WORKON_PROJECT="chromiumos/platform2" |
| # We don't use CROS_WORKON_OUTOFTREE_BUILD here since project's Cargo.toml is |
| # using "provided by ebuild" macro which supported by cros-rust. |
| CROS_WORKON_SUBTREE="resourced" |
| |
| inherit cros-workon cros-rust user |
| |
| DESCRIPTION="ChromeOS Resource Management Daemon" |
| HOMEPAGE="https://chromium.googlesource.com/chromiumos/platform2/+/HEAD/resourced/" |
| |
| LICENSE="BSD-Google" |
| SLOT="0/${PVR}" |
| KEYWORDS="*" |
| IUSE="+seccomp" |
| |
| DEPEND=" |
| =dev-rust/anyhow-1*:= |
| =dev-rust/dbus-0.9*:= |
| =dev-rust/dbus-tree-0.9*:= |
| =dev-rust/glob-0.3*:= |
| =dev-rust/once_cell-1.7*:= |
| =dev-rust/regex-1.5*:= |
| dev-rust/sys_util:= |
| " |
| |
| src_install() { |
| dobin "$(cros-rust_get_build_dir)/resourced" |
| |
| # D-Bus configuration. |
| insinto /etc/dbus-1/system.d |
| doins dbus/org.chromium.ResourceManager.conf |
| |
| # init script. |
| insinto /etc/init |
| doins init/resourced.conf |
| |
| # seccomp policy file. |
| insinto /usr/share/policy |
| if use seccomp; then |
| newins "seccomp/resourced-seccomp-${ARCH}.policy" resourced-seccomp.policy |
| fi |
| } |
| |
| pkg_preinst() { |
| enewuser "resourced" |
| enewgroup "resourced" |
| |
| cros-rust_pkg_preinst |
| } |