add selinux support for sau

This commit is contained in:
Fredrik Eriksson 2020-04-29 18:23:40 +02:00
parent 2ce3e84b6b
commit 09ac1f6dc7
Signed by: feffe
GPG Key ID: 18524638BE25530A
2 changed files with 50 additions and 3 deletions

View File

@ -1,2 +1,2 @@
DIST sau-v0.1.tar.gz 8579 BLAKE2B e6ffe2632ad2e26bbf06687051a2c1f6765a0470eef3e50e962b937b0f27f71ff8d261849c96e5f7f756a15ddeefb716f103e298374459d1b3251d7ed2a9329d SHA512 a969b41211f78168e3f8b0888aa9961f92380959d8f040ef28e9c4323599ae52c6662a1bfb65c6e4e3252161cd8fe991c035388a1da976ebad8f97155c0c4cc2
EBUILD sau-0.1.ebuild 433 BLAKE2B 79a37de976b439efdca0df1678241e2f095d85e4e4255144e347c94164d9d3aab4b10a80b5fb2cf547804b13dd477f0c7d02b356cec72cd55253ec7e96987b10 SHA512 42e27e0bfa29d0fca671e54bc7ddc00f0de17aad4ad3906c5d037c7ca6ac75213bc2a2591c5aca9aeac3260beddbc9da8103d966a95f638c53b82c5f39c0a4ef
EBUILD sau-0.1.ebuild 1368 BLAKE2B 294f03f24071eb1609a50dda4d5e03448381a2b6598d17c5a02a59ba813fe9d7a461b898205a118277d454a3d4677e90aeb2597d45712340d0394bbae1696e32 SHA512 cf6f7a86c3b543a3196bfd1c466c452dfc7a6b0423f0fed318a257d97d3bf69523de78ce02a495272c82bded4fcd973601a12e95872d2a359cb3b12a5582519c

View File

@ -16,8 +16,55 @@ S="${WORKDIR}/sau-v${PV}"
LICENSE="BSD"
SLOT="0"
KEYWORDS="amd64"
IUSE=""
IUSE="selinux"
DEPEND=""
DEPEND="selinux? ( sec-policy/selinux-unconfined )
"
RDEPEND="${DEPEND}"
BDEPEND=""
python_compile_all() {
#distutils-r1_python_compile()
if use selinux; then
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
fi
default
}
python_install_all() {
#distutils-r1_python_install()
if use selinux; then
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
fi
default
}
pkg_postinst() {
if use selinux; then
for i in ${POLICY_TYPES}; do
cd "${ROOT%/}/usr/share/selinux/${i}"
if [[ "${i}" != "strict" ]]; then
semodule -s ${i} -i sau.pp
fi
done
restorecon /usr/bin/sau
fi
}
pkg_postrm() {
if use selinux; then
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
fi
}