upgrade sau and make separate ebuild for selinux policy

This commit is contained in:
Fredrik Eriksson 2020-05-06 18:51:40 +02:00
parent e6328daa7a
commit 1facf84588
Signed by: feffe
GPG Key ID: 18524638BE25530A
6 changed files with 82 additions and 72 deletions

View File

@ -0,0 +1,3 @@
sec-policy/selinux-sau ~amd64
sys-apps/sau ~amd64

View File

@ -0,0 +1,2 @@
DIST sau-v0.9.1.tar.gz 8622 BLAKE2B a76ff99a747d2cee59d8dd58ccfbe897edad356c965df20aaec89e4569096c5de1eb7ecbe65c9efff39ffa15ac42044e29bd8a37b87d9bd69719af298798f7de SHA512 12631aa6a924976b1850d0d53b2c9c5e9cd0ba6296a8bc956136dbbe8a952ab85055621aaaf1c9501e68cfa33c2d318e7a5c7cd1dc00ad6acd60efc95ad9df31
EBUILD selinux-sau-0.9.1.ebuild 1069 BLAKE2B 70235630cb6920b33d911726e6f8279c62aa86078ce43205a205acd78756b224c4d4a3e8c23aacdb96a41843becc58c40a7b698fff117f4371a8f50cfdd97c66 SHA512 5671837c9b339acb2d2e5b8a758377ffb9ad7230a1cddb1e637f5e2f03e6f1b64a60c21205f3ad02b2d34f701ddd1246af89c08e5683e644dd9e974b2c120405

View File

@ -0,0 +1,51 @@
# 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://fulh.ax/feffe/sau"
SRC_URI="https://fulh.ax/feffe/sau/-/archive/v${PV}/sau-v${PV}.tar.gz"
S="${WORKDIR}/sau-v${PV}"
LICENSE="BSD"
SLOT="0"
KEYWORDS="~amd64 ~x86"
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
}

View File

@ -1,2 +1,2 @@
DIST sau-v0.1.tar.gz 8579 BLAKE2B e6ffe2632ad2e26bbf06687051a2c1f6765a0470eef3e50e962b937b0f27f71ff8d261849c96e5f7f756a15ddeefb716f103e298374459d1b3251d7ed2a9329d SHA512 a969b41211f78168e3f8b0888aa9961f92380959d8f040ef28e9c4323599ae52c6662a1bfb65c6e4e3252161cd8fe991c035388a1da976ebad8f97155c0c4cc2
EBUILD sau-0.1.ebuild 1368 BLAKE2B 294f03f24071eb1609a50dda4d5e03448381a2b6598d17c5a02a59ba813fe9d7a461b898205a118277d454a3d4677e90aeb2597d45712340d0394bbae1696e32 SHA512 cf6f7a86c3b543a3196bfd1c466c452dfc7a6b0423f0fed318a257d97d3bf69523de78ce02a495272c82bded4fcd973601a12e95872d2a359cb3b12a5582519c
DIST sau-v0.9.1.tar.gz 8622 BLAKE2B a76ff99a747d2cee59d8dd58ccfbe897edad356c965df20aaec89e4569096c5de1eb7ecbe65c9efff39ffa15ac42044e29bd8a37b87d9bd69719af298798f7de SHA512 12631aa6a924976b1850d0d53b2c9c5e9cd0ba6296a8bc956136dbbe8a952ab85055621aaaf1c9501e68cfa33c2d318e7a5c7cd1dc00ad6acd60efc95ad9df31
EBUILD sau-0.9.1.ebuild 507 BLAKE2B 42bf545c3caf776365333c60407da7dea5eef50854db0571b15e99594e0eae4abbff541a362ec928b453e9c886659f1bd99d67ea3e50ed3a0055344883664003 SHA512 406d9d07241f8acc3f60921f65cbca8424097bd5601497feefc6674e8215b9455016c99311963c314ba0eff26c4829e6c637526300e33dde3d7fe21680239f64

View File

@ -1,70 +0,0 @@
# Copyright 2020 Gentoo Authors
# Distributed under the terms of the GNU General Public License v2
EAPI=7
PYTHON_COMPAT=( python3_{6,7,8} )
inherit distutils-r1
DESCRIPTION="Tool for automatic upgrades"
HOMEPAGE="https://fulh.ax/feffe/sau"
SRC_URI="https://fulh.ax/feffe/sau/-/archive/v${PV}/sau-v${PV}.tar.gz"
S="${WORKDIR}/sau-v${PV}"
LICENSE="BSD"
SLOT="0"
KEYWORDS="amd64"
IUSE="selinux"
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
}

View File

@ -0,0 +1,24 @@
# Copyright 2020 Gentoo Authors
# Distributed under the terms of the GNU General Public License v2
EAPI=7
PYTHON_COMPAT=( python3_{6,7,8} )
inherit distutils-r1
DESCRIPTION="Tool for automatic upgrades"
HOMEPAGE="https://fulh.ax/feffe/sau"
SRC_URI="https://fulh.ax/feffe/sau/-/archive/v${PV}/sau-v${PV}.tar.gz"
S="${WORKDIR}/sau-v${PV}"
LICENSE="BSD"
SLOT="0"
KEYWORDS="~amd64 ~arm64 ~x86"
IUSE="selinux"
DEPEND="selinux? ( sec-policy/selinux-sau )"
RDEPEND="${DEPEND} dev-python/psutil"
BDEPEND=""