Andrew Geissler | 82c905d | 2020-04-13 13:39:40 -0500 | [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 | file://0002-tests-do-not-run-target-executables.patch \ |
| 13 | file://0001-tests-do-not-statically-link-a-test.patch \ |
| 14 | " |
Andrew Geissler | 5a43b43 | 2020-06-13 10:46:56 -0500 | [diff] [blame] | 15 | SRC_URI[sha256sum] = "5048c849bdbbe24d2ca59463142cb279abec5edf3ab6731ab35a596bcf538a49" |
Andrew Geissler | 82c905d | 2020-04-13 13:39:40 -0500 | [diff] [blame] | 16 | |
| 17 | UPSTREAM_CHECK_URI = "https://www.kernel.org/pub/linux/libs/security/linux-privs/${BPN}2/" |
| 18 | |
| 19 | inherit lib_package |
| 20 | |
| 21 | # do NOT pass target cflags to host compilations |
| 22 | # |
| 23 | do_configure() { |
| 24 | # libcap uses := for compilers, fortunately, it gives us a hint |
| 25 | # on what should be replaced with ?= |
| 26 | sed -e 's,:=,?=,g' -i Make.Rules |
Andrew Geissler | 4ed12e1 | 2020-06-05 18:00:41 -0500 | [diff] [blame] | 27 | sed -e 's,^BUILD_CFLAGS ?= ,BUILD_CFLAGS := $(BUILD_CFLAGS) ,' -i Make.Rules |
Andrew Geissler | 82c905d | 2020-04-13 13:39:40 -0500 | [diff] [blame] | 28 | } |
| 29 | |
| 30 | PACKAGECONFIG ??= "${@bb.utils.filter('DISTRO_FEATURES', 'pam', d)}" |
| 31 | PACKAGECONFIG_class-native ??= "" |
| 32 | |
| 33 | PACKAGECONFIG[pam] = "PAM_CAP=yes,PAM_CAP=no,libpam" |
| 34 | |
| 35 | EXTRA_OEMAKE = " \ |
| 36 | INDENT= \ |
| 37 | lib='${baselib}' \ |
| 38 | RAISE_SETFCAP=no \ |
| 39 | DYNAMIC=yes \ |
| 40 | BUILD_GPERF=yes \ |
| 41 | " |
| 42 | |
| 43 | EXTRA_OEMAKE_append_class-target = " SYSTEM_HEADERS=${STAGING_INCDIR}" |
| 44 | |
| 45 | # these are present in the libcap defaults, so include in our CFLAGS too |
| 46 | CFLAGS += "-D_LARGEFILE64_SOURCE -D_FILE_OFFSET_BITS=64" |
| 47 | |
| 48 | do_compile() { |
| 49 | oe_runmake ${PACKAGECONFIG_CONFARGS} |
| 50 | } |
| 51 | |
| 52 | do_install() { |
| 53 | oe_runmake install \ |
| 54 | ${PACKAGECONFIG_CONFARGS} \ |
| 55 | DESTDIR="${D}" \ |
| 56 | prefix="${prefix}" \ |
| 57 | SBINDIR="${sbindir}" |
| 58 | } |
| 59 | |
| 60 | do_install_append() { |
| 61 | # Move the library to base_libdir |
| 62 | install -d ${D}${base_libdir} |
| 63 | if [ ! ${D}${libdir} -ef ${D}${base_libdir} ]; then |
| 64 | mv ${D}${libdir}/libcap* ${D}${base_libdir} |
| 65 | if [ -d ${D}${libdir}/security ]; then |
| 66 | mv ${D}${libdir}/security ${D}${base_libdir} |
| 67 | fi |
| 68 | fi |
| 69 | } |
| 70 | |
| 71 | FILES_${PN}-dev += "${base_libdir}/*.so" |
| 72 | |
| 73 | # pam files |
| 74 | FILES_${PN} += "${base_libdir}/security/*.so" |
| 75 | |
| 76 | BBCLASSEXTEND = "native nativesdk" |