# Maintainer: Adam Jensen <acjensen@gmail.com>
pkgname=ply
pkgver=2.3.0
pkgrel=0
pkgdesc="A light-weight, dynamic tracer based on BPF"
url="https://wkz.github.io/ply"
arch="x86_64 aarch64"
license="GPL-2.0-only"
# ply's test suite requires privileged access to run BPF programs
options="!check"
subpackages="$pkgname-doc"
makedepends="automake autoconf libtool bison linux-headers libbsd-dev flex ronn"
source="$pkgname-$pkgver.tar.gz::https://github.com/iovisor/ply/archive/$pkgver.tar.gz"

prepare() {
	default_prepare

	# Use commit ref as version instead of invoking git
	sed -i -e "s/AC_INIT(.*,/AC_INIT(ply, $pkgver,/" configure.ac

	autoreconf -fi
}

build() {
	./configure --prefix="/usr"
	make
}

package() {
	make install DESTDIR="$pkgdir"
	make -C man install DESTDIR="$pkgdir"
}

sha512sums="
ee8acd31bef7b2ac318ef64f7775aae2b288bae15a7b7b5b28c2ce5728e8ece7833ce192bd10488dd54228685d3dc9053679a033960ed75fd91a10bb0fa6d912  ply-2.3.0.tar.gz
"
