54 lines
1.1 KiB
Bash
54 lines
1.1 KiB
Bash
# Copyright 2020 Gentoo Authors
|
|
# Distributed under the terms of the GNU General Public License v2
|
|
|
|
EAPI=7
|
|
|
|
DESCRIPTION="SELinux policy for icinga2"
|
|
HOMEPAGE="http://icinga.org/icinga2"
|
|
SRC_URI="https://github.com/Icinga/icinga2/archive/v${PV}.tar.gz -> icinga2-${PV}.tar.gz"
|
|
|
|
LICENSE="GPL-2"
|
|
SLOT="0"
|
|
KEYWORDS="~amd64 ~x86 ~arm64"
|
|
|
|
DEPEND=""
|
|
RDEPEND="${DEPEND}"
|
|
BDEPEND=""
|
|
|
|
S="${WORKDIR}/icinga2-${PV}"
|
|
|
|
PATCHES=(
|
|
${FILESDIR}/gentoonize.patch
|
|
)
|
|
|
|
src_compile() {
|
|
cd "${S}/tools/selinux"
|
|
for i in ${POLICY_TYPES}; do
|
|
make -f "${ROOT%/}/usr/share/selinux/${i}/include/Makefile"
|
|
mv icinga2.pp icinga2-${i}.pp
|
|
done
|
|
}
|
|
|
|
src_install() {
|
|
for i in ${POLICY_TYPES}; do
|
|
mkdir -p "${D}/usr/share/selinux/${i}"
|
|
mv "${S}/tools/selinux/icinga2-${i}.pp" "${D}/usr/share/selinux/${i}/icinga2.pp"
|
|
done
|
|
}
|
|
|
|
|
|
pkg_postinst() {
|
|
for i in ${POLICY_TYPES}; do
|
|
cd "${ROOT%/}/usr/share/selinux/${i}"
|
|
semodule -s ${i} -i icinga2.pp
|
|
done
|
|
}
|
|
|
|
pkg_postrm() {
|
|
for i in ${POLICY_TYPES}; do
|
|
if semodule -s "${i}" -l | grep icinga2 >/dev/null 2>&1; then
|
|
semodule -s ${i} -r icinga2
|
|
fi
|
|
done
|
|
}
|