# Contributor: Konstantin Kulikov # Maintainer: Konstantin Kulikov pkgname=bpftrace pkgver=0.9.3 pkgrel=0 pkgdesc="High-level tracing language for Linux eBPF" url="https://github.com/iovisor/bpftrace" arch="x86_64" license="Apache-2.0" makedepends="cmake llvm9-dev llvm9-static clang-dev clang-static flex-dev bison elfutils-dev linux-headers bcc-dev" source="$pkgname-$pkgver.tar.gz::https://github.com/iovisor/bpftrace/archive/v$pkgver.tar.gz" # Tests require root, network to download gmock and a few tests fail. options="!check" builddir="$srcdir/$pkgname-$pkgver/build" subpackages="$pkgname-doc $pkgname-tools:tools:noarch $pkgname-tools-doc:tools_doc" prepare() { default_prepare mkdir $builddir } build() { cmake \ -DCMAKE_INSTALL_PREFIX=/usr \ -DCMAKE_BUILD_TYPE=Release \ -DCMAKE_CXX_FLAGS="$CXXFLAGS" \ -DCMAKE_C_FLAGS="$CFLAGS" \ -DBUILD_TESTING:BOOL=OFF \ -DLLVM_REQUESTED_VERSION=9 \ .. make } package() { make DESTDIR="$pkgdir" install mv "$pkgdir/usr/man" "$pkgdir/usr/share/bpftrace/man" mv "$pkgdir/usr/share/bpftrace/tools/doc" "$pkgdir/usr/share/bpftrace/tools_doc" mkdir -p "$pkgdir/usr/share/man/man8" mv "$pkgdir/usr/share/bpftrace/man/man8/bpftrace.8.gz" "$pkgdir/usr/share/man/man8/bpftrace.8.gz" } tools() { depends="$pkgname" pkgdesc="$pkgdesc (tools)" mkdir -p "$subpkgdir/usr/share/bpftrace" mv "$pkgdir/usr/share/bpftrace/tools" "$subpkgdir/usr/share/bpftrace/tools" } tools_doc() { pkgdesc="$pkgdesc (tool docs and examples)" mkdir -p "$subpkgdir/usr/share/bpftrace" mv "$pkgdir/usr/share/bpftrace/tools_doc" "$subpkgdir/usr/share/bpftrace/doc" mv "$pkgdir/usr/share/bpftrace/man" "$subpkgdir/usr/share/bpftrace/man" } sha512sums="49b12735fe2fbf4f72d3d0c0372a7a570c7abc92d1f626624d591a863009c8bfabdf86825f133885800c7ea293773651be66e4c792f9cd397f82d250a7af83be bpftrace-0.9.3.tar.gz"