blob: a12738d63ab54c46e5c365ac6270315ce2d21a4b [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"
8LIC_FILES_CHKSUM = "file://License;md5=3f84fd6f29d453a56514cb7e4ead25f1"
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 file://0001-tests-do-not-statically-link-a-test.patch \
16 "
Andrew Geissler9b4d8b02021-02-19 12:26:16 -060017SRC_URI[sha256sum] = "4de9590ee09a87c282d558737ffb5b6175ccbfd26d580add10df44d0f047f6c2"
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"