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 /recipes-security/selinux/libselinux-python.inc | |
| 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>
Diffstat (limited to 'recipes-security/selinux/libselinux-python.inc')
| -rw-r--r-- | recipes-security/selinux/libselinux-python.inc | 40 |
1 files changed, 40 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 | } | ||
