Patrick Williams | c0f7c04 | 2017-02-23 20:41:17 -0600 | [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 | |
Brad Bishop | 6e60e8b | 2018-02-01 10:27:11 -0500 | [diff] [blame] | 8 | DEPENDS = "hostperl-runtime-native gperf-native" |
Patrick Williams | c0f7c04 | 2017-02-23 20:41:17 -0600 | [diff] [blame] | 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 \ |
Brad Bishop | d7bf8c1 | 2018-02-25 22:55:05 -0500 | [diff] [blame] | 12 | file://0001-Fix-build-with-gperf-3.1.patch \ |
| 13 | " |
Patrick Williams | c0f7c04 | 2017-02-23 20:41:17 -0600 | [diff] [blame] | 14 | SRC_URI[md5sum] = "6666b839e5d46c2ad33fc8aa2ceb5f77" |
| 15 | SRC_URI[sha256sum] = "693c8ac51e983ee678205571ef272439d83afe62dd8e424ea14ad9790bc35162" |
| 16 | |
| 17 | inherit lib_package |
| 18 | |
| 19 | # do NOT pass target cflags to host compilations |
| 20 | # |
| 21 | do_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 Williams | c0f7c04 | 2017-02-23 20:41:17 -0600 | [diff] [blame] | 26 | } |
| 27 | |
Brad Bishop | 6e60e8b | 2018-02-01 10:27:11 -0500 | [diff] [blame] | 28 | PACKAGECONFIG ??= "${@bb.utils.filter('DISTRO_FEATURES', 'pam', d)}" |
Patrick Williams | c0f7c04 | 2017-02-23 20:41:17 -0600 | [diff] [blame] | 29 | PACKAGECONFIG_class-native ??= "" |
| 30 | |
Patrick Williams | c0f7c04 | 2017-02-23 20:41:17 -0600 | [diff] [blame] | 31 | PACKAGECONFIG[pam] = "PAM_CAP=yes,PAM_CAP=no,libpam" |
| 32 | |
| 33 | EXTRA_OEMAKE = " \ |
| 34 | INDENT= \ |
Brad Bishop | 1a4b7ee | 2018-12-16 17:11:34 -0800 | [diff] [blame] | 35 | lib='${baselib}' \ |
Patrick Williams | c0f7c04 | 2017-02-23 20:41:17 -0600 | [diff] [blame] | 36 | RAISE_SETFCAP=no \ |
| 37 | DYNAMIC=yes \ |
Brad Bishop | d7bf8c1 | 2018-02-25 22:55:05 -0500 | [diff] [blame] | 38 | BUILD_GPERF=yes \ |
Patrick Williams | c0f7c04 | 2017-02-23 20:41:17 -0600 | [diff] [blame] | 39 | " |
| 40 | |
| 41 | EXTRA_OEMAKE_append_class-target = " SYSTEM_HEADERS=${STAGING_INCDIR}" |
| 42 | |
| 43 | # these are present in the libcap defaults, so include in our CFLAGS too |
| 44 | CFLAGS += "-D_LARGEFILE64_SOURCE -D_FILE_OFFSET_BITS=64" |
| 45 | |
| 46 | do_compile() { |
| 47 | oe_runmake ${PACKAGECONFIG_CONFARGS} |
| 48 | } |
| 49 | |
| 50 | do_install() { |
| 51 | oe_runmake install \ |
| 52 | ${PACKAGECONFIG_CONFARGS} \ |
| 53 | DESTDIR="${D}" \ |
| 54 | prefix="${prefix}" \ |
| 55 | SBINDIR="${sbindir}" |
| 56 | } |
| 57 | |
| 58 | do_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 | |
| 69 | FILES_${PN}-dev += "${base_libdir}/*.so" |
| 70 | |
| 71 | # pam files |
| 72 | FILES_${PN} += "${base_libdir}/security/*.so" |
| 73 | |
| 74 | BBCLASSEXTEND = "native nativesdk" |