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