lh | 758261d | 2023-07-13 05:52:04 -0700 | [diff] [blame^] | 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 python3native |
| 11 | |
| 12 | DEPENDS += "python3 swig-native libpcre libsepol" |
| 13 | RDEPENDS_${PN} += "libselinux python3-core python3-shell" |
| 14 | |
| 15 | def 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) |
| 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 | INSANE_SKIP_${PN} = "dev-so" |
| 28 | |
| 29 | do_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 | |
| 36 | do_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 | } |