blob: 7690d3e9a5f9bbd4fc6706c15f3a196405ae2d22 [file] [log] [blame]
Andrew Geissler7e0e3c02022-02-25 20:34:39 +00001SUMMARY = "Library for getting/setting POSIX.1e capabilities"
2DESCRIPTION = "A library providing the API to access POSIX capabilities. \
3These allow giving various kinds of specific privileges to individual \
4users, without giving them full root permissions."
5HOMEPAGE = "http://sites.google.com/site/fullycapable/"
6# no specific GPL version required
7LICENSE = "BSD-3-Clause | GPL-2.0-only"
Patrick Williams03907ee2022-05-01 06:28:52 -05008LIC_FILES_CHKSUM_PAM = "file://pam_cap/License;md5=0ad4c9c052b9719ee4fce1bfc7c7dee4"
9LIC_FILES_CHKSUM = "\
10 file://License;md5=e2370ba375efe9e1a095c26d37e483b8 \
11 ${@bb.utils.contains('PACKAGECONFIG', 'pam', '${LIC_FILES_CHKSUM_PAM}', '', d)} \
12"
Andrew Geissler7e0e3c02022-02-25 20:34:39 +000013
14DEPENDS = "hostperl-runtime-native gperf-native"
15
16SRC_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 "
20SRC_URI:append:class-nativesdk = " \
21 file://0001-nativesdk-libcap-Raise-the-size-of-arrays-containing.patch \
22 "
Patrick Williams03907ee2022-05-01 06:28:52 -050023SRC_URI[sha256sum] = "c8465e1f0b068d5fc06199231135ccac7adb56d662b1de93589252e8cd071e13"
Andrew Geissler7e0e3c02022-02-25 20:34:39 +000024
25UPSTREAM_CHECK_URI = "https://www.kernel.org/pub/linux/libs/security/linux-privs/${BPN}2/"
26
27inherit lib_package
28
29PACKAGECONFIG ??= "${@bb.utils.filter('DISTRO_FEATURES', 'pam', d)}"
30PACKAGECONFIG:class-native ??= ""
31
32PACKAGECONFIG[pam] = "PAM_CAP=yes,PAM_CAP=no,libpam"
33
34EXTRA_OEMAKE = " \
35 INDENT= \
36 lib='${baselib}' \
37 RAISE_SETFCAP=no \
38 DYNAMIC=yes \
39 USE_GPERF=yes \
40"
41
42EXTRA_OEMAKE:append:class-target = " SYSTEM_HEADERS=${STAGING_INCDIR}"
43
44do_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
56do_install() {
57 oe_runmake install \
58 ${PACKAGECONFIG_CONFARGS} \
59 DESTDIR="${D}" \
60 prefix="${prefix}" \
61 SBINDIR="${sbindir}"
62}
63
64do_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
75FILES:${PN}-dev += "${base_libdir}/*.so"
76
77# pam files
78FILES:${PN} += "${base_libdir}/security/*.so"
79
80BBCLASSEXTEND = "native nativesdk"