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.z...@windriver.com> --- .../selinux/libselinux-python.inc | 40 +++++++++++++++++++ .../selinux/libselinux-python_2.9.bb | 18 +++++++++ 2 files changed, 58 insertions(+) create mode 100644 recipes-security/selinux/libselinux-python.inc create mode 100644 recipes-security/selinux/libselinux-python_2.9.bb 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 @@ +SUMMARY = "SELinux library and simple utilities" +DESCRIPTION = "libselinux provides an API for SELinux applications to get and set \ +process and file security contexts and to obtain security policy \ +decisions. Required for any applications that use the SELinux API." +SECTION = "base" +LICENSE = "PD" + +FILESEXTRAPATHS_prepend := "${THISDIR}/libselinux:" + +inherit python3-dir + +DEPENDS += "python3 swig-native" +RDEPENDS_${PN} += "libselinux python3-core python3-shell" + +def get_policyconfigarch(d): + import re + target = d.getVar('TARGET_ARCH', True) + p = re.compile('i.86') + target = p.sub('i386',target) + return "ARCH=%s" % (target) +EXTRA_OEMAKE += "${@get_policyconfigarch(d)}" + +EXTRA_OEMAKE += "LDFLAGS='${LDFLAGS} -lpcre' LIBSEPOLA='${STAGING_LIBDIR}/libsepol.a'" +EXTRA_OEMAKE_append_libc-musl = " FTS_LDLIBS=-lfts" + +FILES_${PN} = "${libdir}/python${PYTHON_BASEVERSION}/site-packages/*" + +do_compile() { + oe_runmake pywrap -j1 \ + PYLIBVER='python${PYTHON_BASEVERSION}${PYTHON_ABI}' \ + PYINC='-I${STAGING_INCDIR}/${PYLIBVER}' \ + PYLIBS='-L${STAGING_LIBDIR}/${PYLIBVER} -l${PYLIBVER}' +} + +do_install() { + oe_runmake install-pywrap swigify \ + PYCEXT='.so' \ + PYLIBVER='python${PYTHON_BASEVERSION}${PYTHON_ABI}' \ + PYTHONLIBDIR='${D}${libdir}/python${PYTHON_BASEVERSION}/site-packages' +} 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 @@ +SELINUX_RELEASE = "20190315" + +SRC_URI = "https://github.com/SELinuxProject/selinux/releases/download/${SELINUX_RELEASE}/libselinux-${PV}.tar.gz" + +require ${BPN}.inc + +LIC_FILES_CHKSUM = "file://LICENSE;md5=84b4d2c6ef954a2d4081e775a270d0d0" + +SRC_URI[md5sum] = "bb449431b6ed55a0a0496dbc366d6e31" +SRC_URI[sha256sum] = "1bccc8873e449587d9a2b2cf253de9b89a8291b9fbc7c59393ca9e5f5f4d2693" + +SRC_URI += "\ + file://libselinux-drop-Wno-unused-but-set-variable.patch \ + file://libselinux-make-O_CLOEXEC-optional.patch \ + file://libselinux-make-SOCK_CLOEXEC-optional.patch \ + file://libselinux-define-FD_CLOEXEC-as-necessary.patch \ + " +S = "${WORKDIR}/libselinux-${PV}" -- 2.17.1 -- _______________________________________________ yocto mailing list yocto@yoctoproject.org https://lists.yoctoproject.org/listinfo/yocto