blob: 3f4a9256cf4a3ece2278ecc929556eaa01dfd73e [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
7LICENSE = "BSD | 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 Geisslerc926e172021-05-07 16:11:35 -050017SRC_URI[sha256sum] = "e98bc4d93645082ec787730b0fd1a712b38882465c505777de17c338831ee181"
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
23# do NOT pass target cflags to host compilations
24#
25do_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 Geissler4ed12e12020-06-05 18:00:41 -050029 sed -e 's,^BUILD_CFLAGS ?= ,BUILD_CFLAGS := $(BUILD_CFLAGS) ,' -i Make.Rules
Andrew Geissler82c905d2020-04-13 13:39:40 -050030}
31
32PACKAGECONFIG ??= "${@bb.utils.filter('DISTRO_FEATURES', 'pam', d)}"
33PACKAGECONFIG_class-native ??= ""
34
35PACKAGECONFIG[pam] = "PAM_CAP=yes,PAM_CAP=no,libpam"
36
37EXTRA_OEMAKE = " \
38 INDENT= \
39 lib='${baselib}' \
40 RAISE_SETFCAP=no \
41 DYNAMIC=yes \
42 BUILD_GPERF=yes \
43"
44
45EXTRA_OEMAKE_append_class-target = " SYSTEM_HEADERS=${STAGING_INCDIR}"
46
47# these are present in the libcap defaults, so include in our CFLAGS too
48CFLAGS += "-D_LARGEFILE64_SOURCE -D_FILE_OFFSET_BITS=64"
49
50do_compile() {
51 oe_runmake ${PACKAGECONFIG_CONFARGS}
52}
53
54do_install() {
55 oe_runmake install \
56 ${PACKAGECONFIG_CONFARGS} \
57 DESTDIR="${D}" \
58 prefix="${prefix}" \
59 SBINDIR="${sbindir}"
60}
61
62do_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
73FILES_${PN}-dev += "${base_libdir}/*.so"
74
75# pam files
76FILES_${PN} += "${base_libdir}/security/*.so"
77
78BBCLASSEXTEND = "native nativesdk"