summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorXin Ouyang <Xin.Ouyang@windriver.com>2013-01-04 18:26:47 +0800
committerXin Ouyang <Xin.Ouyang@windriver.com>2013-01-05 13:14:00 +0800
commitb493530bffebef2c2887228304cb5e738abb9d29 (patch)
tree675634ebca1544894a8e133592a67d951579bde9
parent17335d322c10f2b741bdca5d49a02d557e634736 (diff)
downloadmeta-selinux-b493530bffebef2c2887228304cb5e738abb9d29.tar.gz
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>
-rw-r--r--classes/enable-audit.bbclass5
-rw-r--r--classes/enable-selinux.bbclass4
-rw-r--r--classes/selinux.bbclass12
-rw-r--r--classes/with-audit.bbclass5
-rw-r--r--classes/with-selinux.bbclass4
5 files changed, 30 insertions, 0 deletions
diff --git a/classes/enable-audit.bbclass b/classes/enable-audit.bbclass
new file mode 100644
index 0000000..5820a38
--- /dev/null
+++ b/classes/enable-audit.bbclass
@@ -0,0 +1,5 @@
1# There is still no audit DISTRO_FEATURE, so enable audit when selinux feature enabled.
2inherit selinux
3
4PACKAGECONFIG_append = " ${@target_selinux(d, 'audit')}"
5PACKAGECONFIG[audit] = "--enable-audit,--disable-audit,audit,"
diff --git a/classes/enable-selinux.bbclass b/classes/enable-selinux.bbclass
new file mode 100644
index 0000000..de2a124
--- /dev/null
+++ b/classes/enable-selinux.bbclass
@@ -0,0 +1,4 @@
1inherit selinux
2
3PACKAGECONFIG_append = " ${@target_selinux(d)}"
4PACKAGECONFIG[selinux] = "--enable-selinux,--disable-selinux,libselinux,"
diff --git a/classes/selinux.bbclass b/classes/selinux.bbclass
new file mode 100644
index 0000000..87d4d59
--- /dev/null
+++ b/classes/selinux.bbclass
@@ -0,0 +1,12 @@
1def target_selinux(d, truevar = 'selinux', falsevar = ''):
2 if not base_contains("DISTRO_FEATURES", "selinux", True, False, d):
3 return falsevar
4
5 pn = d.getVar("PN", True)
6 type = pn.replace(d.getVar("BPN", True), "")
7 if type in ("-native", "-nativesdk", "-cross", "-crosssdk"):
8 return falsevar
9
10 return truevar
11
12LIBSELINUX = "${@target_selinux(d, 'libselinux')}"
diff --git a/classes/with-audit.bbclass b/classes/with-audit.bbclass
new file mode 100644
index 0000000..0c15312
--- /dev/null
+++ b/classes/with-audit.bbclass
@@ -0,0 +1,5 @@
1# There is still no audit DISTRO_FEATURE, so enable audit when selinux feature enabled.
2inherit selinux
3
4PACKAGECONFIG_append = " ${@target_selinux(d, 'audit')}"
5PACKAGECONFIG[audit] = "--with-audit,--without-audit,audit,"
diff --git a/classes/with-selinux.bbclass b/classes/with-selinux.bbclass
new file mode 100644
index 0000000..7873d9b
--- /dev/null
+++ b/classes/with-selinux.bbclass
@@ -0,0 +1,4 @@
1inherit selinux
2
3PACKAGECONFIG_append = " ${@target_selinux(d)}"
4PACKAGECONFIG[selinux] = "--with-selinux,--without-selinux,libselinux,"