Brad Bishop | c342db3 | 2019-05-15 21:57:59 -0400 | [diff] [blame] | 1 | SUMMARY = "Library for getting/setting POSIX.1e capabilities" |
| 2 | HOMEPAGE = "http://sites.google.com/site/fullycapable/" |
| 3 | |
| 4 | # no specific GPL version required |
| 5 | LICENSE = "BSD | GPLv2" |
| 6 | LIC_FILES_CHKSUM = "file://License;md5=3f84fd6f29d453a56514cb7e4ead25f1" |
| 7 | |
| 8 | DEPENDS = "hostperl-runtime-native gperf-native" |
| 9 | |
| 10 | SRC_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 | " |
| 13 | SRC_URI[md5sum] = "2e8f9fab32eb5ccb37969fe317fd17aa" |
| 14 | SRC_URI[sha256sum] = "dac1792d0118bee6aae6ba7fb93ff1602c6a9bda812fd63916eee1435b9c486a" |
| 15 | |
| 16 | inherit lib_package |
| 17 | |
| 18 | # do NOT pass target cflags to host compilations |
| 19 | # |
| 20 | do_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 | |
| 27 | PACKAGECONFIG ??= "${@bb.utils.filter('DISTRO_FEATURES', 'pam', d)}" |
| 28 | PACKAGECONFIG_class-native ??= "" |
| 29 | |
| 30 | PACKAGECONFIG[pam] = "PAM_CAP=yes,PAM_CAP=no,libpam" |
| 31 | |
| 32 | EXTRA_OEMAKE = " \ |
| 33 | INDENT= \ |
| 34 | lib='${baselib}' \ |
| 35 | RAISE_SETFCAP=no \ |
| 36 | DYNAMIC=yes \ |
| 37 | BUILD_GPERF=yes \ |
| 38 | " |
| 39 | |
| 40 | EXTRA_OEMAKE_append_class-target = " SYSTEM_HEADERS=${STAGING_INCDIR}" |
| 41 | |
| 42 | # these are present in the libcap defaults, so include in our CFLAGS too |
| 43 | CFLAGS += "-D_LARGEFILE64_SOURCE -D_FILE_OFFSET_BITS=64" |
| 44 | |
| 45 | do_compile() { |
| 46 | oe_runmake ${PACKAGECONFIG_CONFARGS} |
| 47 | } |
| 48 | |
| 49 | do_install() { |
| 50 | oe_runmake install \ |
| 51 | ${PACKAGECONFIG_CONFARGS} \ |
| 52 | DESTDIR="${D}" \ |
| 53 | prefix="${prefix}" \ |
| 54 | SBINDIR="${sbindir}" |
| 55 | } |
| 56 | |
| 57 | do_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 | |
| 68 | FILES_${PN}-dev += "${base_libdir}/*.so" |
| 69 | |
| 70 | # pam files |
| 71 | FILES_${PN} += "${base_libdir}/security/*.so" |
| 72 | |
| 73 | BBCLASSEXTEND = "native nativesdk" |