Patrick Williams | 92b42cb | 2022-09-03 06:53:57 -0500 | [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 | GPL-2.0-only" |
| 8 | LIC_FILES_CHKSUM_PAM = "file://pam_cap/License;md5=0ad4c9c052b9719ee4fce1bfc7c7dee4" |
| 9 | LIC_FILES_CHKSUM = "\ |
| 10 | file://License;md5=e2370ba375efe9e1a095c26d37e483b8 \ |
| 11 | ${@bb.utils.contains('PACKAGECONFIG', 'pam', '${LIC_FILES_CHKSUM_PAM}', '', d)} \ |
| 12 | " |
| 13 | |
| 14 | DEPENDS = "hostperl-runtime-native gperf-native" |
| 15 | |
| 16 | SRC_URI = "${KERNELORG_MIRROR}/linux/libs/security/linux-privs/${BPN}2/${BPN}-${PV}.tar.xz \ |
| 17 | file://0001-ensure-the-XATTR_NAME_CAPS-is-defined-when-it-is-use.patch \ |
| 18 | file://0002-tests-do-not-run-target-executables.patch \ |
| 19 | " |
| 20 | SRC_URI:append:class-nativesdk = " \ |
| 21 | file://0001-nativesdk-libcap-Raise-the-size-of-arrays-containing.patch \ |
| 22 | " |
| 23 | SRC_URI[sha256sum] = "73e350020cc31fe15360879d19384ffa3395a825f065fcf6bda3a5cdf965bebd" |
| 24 | |
| 25 | UPSTREAM_CHECK_URI = "https://www.kernel.org/pub/linux/libs/security/linux-privs/${BPN}2/" |
| 26 | |
| 27 | inherit lib_package |
| 28 | |
| 29 | PACKAGECONFIG ??= "${@bb.utils.filter('DISTRO_FEATURES', 'pam', d)}" |
| 30 | PACKAGECONFIG:class-native ??= "" |
| 31 | |
| 32 | PACKAGECONFIG[pam] = "PAM_CAP=yes,PAM_CAP=no,libpam" |
| 33 | |
| 34 | EXTRA_OEMAKE = " \ |
| 35 | INDENT= \ |
| 36 | lib='${baselib}' \ |
| 37 | RAISE_SETFCAP=no \ |
| 38 | DYNAMIC=yes \ |
| 39 | USE_GPERF=yes \ |
| 40 | " |
| 41 | |
| 42 | EXTRA_OEMAKE:append:class-target = " SYSTEM_HEADERS=${STAGING_INCDIR}" |
| 43 | |
| 44 | do_compile() { |
| 45 | unset CFLAGS BUILD_CFLAGS |
| 46 | oe_runmake \ |
| 47 | ${PACKAGECONFIG_CONFARGS} \ |
| 48 | AR="${AR}" \ |
| 49 | CC="${CC}" \ |
| 50 | RANLIB="${RANLIB}" \ |
| 51 | OBJCOPY="${OBJCOPY}" \ |
| 52 | COPTS="${CFLAGS}" \ |
| 53 | BUILD_COPTS="${BUILD_CFLAGS}" |
| 54 | } |
| 55 | |
| 56 | do_install() { |
| 57 | oe_runmake install \ |
| 58 | ${PACKAGECONFIG_CONFARGS} \ |
| 59 | DESTDIR="${D}" \ |
| 60 | prefix="${prefix}" \ |
| 61 | SBINDIR="${sbindir}" |
| 62 | } |
| 63 | |
| 64 | do_install:append() { |
| 65 | # Move the library to base_libdir |
| 66 | install -d ${D}${base_libdir} |
| 67 | if [ ! ${D}${libdir} -ef ${D}${base_libdir} ]; then |
| 68 | mv ${D}${libdir}/libcap* ${D}${base_libdir} |
| 69 | if [ -d ${D}${libdir}/security ]; then |
| 70 | mv ${D}${libdir}/security ${D}${base_libdir} |
| 71 | fi |
| 72 | fi |
| 73 | } |
| 74 | |
| 75 | FILES:${PN}-dev += "${base_libdir}/*.so" |
| 76 | |
| 77 | # pam files |
| 78 | FILES:${PN} += "${base_libdir}/security/*.so" |
| 79 | |
| 80 | BBCLASSEXTEND = "native nativesdk" |