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