blob: 3760fd88d0529d11d1ac11e0f60a062014ae9db3 [file] [log] [blame]
lh758261d2023-07-13 05:52:04 -07001SUMMARY = "SELinux library and simple utilities"
2DESCRIPTION = "libselinux provides an API for SELinux applications to get and set \
3process and file security contexts and to obtain security policy \
4decisions. Required for any applications that use the SELinux API."
5SECTION = "base"
6LICENSE = "PD"
7
8FILESEXTRAPATHS_prepend := "${THISDIR}/libselinux:"
9
10inherit python3native
11
12DEPENDS += "python3 swig-native libpcre libsepol"
13RDEPENDS_${PN} += "libselinux python3-core python3-shell"
14
15def get_policyconfigarch(d):
16 import re
17 target = d.getVar('TARGET_ARCH')
18 p = re.compile('i.86')
19 target = p.sub('i386',target)
20 return "ARCH=%s" % (target)
21EXTRA_OEMAKE += "${@get_policyconfigarch(d)}"
22
23EXTRA_OEMAKE += "LDFLAGS='${LDFLAGS} -lpcre' LIBSEPOLA='${STAGING_LIBDIR}/libsepol.a'"
24EXTRA_OEMAKE_append_libc-musl = " FTS_LDLIBS=-lfts"
25
26FILES_${PN} = "${libdir}/python${PYTHON_BASEVERSION}/site-packages/*"
27INSANE_SKIP_${PN} = "dev-so"
28
29do_compile() {
30 oe_runmake pywrap -j1 \
31 PYLIBVER='python${PYTHON_BASEVERSION}${PYTHON_ABI}' \
32 PYINC='-I${STAGING_INCDIR}/${PYLIBVER}' \
33 PYLIBS='-L${STAGING_LIBDIR}/${PYLIBVER} -l${PYLIBVER}'
34}
35
36do_install() {
37 oe_runmake install-pywrap \
38 DESTDIR=${D} \
39 PYLIBVER='python${PYTHON_BASEVERSION}${PYTHON_ABI}' \
40 PYTHONLIBDIR='${libdir}/python${PYTHON_BASEVERSION}/site-packages'
41}