blob: 4f3bac849096bdcc927013352c55f5eb82b5423a [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
16inherit lib_package
17
18# do NOT pass target cflags to host compilations
19#
20do_configure() {
21 # libcap uses := for compilers, fortunately, it gives us a hint
22 # on what should be replaced with ?=
23 sed -e 's,:=,?=,g' -i Make.Rules
24 sed -e 's,^BUILD_CFLAGS ?= $(.*CFLAGS),BUILD_CFLAGS := $(BUILD_CFLAGS),' -i Make.Rules
25}
26
27PACKAGECONFIG ??= "${@bb.utils.filter('DISTRO_FEATURES', 'pam', d)}"
28PACKAGECONFIG_class-native ??= ""
29
30PACKAGECONFIG[pam] = "PAM_CAP=yes,PAM_CAP=no,libpam"
31
32EXTRA_OEMAKE = " \
33 INDENT= \
34 lib='${baselib}' \
35 RAISE_SETFCAP=no \
36 DYNAMIC=yes \
37 BUILD_GPERF=yes \
38"
39
40EXTRA_OEMAKE_append_class-target = " SYSTEM_HEADERS=${STAGING_INCDIR}"
41
42# these are present in the libcap defaults, so include in our CFLAGS too
43CFLAGS += "-D_LARGEFILE64_SOURCE -D_FILE_OFFSET_BITS=64"
44
45do_compile() {
46 oe_runmake ${PACKAGECONFIG_CONFARGS}
47}
48
49do_install() {
50 oe_runmake install \
51 ${PACKAGECONFIG_CONFARGS} \
52 DESTDIR="${D}" \
53 prefix="${prefix}" \
54 SBINDIR="${sbindir}"
55}
56
57do_install_append() {
58 # Move the library to base_libdir
59 install -d ${D}${base_libdir}
60 if [ ! ${D}${libdir} -ef ${D}${base_libdir} ]; then
61 mv ${D}${libdir}/libcap* ${D}${base_libdir}
62 if [ -d ${D}${libdir}/security ]; then
63 mv ${D}${libdir}/security ${D}${base_libdir}
64 fi
65 fi
66}
67
68FILES_${PN}-dev += "${base_libdir}/*.so"
69
70# pam files
71FILES_${PN} += "${base_libdir}/security/*.so"
72
73BBCLASSEXTEND = "native nativesdk"