blob: 6bb03b26d198895245fc7f3b1b67ebfaa5b51f0d [file] [log] [blame]
# Copyright 1999-2021 Gentoo Foundation
# Distributed under the terms of the GNU General Public License v2
EAPI=7
inherit cros-sanitizers user
DESCRIPTION="QMI Remote File System Server"
HOMEPAGE="https://github.com/andersson/rmtfs"
GIT_SHA1="293ab8babb27ac0f24247bb101fed9420c629c29"
SRC_URI="https://github.com/andersson/rmtfs/archive/${GIT_SHA1}.tar.gz -> ${P}.tar.gz"
LICENSE="BSD"
SLOT="0"
KEYWORDS="*"
IUSE="asan +seccomp modemfwd"
DEPEND="
net-libs/libqrtr:=
virtual/udev:=
"
RDEPEND="${DEPEND}"
S="${WORKDIR}/${PN}-${GIT_SHA1}"
src_prepare() {
cp "${FILESDIR}/rmtfs.conf" "${T}"/
if use modemfwd; then
echo "start on started syslog and stopped verify_fsg and ((qcom-rmtfs-added and qcom-modem-added) or rmtfs-early) and started modemfwd-helpers" >> "${T}/rmtfs.conf"
else
echo "start on started syslog and stopped verify_fsg and ((qcom-rmtfs-added and qcom-modem-added) or rmtfs-early)" >> "${T}/rmtfs.conf"
fi
eapply "${FILESDIR}/patches/0001-Use-fdatasync-instead-of-O_SYNC-on-storage.patch"
eapply_user
}
src_configure() {
sanitizers-setup-env
}
src_install() {
emake DESTDIR="${D}" prefix="${EPREFIX}/usr" install
insinto /etc/init
doins "${T}/rmtfs.conf"
doins "${FILESDIR}/check-rmtfs-early.conf"
insinto /lib/udev/rules.d
doins "${FILESDIR}/77-rmtfs.rules"
# Install seccomp policy file.
insinto /usr/share/policy
use seccomp && newins "${FILESDIR}/rmtfs-seccomp-${ARCH}.policy" rmtfs-seccomp.policy
}
pkg_preinst() {
enewgroup "rmtfs"
enewuser "rmtfs"
}