Andrew Geissler | 595f630 | 2022-01-24 19:11:47 +0000 | [diff] [blame] | 1 | SUMMARY = "Library for getting/setting POSIX.1e capabilities" |
| 2 | DESCRIPTION = "A library providing the API to access POSIX capabilities. \ |
| 3 | These allow giving various kinds of specific privileges to individual \ |
| 4 | users, without giving them full root permissions." |
| 5 | HOMEPAGE = "http://sites.google.com/site/fullycapable/" |
| 6 | # no specific GPL version required |
| 7 | LICENSE = "BSD-3-Clause | GPLv2" |
| 8 | LIC_FILES_CHKSUM = "file://License;md5=e2370ba375efe9e1a095c26d37e483b8" |
| 9 | |
| 10 | DEPENDS = "hostperl-runtime-native gperf-native" |
| 11 | |
| 12 | SRC_URI = "${KERNELORG_MIRROR}/linux/libs/security/linux-privs/${BPN}2/${BPN}-${PV}.tar.xz \ |
| 13 | file://0001-ensure-the-XATTR_NAME_CAPS-is-defined-when-it-is-use.patch \ |
| 14 | file://0002-tests-do-not-run-target-executables.patch \ |
| 15 | " |
| 16 | SRC_URI:append:class-nativesdk = " \ |
| 17 | file://0001-nativesdk-libcap-Raise-the-size-of-arrays-containing.patch \ |
| 18 | " |
| 19 | SRC_URI[sha256sum] = "190c5baac9bee06a129eae20d3e827de62f664fe3507f0bf6c50a9a59fbd83a2" |
| 20 | |
| 21 | UPSTREAM_CHECK_URI = "https://www.kernel.org/pub/linux/libs/security/linux-privs/${BPN}2/" |
| 22 | |
| 23 | inherit lib_package |
| 24 | |
| 25 | PACKAGECONFIG ??= "${@bb.utils.filter('DISTRO_FEATURES', 'pam', d)}" |
| 26 | PACKAGECONFIG:class-native ??= "" |
| 27 | |
| 28 | PACKAGECONFIG[pam] = "PAM_CAP=yes,PAM_CAP=no,libpam" |
| 29 | |
| 30 | EXTRA_OEMAKE = " \ |
| 31 | INDENT= \ |
| 32 | lib='${baselib}' \ |
| 33 | RAISE_SETFCAP=no \ |
| 34 | DYNAMIC=yes \ |
| 35 | USE_GPERF=yes \ |
| 36 | " |
| 37 | |
| 38 | EXTRA_OEMAKE:append:class-target = " SYSTEM_HEADERS=${STAGING_INCDIR}" |
| 39 | |
| 40 | do_compile() { |
| 41 | unset CFLAGS BUILD_CFLAGS |
| 42 | oe_runmake \ |
| 43 | ${PACKAGECONFIG_CONFARGS} \ |
| 44 | AR="${AR}" \ |
| 45 | CC="${CC}" \ |
| 46 | RANLIB="${RANLIB}" \ |
| 47 | OBJCOPY="${OBJCOPY}" \ |
| 48 | COPTS="${CFLAGS}" \ |
| 49 | BUILD_COPTS="${BUILD_CFLAGS}" |
| 50 | } |
| 51 | |
| 52 | do_install() { |
| 53 | oe_runmake install \ |
| 54 | ${PACKAGECONFIG_CONFARGS} \ |
| 55 | DESTDIR="${D}" \ |
| 56 | prefix="${prefix}" \ |
| 57 | SBINDIR="${sbindir}" |
| 58 | } |
| 59 | |
| 60 | do_install:append() { |
| 61 | # Move the library to base_libdir |
| 62 | install -d ${D}${base_libdir} |
| 63 | if [ ! ${D}${libdir} -ef ${D}${base_libdir} ]; then |
| 64 | mv ${D}${libdir}/libcap* ${D}${base_libdir} |
| 65 | if [ -d ${D}${libdir}/security ]; then |
| 66 | mv ${D}${libdir}/security ${D}${base_libdir} |
| 67 | fi |
| 68 | fi |
| 69 | } |
| 70 | |
| 71 | FILES:${PN}-dev += "${base_libdir}/*.so" |
| 72 | |
| 73 | # pam files |
| 74 | FILES:${PN} += "${base_libdir}/security/*.so" |
| 75 | |
| 76 | BBCLASSEXTEND = "native nativesdk" |