Files
poky/meta/recipes-support/libcap/libcap_2.76.bb
Khem Raj 7c8852a599 libcap: Pass OE defined BUILD_CC and BUILD_LDFLAGS
This ensures that, native pieces in target builds
are build with correct flags to be able to run on build host

(From OE-Core rev: c82e49d1707f2057baa3f7fbaeea0b785712a11f)

Signed-off-by: Khem Raj <raj.khem@gmail.com>
Signed-off-by: Mathieu Dubois-Briand <mathieu.dubois-briand@bootlin.com>
Signed-off-by: Ross Burton <ross.burton@arm.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2025-10-27 11:37:43 +00:00

75 lines
2.3 KiB
BlitzBasic

SUMMARY = "Library for getting/setting POSIX.1e capabilities"
DESCRIPTION = "A library providing the API to access POSIX capabilities. \
These allow giving various kinds of specific privileges to individual \
users, without giving them full root permissions."
HOMEPAGE = "http://sites.google.com/site/fullycapable/"
# The library is BSD | GPLv2, the PAM module is BSD | LGPLv2+
LICENSE = "(BSD-3-Clause | GPL-2.0-only) & (BSD-3-Clause | LGPL-2.0-or-later)"
LIC_FILES_CHKSUM = "file://License;md5=2965a646645b72ecee859b43c592dcaa \
file://pam_cap/License;md5=905326f41d3d1f8df21943f9a4ed6b50 \
"
DEPENDS = "hostperl-runtime-native gperf-native"
SRC_URI = "${KERNELORG_MIRROR}/linux/libs/security/linux-privs/${BPN}2/${BPN}-${PV}.tar.xz \
file://0001-libcap-Add-build-ldflags-to-_makenames-rule.patch \
"
SRC_URI:append:class-nativesdk = " \
file://0001-nativesdk-libcap-Raise-the-size-of-arrays-containing.patch \
"
SRC_URI[sha256sum] = "629da4ab29900d0f7fcc36227073743119925fd711c99a1689bbf5c9b40c8e6f"
UPSTREAM_CHECK_URI = "https://www.kernel.org/pub/linux/libs/security/linux-privs/${BPN}2/"
inherit lib_package
PACKAGECONFIG ??= "${@bb.utils.filter('DISTRO_FEATURES', 'pam', d)}"
PACKAGECONFIG[pam] = "PAM_CAP=yes,PAM_CAP=no,libpam"
EXTRA_OEMAKE = " \
${PACKAGECONFIG_CONFARGS} \
INDENT= \
lib='${baselib}' \
RAISE_SETFCAP=no \
DYNAMIC=yes \
USE_GPERF=yes \
"
do_compile() {
oe_runmake \
AR="${AR}" \
BUILD_CC="${BUILD_CC}" \
BUILD_LDFLAGS="${BUILD_LDFLAGS}" \
CC="${CC}" \
RANLIB="${RANLIB}" \
OBJCOPY="${OBJCOPY}"
}
do_install() {
oe_runmake install \
DESTDIR="${D}" \
prefix="${prefix}" \
SBINDIR="${sbindir}"
}
do_install:append() {
# Move the library to base_libdir
install -d ${D}${base_libdir}
if [ ! ${D}${libdir} -ef ${D}${base_libdir} ]; then
mv ${D}${libdir}/libcap* ${D}${base_libdir}
if [ -d ${D}${libdir}/security ]; then
mv ${D}${libdir}/security ${D}${base_libdir}
fi
fi
}
# pam files
FILES:${PN} += "${base_libdir}/security/*.so"
# The license of the main package depends on whether PAM is enabled or not
LICENSE:${PN} = "(BSD-3-Clause | GPL-2.0-only)${@bb.utils.contains('PACKAGECONFIG', 'pam', ' & (BSD-3-Clause | LGPL-2.0-or-later)', '', d)}"
LICENSE:${PN}-dev = "(BSD-3-Clause | GPL-2.0-only)"
BBCLASSEXTEND = "native nativesdk"