# Maintainer: Adam Jensen pkgname=libbpf pkgver=1.0.1 pkgrel=0 pkgdesc="A library for interacting with the Linux kernel's Berkeley Packet Filter (BPF) facility from user space" url="https://github.com/libbpf/libbpf" arch="all" license="GPL-2.0-only" depends="elfutils" makedepends="build-base linux-headers elfutils-dev zlib-dev" subpackages="$pkgname-dev" source="$pkgname-$pkgver.tar.gz::https://github.com/libbpf/libbpf/archive/refs/tags/v$pkgver.tar.gz 10-consolidate-lib-dirs.patch" build() { cd src make NO_PKG_CONFIG=1 } check() { echo "#include \"$builddir/src/btf.h\"" | gcc -xc -c -o /dev/null - } package() { cd src make install DESTDIR="$pkgdir" # install somewhere out of the way that will hopefully not be included by mistake mkdir -p "$pkgdir/usr/include/bpf/uapi/linux" for header in bpf.h bpf_common.h btf.h; do cp "$builddir/include/uapi/linux/$header" "$pkgdir/usr/include/bpf/uapi/linux/" done } sha512sums=" 2ee6d85c0a33f723e5b93ddddf97118e67754c9e44ca0449ceb49126820f89fea9ddc282a5add764dc4da090af6164cc6641b497489253d192ed01bc397df9be libbpf-1.0.1.tar.gz 07719f3f1d955dc1b0058a5d47b1c755a985a74c17a2bfa40bcc9a781572d68d4282b5bab0d34e8a16961dba4de0f23550522369456d17e8632b8a978fa55351 10-consolidate-lib-dirs.patch "