52 lines
1.0 KiB
Bash
52 lines
1.0 KiB
Bash
# Copyright 2020 Gentoo Authors
|
|
# Distributed under the terms of the GNU General Public License v2
|
|
|
|
EAPI=7
|
|
|
|
DESCRIPTION="Selinux policy for sau - a tool for automatic upgrades"
|
|
HOMEPAGE="https://gitea.fulh.ax/feffe/sau"
|
|
SRC_URI="https://gitea.fulh.ax/feffe/sau/archive/v${PV}.tar.gz"
|
|
|
|
S="${WORKDIR}/sau"
|
|
|
|
LICENSE="BSD"
|
|
SLOT="0"
|
|
KEYWORDS="amd64 arm64"
|
|
|
|
DEPEND="sec-policy/selinux-unconfined"
|
|
RDEPEND="${DEPEND}"
|
|
BDEPEND=""
|
|
|
|
src_compile() {
|
|
cd "${S}/selinux"
|
|
for i in ${POLICY_TYPES}; do
|
|
make -f "${ROOT%/}/usr/share/selinux/${i}/include/Makefile"
|
|
mv sau.pp sau-${i}.pp
|
|
done
|
|
}
|
|
|
|
src_install() {
|
|
for i in ${POLICY_TYPES}; do
|
|
mkdir -p "${D}/usr/share/selinux/${i}"
|
|
mv "${S}/selinux/sau-${i}.pp" "${D}/usr/share/selinux/${i}/sau.pp"
|
|
done
|
|
}
|
|
|
|
|
|
pkg_postinst() {
|
|
for i in ${POLICY_TYPES}; do
|
|
cd "${ROOT%/}/usr/share/selinux/${i}"
|
|
if [[ "${i}" != "strict" ]]; then
|
|
semodule -s ${i} -i sau.pp
|
|
fi
|
|
done
|
|
}
|
|
|
|
pkg_postrm() {
|
|
for i in ${POLICY_TYPES}; do
|
|
if semodule -s "${i}" -l | grep sau >/dev/null 2>&1; then
|
|
semodule -s ${i} -r sau
|
|
fi
|
|
done
|
|
}
|