diff options
author | Yi Zhao <yi.zhao@windriver.com> | 2019-11-14 09:48:47 +0800 |
---|---|---|
committer | Joe MacDonald <joe_macdonald@mentor.com> | 2019-12-19 11:09:21 -0500 |
commit | 7bb1507928f2e0f54ff8eac4135e15e821cdb1e2 (patch) | |
tree | ad4e2faa3bab498e6ec3b3f5e61f5f66a31df482 | |
parent | 5e3643b618a2a01304165dc1b80f6d784742dc70 (diff) | |
download | meta-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.inc | 40 | ||||
-rw-r--r-- | recipes-security/selinux/libselinux-python_2.9.bb | 18 |
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 @@ | |||
1 | SUMMARY = "SELinux library and simple utilities" | ||
2 | DESCRIPTION = "libselinux provides an API for SELinux applications to get and set \ | ||
3 | process and file security contexts and to obtain security policy \ | ||
4 | decisions. Required for any applications that use the SELinux API." | ||
5 | SECTION = "base" | ||
6 | LICENSE = "PD" | ||
7 | |||
8 | FILESEXTRAPATHS_prepend := "${THISDIR}/libselinux:" | ||
9 | |||
10 | inherit python3-dir | ||
11 | |||
12 | DEPENDS += "python3 swig-native" | ||
13 | RDEPENDS_${PN} += "libselinux python3-core python3-shell" | ||
14 | |||
15 | def 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) | ||
21 | EXTRA_OEMAKE += "${@get_policyconfigarch(d)}" | ||
22 | |||
23 | EXTRA_OEMAKE += "LDFLAGS='${LDFLAGS} -lpcre' LIBSEPOLA='${STAGING_LIBDIR}/libsepol.a'" | ||
24 | EXTRA_OEMAKE_append_libc-musl = " FTS_LDLIBS=-lfts" | ||
25 | |||
26 | FILES_${PN} = "${libdir}/python${PYTHON_BASEVERSION}/site-packages/*" | ||
27 | |||
28 | do_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 | |||
35 | do_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 @@ | |||
1 | SELINUX_RELEASE = "20190315" | ||
2 | |||
3 | SRC_URI = "https://github.com/SELinuxProject/selinux/releases/download/${SELINUX_RELEASE}/libselinux-${PV}.tar.gz" | ||
4 | |||
5 | require ${BPN}.inc | ||
6 | |||
7 | LIC_FILES_CHKSUM = "file://LICENSE;md5=84b4d2c6ef954a2d4081e775a270d0d0" | ||
8 | |||
9 | SRC_URI[md5sum] = "bb449431b6ed55a0a0496dbc366d6e31" | ||
10 | SRC_URI[sha256sum] = "1bccc8873e449587d9a2b2cf253de9b89a8291b9fbc7c59393ca9e5f5f4d2693" | ||
11 | |||
12 | SRC_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 | " | ||
18 | S = "${WORKDIR}/libselinux-${PV}" | ||