blob: d619a2eb4cc91c5b0c9b51502d39395b610d7b64 [file] [log] [blame]
Patrick Williamsc0f7c042017-02-23 20:41:17 -06001SUMMARY = "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
Brad Bishop6e60e8b2018-02-01 10:27:11 -05008DEPENDS = "hostperl-runtime-native gperf-native"
Patrick Williamsc0f7c042017-02-23 20:41:17 -06009
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 \
Brad Bishopd7bf8c12018-02-25 22:55:05 -050012 file://0001-Fix-build-with-gperf-3.1.patch \
13 "
Patrick Williamsc0f7c042017-02-23 20:41:17 -060014SRC_URI[md5sum] = "6666b839e5d46c2ad33fc8aa2ceb5f77"
15SRC_URI[sha256sum] = "693c8ac51e983ee678205571ef272439d83afe62dd8e424ea14ad9790bc35162"
16
17inherit lib_package
18
19# do NOT pass target cflags to host compilations
20#
21do_configure() {
22 # libcap uses := for compilers, fortunately, it gives us a hint
23 # on what should be replaced with ?=
24 sed -e 's,:=,?=,g' -i Make.Rules
25 sed -e 's,^BUILD_CFLAGS ?= $(.*CFLAGS),BUILD_CFLAGS := $(BUILD_CFLAGS),' -i Make.Rules
Patrick Williamsc0f7c042017-02-23 20:41:17 -060026}
27
Brad Bishop6e60e8b2018-02-01 10:27:11 -050028PACKAGECONFIG ??= "${@bb.utils.filter('DISTRO_FEATURES', 'pam', d)}"
Patrick Williamsc0f7c042017-02-23 20:41:17 -060029PACKAGECONFIG_class-native ??= ""
30
Patrick Williamsc0f7c042017-02-23 20:41:17 -060031PACKAGECONFIG[pam] = "PAM_CAP=yes,PAM_CAP=no,libpam"
32
33EXTRA_OEMAKE = " \
34 INDENT= \
35 lib=${@os.path.basename('${libdir}')} \
36 RAISE_SETFCAP=no \
37 DYNAMIC=yes \
Brad Bishopd7bf8c12018-02-25 22:55:05 -050038 BUILD_GPERF=yes \
Patrick Williamsc0f7c042017-02-23 20:41:17 -060039"
40
41EXTRA_OEMAKE_append_class-target = " SYSTEM_HEADERS=${STAGING_INCDIR}"
42
43# these are present in the libcap defaults, so include in our CFLAGS too
44CFLAGS += "-D_LARGEFILE64_SOURCE -D_FILE_OFFSET_BITS=64"
45
46do_compile() {
47 oe_runmake ${PACKAGECONFIG_CONFARGS}
48}
49
50do_install() {
51 oe_runmake install \
52 ${PACKAGECONFIG_CONFARGS} \
53 DESTDIR="${D}" \
54 prefix="${prefix}" \
55 SBINDIR="${sbindir}"
56}
57
58do_install_append() {
59 # Move the library to base_libdir
60 install -d ${D}${base_libdir}
61 if [ ! ${D}${libdir} -ef ${D}${base_libdir} ]; then
62 mv ${D}${libdir}/libcap* ${D}${base_libdir}
63 if [ -d ${D}${libdir}/security ]; then
64 mv ${D}${libdir}/security ${D}${base_libdir}
65 fi
66 fi
67}
68
69FILES_${PN}-dev += "${base_libdir}/*.so"
70
71# pam files
72FILES_${PN} += "${base_libdir}/security/*.so"
73
74BBCLASSEXTEND = "native nativesdk"