summaryrefslogtreecommitdiff
blob: a77ab52b395f1f694f167d1290d2e77e850e170b (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
# Copyright 1999-2017 Gentoo Foundation
# Distributed under the terms of the GNU General Public License v2
EAPI="6"

IUSE=""
MODS="acpi"

inherit selinux-policy-2

DESCRIPTION="SELinux policy for acpi"

if [[ ${PV} != 9999* ]] ; then
	KEYWORDS="~amd64 -arm ~arm64 ~mips ~x86"
fi

pkg_postinst() {
	# "apm" module got renamed to "acpi", must remove apm first
	# the contexts are okay even tho the modules are not
	# replaced in the same command (doesnt become unlabeled_t)
	for i in ${POLICY_TYPES}; do
		if semodule -s "${i}" -l | grep apm >/dev/null 2>&1; then
			semodule -s "${i}" -r apm
		fi
	done
	selinux-policy-2_pkg_postinst
}

pkg_postrm() {
	for i in ${POLICY_TYPES}; do
		if semodule -s "${i}" -l | grep apm >/dev/null 2>&1; then
			semodule -s "${i}" -r apm
		fi
	done
	selinux-policy-2_pkg_postrm
}