summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorYi Zhao <yi.zhao@windriver.com>2019-11-14 09:48:47 +0800
committerJoe MacDonald <joe_macdonald@mentor.com>2019-12-19 11:09:21 -0500
commit7bb1507928f2e0f54ff8eac4135e15e821cdb1e2 (patch)
treead4e2faa3bab498e6ec3b3f5e61f5f66a31df482
parent5e3643b618a2a01304165dc1b80f6d784742dc70 (diff)
downloadmeta-selinux-7bb1507928f2e0f54ff8eac4135e15e821cdb1e2.tar.gz
libselinux-python: add recipe
After switch to python3, There is a loop dependency error with libselinux-python package when build libselinux. Split the original libselinux recipe into libselinux and libselinux-python. Signed-off-by: Yi Zhao <yi.zhao@windriver.com> Signed-off-by: Joe MacDonald <joe_macdonald@mentor.com>
-rw-r--r--recipes-security/selinux/libselinux-python.inc40
-rw-r--r--recipes-security/selinux/libselinux-python_2.9.bb18
2 files changed, 58 insertions, 0 deletions
diff --git a/recipes-security/selinux/libselinux-python.inc b/recipes-security/selinux/libselinux-python.inc
new file mode 100644
index 0000000..62354b2
--- /dev/null
+++ b/recipes-security/selinux/libselinux-python.inc
@@ -0,0 +1,40 @@
1SUMMARY = "SELinux library and simple utilities"
2DESCRIPTION = "libselinux provides an API for SELinux applications to get and set \
3process and file security contexts and to obtain security policy \
4decisions. Required for any applications that use the SELinux API."
5SECTION = "base"
6LICENSE = "PD"
7
8FILESEXTRAPATHS_prepend := "${THISDIR}/libselinux:"
9
10inherit python3-dir
11
12DEPENDS += "python3 swig-native"
13RDEPENDS_${PN} += "libselinux python3-core python3-shell"
14
15def get_policyconfigarch(d):
16 import re
17 target = d.getVar('TARGET_ARCH', True)
18 p = re.compile('i.86')
19 target = p.sub('i386',target)
20 return "ARCH=%s" % (target)
21EXTRA_OEMAKE += "${@get_policyconfigarch(d)}"
22
23EXTRA_OEMAKE += "LDFLAGS='${LDFLAGS} -lpcre' LIBSEPOLA='${STAGING_LIBDIR}/libsepol.a'"
24EXTRA_OEMAKE_append_libc-musl = " FTS_LDLIBS=-lfts"
25
26FILES_${PN} = "${libdir}/python${PYTHON_BASEVERSION}/site-packages/*"
27
28do_compile() {
29 oe_runmake pywrap -j1 \
30 PYLIBVER='python${PYTHON_BASEVERSION}${PYTHON_ABI}' \
31 PYINC='-I${STAGING_INCDIR}/${PYLIBVER}' \
32 PYLIBS='-L${STAGING_LIBDIR}/${PYLIBVER} -l${PYLIBVER}'
33}
34
35do_install() {
36 oe_runmake install-pywrap swigify \
37 PYCEXT='.so' \
38 PYLIBVER='python${PYTHON_BASEVERSION}${PYTHON_ABI}' \
39 PYTHONLIBDIR='${D}${libdir}/python${PYTHON_BASEVERSION}/site-packages'
40}
diff --git a/recipes-security/selinux/libselinux-python_2.9.bb b/recipes-security/selinux/libselinux-python_2.9.bb
new file mode 100644
index 0000000..8e3aae1
--- /dev/null
+++ b/recipes-security/selinux/libselinux-python_2.9.bb
@@ -0,0 +1,18 @@
1SELINUX_RELEASE = "20190315"
2
3SRC_URI = "https://github.com/SELinuxProject/selinux/releases/download/${SELINUX_RELEASE}/libselinux-${PV}.tar.gz"
4
5require ${BPN}.inc
6
7LIC_FILES_CHKSUM = "file://LICENSE;md5=84b4d2c6ef954a2d4081e775a270d0d0"
8
9SRC_URI[md5sum] = "bb449431b6ed55a0a0496dbc366d6e31"
10SRC_URI[sha256sum] = "1bccc8873e449587d9a2b2cf253de9b89a8291b9fbc7c59393ca9e5f5f4d2693"
11
12SRC_URI += "\
13 file://libselinux-drop-Wno-unused-but-set-variable.patch \
14 file://libselinux-make-O_CLOEXEC-optional.patch \
15 file://libselinux-make-SOCK_CLOEXEC-optional.patch \
16 file://libselinux-define-FD_CLOEXEC-as-necessary.patch \
17 "
18S = "${WORKDIR}/libselinux-${PV}"