Yocto Project Discussions
 help / color / mirror / Atom feed
From: Yi Zhao <yi.zhao@windriver.com>
To: <yocto@yoctoproject.org>, <joe@deserted.net>, <Joe_MacDonald@mentor.com>
Subject: [meta-selinux][PATCH 05/19] libselinux-python: add recipe
Date: Thu, 14 Nov 2019 09:48:47 +0800	[thread overview]
Message-ID: <20191114014901.22862-6-yi.zhao@windriver.com> (raw)
In-Reply-To: <20191114014901.22862-1-yi.zhao@windriver.com>

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>
---
 .../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



  parent reply	other threads:[~2019-11-14  1:50 UTC|newest]

Thread overview: 22+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-11-14  1:48 [meta-selinux][PATCH 00/19] selinux: upgrade 2.8 -> 2.9 Yi Zhao
2019-11-14  1:48 ` [meta-selinux][PATCH 01/19] python-ipy: upgrade to 1.00 and add python3 version Yi Zhao
2019-11-14  1:48 ` [meta-selinux][PATCH 02/19] selinux: uprev inc files to 2.9 (20190315) Yi Zhao
2019-11-14  1:48 ` [meta-selinux][PATCH 03/19] libsepol: uprev " Yi Zhao
2019-11-14  1:48 ` [meta-selinux][PATCH 04/19] libselinux: " Yi Zhao
2019-11-14  1:48 ` Yi Zhao [this message]
2019-11-14  1:48 ` [meta-selinux][PATCH 06/19] libsemanage: " Yi Zhao
2019-11-14  1:48 ` [meta-selinux][PATCH 07/19] checkpolicy: " Yi Zhao
2019-11-14  1:48 ` [meta-selinux][PATCH 08/19] secilc: " Yi Zhao
2019-11-14  1:48 ` [meta-selinux][PATCH 09/19] policycoreutils: " Yi Zhao
2019-11-14  1:48 ` [meta-selinux][PATCH 10/19] mcstrans: " Yi Zhao
2019-11-14  1:48 ` [meta-selinux][PATCH 11/19] restorecond: " Yi Zhao
2019-11-14  1:48 ` [meta-selinux][PATCH 12/19] selinux-python: " Yi Zhao
2019-11-14  1:48 ` [meta-selinux][PATCH 13/19] selinux-dbus: " Yi Zhao
2019-11-14  1:48 ` [meta-selinux][PATCH 14/19] selinux-sandbox: " Yi Zhao
2019-11-14  1:48 ` [meta-selinux][PATCH 15/19] selinux-gui: " Yi Zhao
2019-11-14  1:48 ` [meta-selinux][PATCH 16/19] semodule-utils: " Yi Zhao
2019-11-14  1:48 ` [meta-selinux][PATCH 17/19] selinux-init: fix build error when enable usrmerge feature Yi Zhao
2019-11-14  1:49 ` [meta-selinux][PATCH 18/19] setools: upgrade 4.1.1 -> 4.2.2 Yi Zhao
2019-12-19 17:32   ` Joe MacDonald
2019-12-20  0:55     ` Yi Zhao
2019-11-14  1:49 ` [meta-selinux][PATCH 19/19] audit: switch to python3 Yi Zhao

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20191114014901.22862-6-yi.zhao@windriver.com \
    --to=yi.zhao@windriver.com \
    --cc=Joe_MacDonald@mentor.com \
    --cc=joe@deserted.net \
    --cc=yocto@yoctoproject.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox