blob: f3133f9dedbcce1c742a8d04e3fee9d2f685f4a5 [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"
8LIC_FILES_CHKSUM = "file://License;md5=e2370ba375efe9e1a095c26d37e483b8"
9
10DEPENDS = "hostperl-runtime-native gperf-native"
11
12SRC_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 "
16SRC_URI:append:class-nativesdk = " \
17 file://0001-nativesdk-libcap-Raise-the-size-of-arrays-containing.patch \
18 "
19SRC_URI[sha256sum] = "0c637b8f44fc7d8627787e9cf57f15ac06c1ddccb53e41feec5496be3466f77f"
20
21UPSTREAM_CHECK_URI = "https://www.kernel.org/pub/linux/libs/security/linux-privs/${BPN}2/"
22
23inherit lib_package
24
25PACKAGECONFIG ??= "${@bb.utils.filter('DISTRO_FEATURES', 'pam', d)}"
26PACKAGECONFIG:class-native ??= ""
27
28PACKAGECONFIG[pam] = "PAM_CAP=yes,PAM_CAP=no,libpam"
29
30EXTRA_OEMAKE = " \
31 INDENT= \
32 lib='${baselib}' \
33 RAISE_SETFCAP=no \
34 DYNAMIC=yes \
35 USE_GPERF=yes \
36"
37
38EXTRA_OEMAKE:append:class-target = " SYSTEM_HEADERS=${STAGING_INCDIR}"
39
40do_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
52do_install() {
53 oe_runmake install \
54 ${PACKAGECONFIG_CONFARGS} \
55 DESTDIR="${D}" \
56 prefix="${prefix}" \
57 SBINDIR="${sbindir}"
58}
59
60do_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
71FILES:${PN}-dev += "${base_libdir}/*.so"
72
73# pam files
74FILES:${PN} += "${base_libdir}/security/*.so"
75
76BBCLASSEXTEND = "native nativesdk"