blob: c9c30fb05f54e8b22b1304aff9ae909877d79cec [file] [log] [blame]
Andrew Geissler82c905d2020-04-13 13:39:40 -05001SUMMARY = "Library for getting/setting POSIX.1e capabilities"
Andrew Geissler90fd73c2021-03-05 15:25:55 -06002DESCRIPTION = "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."
Andrew Geissler82c905d2020-04-13 13:39:40 -05005HOMEPAGE = "http://sites.google.com/site/fullycapable/"
Andrew Geissler82c905d2020-04-13 13:39:40 -05006# no specific GPL version required
Andrew Geisslerd159c7f2021-09-02 21:05:58 -05007LICENSE = "BSD-3-Clause | GPLv2"
Andrew Geisslerc926e172021-05-07 16:11:35 -05008LIC_FILES_CHKSUM = "file://License;md5=e2370ba375efe9e1a095c26d37e483b8"
Andrew Geissler82c905d2020-04-13 13:39:40 -05009
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 file://0001-tests-do-not-statically-link-a-test.patch \
16 "
Andrew Geissler5f350902021-07-23 13:09:54 -040017SRC_URI[sha256sum] = "6609f3ab7aebcc8f9277f53a577c657d9f3056d1352ea623da7fd7c0f00890f9"
Andrew Geissler82c905d2020-04-13 13:39:40 -050018
19UPSTREAM_CHECK_URI = "https://www.kernel.org/pub/linux/libs/security/linux-privs/${BPN}2/"
20
21inherit lib_package
22
Andrew Geissler82c905d2020-04-13 13:39:40 -050023PACKAGECONFIG ??= "${@bb.utils.filter('DISTRO_FEATURES', 'pam', d)}"
Patrick Williams213cb262021-08-07 19:21:33 -050024PACKAGECONFIG:class-native ??= ""
Andrew Geissler82c905d2020-04-13 13:39:40 -050025
26PACKAGECONFIG[pam] = "PAM_CAP=yes,PAM_CAP=no,libpam"
27
28EXTRA_OEMAKE = " \
29 INDENT= \
30 lib='${baselib}' \
31 RAISE_SETFCAP=no \
32 DYNAMIC=yes \
33 BUILD_GPERF=yes \
34"
35
Patrick Williams213cb262021-08-07 19:21:33 -050036EXTRA_OEMAKE:append:class-target = " SYSTEM_HEADERS=${STAGING_INCDIR}"
Andrew Geissler82c905d2020-04-13 13:39:40 -050037
Andrew Geissler82c905d2020-04-13 13:39:40 -050038do_compile() {
William A. Kennington IIIac69b482021-06-02 12:28:27 -070039 unset CFLAGS BUILD_CFLAGS
40 oe_runmake \
41 ${PACKAGECONFIG_CONFARGS} \
42 AR="${AR}" \
43 CC="${CC}" \
44 RANLIB="${RANLIB}" \
45 COPTS="${CFLAGS}" \
46 BUILD_COPTS="${BUILD_CFLAGS}"
Andrew Geissler82c905d2020-04-13 13:39:40 -050047}
48
49do_install() {
50 oe_runmake install \
51 ${PACKAGECONFIG_CONFARGS} \
52 DESTDIR="${D}" \
53 prefix="${prefix}" \
54 SBINDIR="${sbindir}"
55}
56
Patrick Williams213cb262021-08-07 19:21:33 -050057do_install:append() {
Andrew Geissler82c905d2020-04-13 13:39:40 -050058 # Move the library to base_libdir
59 install -d ${D}${base_libdir}
60 if [ ! ${D}${libdir} -ef ${D}${base_libdir} ]; then
61 mv ${D}${libdir}/libcap* ${D}${base_libdir}
62 if [ -d ${D}${libdir}/security ]; then
63 mv ${D}${libdir}/security ${D}${base_libdir}
64 fi
65 fi
66}
67
Patrick Williams213cb262021-08-07 19:21:33 -050068FILES:${PN}-dev += "${base_libdir}/*.so"
Andrew Geissler82c905d2020-04-13 13:39:40 -050069
70# pam files
Patrick Williams213cb262021-08-07 19:21:33 -050071FILES:${PN} += "${base_libdir}/security/*.so"
Andrew Geissler82c905d2020-04-13 13:39:40 -050072
73BBCLASSEXTEND = "native nativesdk"