diff options
author | Yi Zhao <yi.zhao@windriver.com> | 2024-01-05 14:58:34 +0800 |
---|---|---|
committer | Joe MacDonald <joe@deserted.net> | 2024-01-24 10:20:31 -0500 |
commit | 39a5525a22442b5766154f46852cd37ef2d23699 (patch) | |
tree | 70e485cdeaf865407b8783ca39870c4629bf49bc | |
parent | 7d5dc44b356d16290a36f0399f2d175b88eba83e (diff) | |
download | meta-selinux-39a5525a22442b5766154f46852cd37ef2d23699.tar.gz |
libselinux-python: add recipe
We merged libselinux recipe and libselinux-python recipe in commit[1]
because we thought the circular dependency was gone. But unfortunately,
it still exists.
Here are the steps to reproduce:
$ echo "DISTRO_FEATURES:append = \" x11\"" >> conf/local.conf
$ echo "PACKAGECONFIG:append:pn-python3 = \" tk\"" >> conf/local.conf
$ bitbake core-image-selinux -n
So we still need to split the libselinux recipe into two recipes:
libselinux and libselinux-python.
[1] https://git.yoctoproject.org/meta-selinux/commit/?id=62b9c816a5000dc01b28e78213bde26b58cbca9d
Signed-off-by: Yi Zhao <yi.zhao@windriver.com>
Signed-off-by: Joe MacDonald <joe@deserted.net>
-rw-r--r-- | recipes-security/selinux/libselinux-python_3.6.bb | 57 | ||||
-rw-r--r-- | recipes-security/selinux/libselinux_3.6.bb | 31 |
2 files changed, 59 insertions, 29 deletions
diff --git a/recipes-security/selinux/libselinux-python_3.6.bb b/recipes-security/selinux/libselinux-python_3.6.bb new file mode 100644 index 0000000..3c5c489 --- /dev/null +++ b/recipes-security/selinux/libselinux-python_3.6.bb | |||
@@ -0,0 +1,57 @@ | |||
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 | LIC_FILES_CHKSUM = "file://${S}/LICENSE;md5=84b4d2c6ef954a2d4081e775a270d0d0" | ||
8 | |||
9 | require selinux_common.inc | ||
10 | |||
11 | inherit python3targetconfig pkgconfig | ||
12 | |||
13 | FILESEXTRAPATHS:prepend := "${THISDIR}/libselinux:" | ||
14 | SRC_URI += "\ | ||
15 | file://0001-Makefile-fix-python-modules-install-path-for-multili.patch \ | ||
16 | file://0002-Do-not-use-PYCEXT-and-rely-on-the-installed-file-nam.patch \ | ||
17 | file://0003-libselinux-restore-drop-the-obsolete-LSF-transitiona.patch \ | ||
18 | " | ||
19 | |||
20 | S = "${WORKDIR}/git/libselinux" | ||
21 | |||
22 | DEPENDS = "libsepol libpcre2 swig-native python3-setuptools-scm-native" | ||
23 | DEPENDS:append:libc-musl = " fts" | ||
24 | |||
25 | RDEPENDS:${PN} = "libselinux python3-core python3-shell" | ||
26 | |||
27 | def get_policyconfigarch(d): | ||
28 | import re | ||
29 | target = d.getVar('TARGET_ARCH') | ||
30 | p = re.compile('i.86') | ||
31 | target = p.sub('i386',target) | ||
32 | return "ARCH=%s" % (target) | ||
33 | |||
34 | EXTRA_OEMAKE = "${@get_policyconfigarch(d)}" | ||
35 | EXTRA_OEMAKE:append:libc-musl = " FTS_LDLIBS=-lfts" | ||
36 | |||
37 | FILES:${PN} = "${PYTHON_SITEPACKAGES_DIR}/*" | ||
38 | INSANE_SKIP:${PN} = "dev-so" | ||
39 | |||
40 | do_compile() { | ||
41 | oe_runmake pywrap -j1 \ | ||
42 | PYLIBVER='python${PYTHON_BASEVERSION}' \ | ||
43 | PYINC='-I${STAGING_INCDIR}/${PYLIBVER}' \ | ||
44 | PYLIBS='-L${STAGING_LIBDIR}/${PYLIBVER} -l${PYLIBVER}' | ||
45 | } | ||
46 | |||
47 | do_install() { | ||
48 | oe_runmake install-pywrap \ | ||
49 | DESTDIR=${D} \ | ||
50 | PREFIX=${prefix} | ||
51 | PYLIBVER='python${PYTHON_BASEVERSION}' \ | ||
52 | PYTHONLIBDIR='${PYTHON_SITEPACKAGES_DIR}' | ||
53 | |||
54 | # Fix buildpaths issue | ||
55 | sed -i -e 's,${WORKDIR},,g' \ | ||
56 | ${D}${PYTHON_SITEPACKAGES_DIR}/selinux-${PV}.dist-info/direct_url.json | ||
57 | } | ||
diff --git a/recipes-security/selinux/libselinux_3.6.bb b/recipes-security/selinux/libselinux_3.6.bb index dab4965..b0dcde6 100644 --- a/recipes-security/selinux/libselinux_3.6.bb +++ b/recipes-security/selinux/libselinux_3.6.bb | |||
@@ -8,18 +8,16 @@ LIC_FILES_CHKSUM = "file://${S}/LICENSE;md5=84b4d2c6ef954a2d4081e775a270d0d0" | |||
8 | 8 | ||
9 | require selinux_common.inc | 9 | require selinux_common.inc |
10 | 10 | ||
11 | inherit lib_package pkgconfig python3targetconfig | 11 | inherit lib_package pkgconfig |
12 | 12 | ||
13 | FILESEXTRAPATHS:prepend := "${THISDIR}/libselinux:" | 13 | FILESEXTRAPATHS:prepend := "${THISDIR}/libselinux:" |
14 | SRC_URI += "\ | 14 | SRC_URI += "\ |
15 | file://0001-Makefile-fix-python-modules-install-path-for-multili.patch \ | ||
16 | file://0002-Do-not-use-PYCEXT-and-rely-on-the-installed-file-nam.patch \ | ||
17 | file://0003-libselinux-restore-drop-the-obsolete-LSF-transitiona.patch \ | 15 | file://0003-libselinux-restore-drop-the-obsolete-LSF-transitiona.patch \ |
18 | " | 16 | " |
19 | 17 | ||
20 | S = "${WORKDIR}/git/libselinux" | 18 | S = "${WORKDIR}/git/libselinux" |
21 | 19 | ||
22 | DEPENDS = "libsepol libpcre2 swig-native python3-setuptools-scm-native" | 20 | DEPENDS = "libsepol libpcre2" |
23 | DEPENDS:append:libc-musl = " fts" | 21 | DEPENDS:append:libc-musl = " fts" |
24 | 22 | ||
25 | def get_policyconfigarch(d): | 23 | def get_policyconfigarch(d): |
@@ -32,29 +30,4 @@ def get_policyconfigarch(d): | |||
32 | EXTRA_OEMAKE = "${@get_policyconfigarch(d)}" | 30 | EXTRA_OEMAKE = "${@get_policyconfigarch(d)}" |
33 | EXTRA_OEMAKE:append:libc-musl = " FTS_LDLIBS=-lfts" | 31 | EXTRA_OEMAKE:append:libc-musl = " FTS_LDLIBS=-lfts" |
34 | 32 | ||
35 | do_compile:append() { | ||
36 | oe_runmake pywrap -j1 \ | ||
37 | PYLIBVER='python${PYTHON_BASEVERSION}' \ | ||
38 | PYINC='-I${STAGING_INCDIR}/${PYLIBVER}' \ | ||
39 | PYLIBS='-L${STAGING_LIBDIR}/${PYLIBVER} -l${PYLIBVER}' | ||
40 | } | ||
41 | |||
42 | do_install:append() { | ||
43 | oe_runmake install-pywrap \ | ||
44 | DESTDIR=${D} \ | ||
45 | PREFIX=${prefix} | ||
46 | PYLIBVER='python${PYTHON_BASEVERSION}' \ | ||
47 | PYTHONLIBDIR='${PYTHON_SITEPACKAGES_DIR}' | ||
48 | |||
49 | # Fix buildpaths issue | ||
50 | sed -i -e 's,${WORKDIR},,g' \ | ||
51 | ${D}${PYTHON_SITEPACKAGES_DIR}/selinux-${PV}.dist-info/direct_url.json | ||
52 | } | ||
53 | |||
54 | PACKAGES += "${PN}-python" | ||
55 | RDEPENDS:${PN}-python = "python3-core python3-shell" | ||
56 | |||
57 | FILES:${PN}-python = "${PYTHON_SITEPACKAGES_DIR}/*" | ||
58 | INSANE_SKIP:${PN}-python = "dev-so" | ||
59 | |||
60 | BBCLASSEXTEND = "native" | 33 | BBCLASSEXTEND = "native" |