layer: add selinux/audit bbclasses

Add bbclasses only for target packages to enable selinux support,
not native/nativesdk/cross/crosssdk pacakges.

Signed-off-by: Xin Ouyang <Xin.Ouyang@windriver.com>
This commit is contained in:
Xin Ouyang 2013-01-04 18:26:47 +08:00
parent 17335d322c
commit b493530bff
5 changed files with 30 additions and 0 deletions

View File

@ -0,0 +1,5 @@
# There is still no audit DISTRO_FEATURE, so enable audit when selinux feature enabled.
inherit selinux
PACKAGECONFIG_append = " ${@target_selinux(d, 'audit')}"
PACKAGECONFIG[audit] = "--enable-audit,--disable-audit,audit,"

View File

@ -0,0 +1,4 @@
inherit selinux
PACKAGECONFIG_append = " ${@target_selinux(d)}"
PACKAGECONFIG[selinux] = "--enable-selinux,--disable-selinux,libselinux,"

12
classes/selinux.bbclass Normal file
View File

@ -0,0 +1,12 @@
def target_selinux(d, truevar = 'selinux', falsevar = ''):
if not base_contains("DISTRO_FEATURES", "selinux", True, False, d):
return falsevar
pn = d.getVar("PN", True)
type = pn.replace(d.getVar("BPN", True), "")
if type in ("-native", "-nativesdk", "-cross", "-crosssdk"):
return falsevar
return truevar
LIBSELINUX = "${@target_selinux(d, 'libselinux')}"

View File

@ -0,0 +1,5 @@
# There is still no audit DISTRO_FEATURE, so enable audit when selinux feature enabled.
inherit selinux
PACKAGECONFIG_append = " ${@target_selinux(d, 'audit')}"
PACKAGECONFIG[audit] = "--with-audit,--without-audit,audit,"

View File

@ -0,0 +1,4 @@
inherit selinux
PACKAGECONFIG_append = " ${@target_selinux(d)}"
PACKAGECONFIG[selinux] = "--with-selinux,--without-selinux,libselinux,"