blob: 3f64ff76364927e065a31af5d763f7ff29731c9a [file] [log] [blame]
Brad Bishopc342db32019-05-15 21:57:59 -04001SUMMARY = "Library for getting/setting POSIX.1e capabilities"
2HOMEPAGE = "http://sites.google.com/site/fullycapable/"
3
4# no specific GPL version required
5LICENSE = "BSD | GPLv2"
6LIC_FILES_CHKSUM = "file://License;md5=3f84fd6f29d453a56514cb7e4ead25f1"
7
8DEPENDS = "hostperl-runtime-native gperf-native"
9
10SRC_URI = "${KERNELORG_MIRROR}/linux/libs/security/linux-privs/${BPN}2/${BPN}-${PV}.tar.xz \
11 file://0001-ensure-the-XATTR_NAME_CAPS-is-defined-when-it-is-use.patch \
12 "
13SRC_URI[md5sum] = "2e8f9fab32eb5ccb37969fe317fd17aa"
14SRC_URI[sha256sum] = "dac1792d0118bee6aae6ba7fb93ff1602c6a9bda812fd63916eee1435b9c486a"
15
Brad Bishopf3f93bb2019-10-16 14:33:32 -040016UPSTREAM_CHECK_URI = "https://www.kernel.org/pub/linux/libs/security/linux-privs/${BPN}2/"
17
Brad Bishopc342db32019-05-15 21:57:59 -040018inherit lib_package
19
20# do NOT pass target cflags to host compilations
21#
22do_configure() {
23 # libcap uses := for compilers, fortunately, it gives us a hint
24 # on what should be replaced with ?=
25 sed -e 's,:=,?=,g' -i Make.Rules
26 sed -e 's,^BUILD_CFLAGS ?= $(.*CFLAGS),BUILD_CFLAGS := $(BUILD_CFLAGS),' -i Make.Rules
27}
28
29PACKAGECONFIG ??= "${@bb.utils.filter('DISTRO_FEATURES', 'pam', d)}"
30PACKAGECONFIG_class-native ??= ""
31
32PACKAGECONFIG[pam] = "PAM_CAP=yes,PAM_CAP=no,libpam"
33
34EXTRA_OEMAKE = " \
35 INDENT= \
36 lib='${baselib}' \
37 RAISE_SETFCAP=no \
38 DYNAMIC=yes \
39 BUILD_GPERF=yes \
40"
41
42EXTRA_OEMAKE_append_class-target = " SYSTEM_HEADERS=${STAGING_INCDIR}"
43
44# these are present in the libcap defaults, so include in our CFLAGS too
45CFLAGS += "-D_LARGEFILE64_SOURCE -D_FILE_OFFSET_BITS=64"
46
47do_compile() {
48 oe_runmake ${PACKAGECONFIG_CONFARGS}
49}
50
51do_install() {
52 oe_runmake install \
53 ${PACKAGECONFIG_CONFARGS} \
54 DESTDIR="${D}" \
55 prefix="${prefix}" \
56 SBINDIR="${sbindir}"
57}
58
59do_install_append() {
60 # Move the library to base_libdir
61 install -d ${D}${base_libdir}
62 if [ ! ${D}${libdir} -ef ${D}${base_libdir} ]; then
63 mv ${D}${libdir}/libcap* ${D}${base_libdir}
64 if [ -d ${D}${libdir}/security ]; then
65 mv ${D}${libdir}/security ${D}${base_libdir}
66 fi
67 fi
68}
69
70FILES_${PN}-dev += "${base_libdir}/*.so"
71
72# pam files
73FILES_${PN} += "${base_libdir}/security/*.so"
74
75BBCLASSEXTEND = "native nativesdk"