blob: 0139511d2e63b0d8f0524c12bffb3035e9a6f7d5 [file] [log] [blame]
lh758261d2023-07-13 05:52:04 -07001SUMMARY = "SELinux binary policy manipulation library"
2DESCRIPTION = "libsemanage provides an API for the manipulation of SELinux binary policies. \
3It is used by checkpolicy (the policy compiler) and similar tools, as well \
4as by programs like load_policy that need to perform specific transformations \
5on binary policies such as customizing policy boolean settings."
6SECTION = "base"
7LICENSE = "LGPLv2.1+"
8
9inherit lib_package python3native
10
11DEPENDS += "libsepol libselinux bzip2 python3 bison-native flex-native swig-native"
12DEPENDS_append_class-target = " audit"
13
14PACKAGES =+ "${PN}-python"
15
16# For /usr/libexec/selinux/semanage_migrate_store
17RDEPENDS_${PN}-python += "python3-core"
18
19FILES_${PN}-python = "${libdir}/python${PYTHON_BASEVERSION}/site-packages/* \
20 ${libexecdir}/selinux/semanage_migrate_store"
21FILES_${PN}-dbg += "${libdir}/python${PYTHON_BASEVERSION}/site-packages/.debug/*"
22
23FILES_${PN} += "${libexecdir}"
24
25EXTRA_OEMAKE_class-native += "DISABLE_AUDIT=y"
26
27do_compile_append() {
28 oe_runmake pywrap \
29 PYLIBVER='python${PYTHON_BASEVERSION}${PYTHON_ABI}' \
30 PYINC='-I${STAGING_INCDIR}/${PYLIBVER}' \
31 PYLIBS='-L${STAGING_LIBDIR}/${PYLIBVER} -l${PYLIBVER}'
32}
33
34do_install_append() {
35 oe_runmake install-pywrap \
36 PYCEXT='.so' \
37 PYLIBVER='python${PYTHON_BASEVERSION}${PYTHON_ABI}' \
38 PYTHONLIBDIR='${D}${libdir}/python${PYTHON_BASEVERSION}/site-packages'
39
40 # Update "policy-version" for semanage.conf
41 sed -i 's/^#\s*\(policy-version\s*=\).*$/\1 31/' \
42 ${D}/etc/selinux/semanage.conf
43}
44
45BBCLASSEXTEND = "native"