diff options
author | AlphaJack | 2023-08-12 18:09:07 +0200 |
---|---|---|
committer | AlphaJack | 2023-08-12 18:09:07 +0200 |
commit | 9083e3b99492d8bbdee046d9445cc8eb0a4a2697 (patch) | |
tree | dcfa87dd883a5fed67eba95dd86afa63291fd44e | |
download | aur-xdpcap-git.tar.gz |
Initial commit
-rw-r--r-- | .SRCINFO | 14 | ||||
-rw-r--r-- | PKGBUILD | 37 |
2 files changed, 51 insertions, 0 deletions
diff --git a/.SRCINFO b/.SRCINFO new file mode 100644 index 000000000000..22c7670661d4 --- /dev/null +++ b/.SRCINFO @@ -0,0 +1,14 @@ +pkgbase = xdpcap-git + pkgdesc = tcpdump like XDP packet capture + pkgver = r45.417804f + pkgrel = 1 + url = https://github.com/cloudflare/xdpcap + arch = x86_64 + arch = aarch64 + arch = armv7h + license = BSD3 + makedepends = go + source = git+https://github.com/cloudflare/xdpcap + sha256sums = SKIP + +pkgname = xdpcap-git diff --git a/PKGBUILD b/PKGBUILD new file mode 100644 index 000000000000..7ccc49d74e30 --- /dev/null +++ b/PKGBUILD @@ -0,0 +1,37 @@ +# Maintainer: AlphaJack <alphajack at tuta dot io> + +pkgname="xdpcap-git" +pkgver=r45.417804f +pkgrel=1 +pkgdesc="tcpdump like XDP packet capture" +url="https://github.com/cloudflare/xdpcap" +license=("BSD3") +arch=("x86_64" "aarch64" "armv7h") +makedepends=("go") +source=("git+$url") +sha256sums=("SKIP") + +pkgver(){ + cd "xdpcap" + printf "r%s.%s" "$(git rev-list --count HEAD)" "$(git rev-parse --short=7 HEAD)" +} + +prepare(){ + cd "xdpcap" + mkdir -p build +} + +build(){ + cd "xdpcap" + export CGO_CPPFLAGS="${CPPFLAGS}" + export CGO_CFLAGS="${CFLAGS}" + export CGO_CXXFLAGS="${CXXFLAGS}" + export CGO_LDFLAGS="${LDFLAGS}" + export GOFLAGS="-buildmode=pie -trimpath -ldflags=-linkmode=external -mod=readonly -modcacherw" + go build -o build ./cmd/... +} + +package(){ + cd "xdpcap" + install -D -m 755 "build/xdpcap" -t "$pkgdir/usr/bin" +} |