Andrew Geissler | 82c905d | 2020-04-13 13:39:40 -0500 | [diff] [blame] | 1 | SUMMARY = "Library for getting/setting POSIX.1e capabilities" |
Andrew Geissler | 90fd73c | 2021-03-05 15:25:55 -0600 | [diff] [blame] | 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." |
Andrew Geissler | 82c905d | 2020-04-13 13:39:40 -0500 | [diff] [blame] | 5 | HOMEPAGE = "http://sites.google.com/site/fullycapable/" |
Andrew Geissler | 82c905d | 2020-04-13 13:39:40 -0500 | [diff] [blame] | 6 | # no specific GPL version required |
| 7 | LICENSE = "BSD | GPLv2" |
Andrew Geissler | c926e17 | 2021-05-07 16:11:35 -0500 | [diff] [blame] | 8 | LIC_FILES_CHKSUM = "file://License;md5=e2370ba375efe9e1a095c26d37e483b8" |
Andrew Geissler | 82c905d | 2020-04-13 13:39:40 -0500 | [diff] [blame] | 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 | file://0001-tests-do-not-statically-link-a-test.patch \ |
| 16 | " |
Andrew Geissler | c926e17 | 2021-05-07 16:11:35 -0500 | [diff] [blame] | 17 | SRC_URI[sha256sum] = "e98bc4d93645082ec787730b0fd1a712b38882465c505777de17c338831ee181" |
Andrew Geissler | 82c905d | 2020-04-13 13:39:40 -0500 | [diff] [blame] | 18 | |
| 19 | UPSTREAM_CHECK_URI = "https://www.kernel.org/pub/linux/libs/security/linux-privs/${BPN}2/" |
| 20 | |
| 21 | inherit lib_package |
| 22 | |
| 23 | # do NOT pass target cflags to host compilations |
| 24 | # |
| 25 | do_configure() { |
| 26 | # libcap uses := for compilers, fortunately, it gives us a hint |
| 27 | # on what should be replaced with ?= |
| 28 | sed -e 's,:=,?=,g' -i Make.Rules |
Andrew Geissler | 4ed12e1 | 2020-06-05 18:00:41 -0500 | [diff] [blame] | 29 | sed -e 's,^BUILD_CFLAGS ?= ,BUILD_CFLAGS := $(BUILD_CFLAGS) ,' -i Make.Rules |
Andrew Geissler | 82c905d | 2020-04-13 13:39:40 -0500 | [diff] [blame] | 30 | } |
| 31 | |
| 32 | PACKAGECONFIG ??= "${@bb.utils.filter('DISTRO_FEATURES', 'pam', d)}" |
| 33 | PACKAGECONFIG_class-native ??= "" |
| 34 | |
| 35 | PACKAGECONFIG[pam] = "PAM_CAP=yes,PAM_CAP=no,libpam" |
| 36 | |
| 37 | EXTRA_OEMAKE = " \ |
| 38 | INDENT= \ |
| 39 | lib='${baselib}' \ |
| 40 | RAISE_SETFCAP=no \ |
| 41 | DYNAMIC=yes \ |
| 42 | BUILD_GPERF=yes \ |
| 43 | " |
| 44 | |
| 45 | EXTRA_OEMAKE_append_class-target = " SYSTEM_HEADERS=${STAGING_INCDIR}" |
| 46 | |
| 47 | # these are present in the libcap defaults, so include in our CFLAGS too |
| 48 | CFLAGS += "-D_LARGEFILE64_SOURCE -D_FILE_OFFSET_BITS=64" |
| 49 | |
| 50 | do_compile() { |
| 51 | oe_runmake ${PACKAGECONFIG_CONFARGS} |
| 52 | } |
| 53 | |
| 54 | do_install() { |
| 55 | oe_runmake install \ |
| 56 | ${PACKAGECONFIG_CONFARGS} \ |
| 57 | DESTDIR="${D}" \ |
| 58 | prefix="${prefix}" \ |
| 59 | SBINDIR="${sbindir}" |
| 60 | } |
| 61 | |
| 62 | do_install_append() { |
| 63 | # Move the library to base_libdir |
| 64 | install -d ${D}${base_libdir} |
| 65 | if [ ! ${D}${libdir} -ef ${D}${base_libdir} ]; then |
| 66 | mv ${D}${libdir}/libcap* ${D}${base_libdir} |
| 67 | if [ -d ${D}${libdir}/security ]; then |
| 68 | mv ${D}${libdir}/security ${D}${base_libdir} |
| 69 | fi |
| 70 | fi |
| 71 | } |
| 72 | |
| 73 | FILES_${PN}-dev += "${base_libdir}/*.so" |
| 74 | |
| 75 | # pam files |
| 76 | FILES_${PN} += "${base_libdir}/security/*.so" |
| 77 | |
| 78 | BBCLASSEXTEND = "native nativesdk" |