# Maintainer: bgme # Contributor: ml <> _pkgname=probe-cli pkgname=ooniprobe-cli pkgver=3.21.1 _pkgver=3.21.1 pkgrel=1 pkgdesc='Next generation OONI Probe CLI' arch=('x86_64') url='https://ooni.org/' license=('GPL-3.0-or-later') depends=('glibc') makedepends=('go') source=("${_pkgname}-${_pkgver}.tar.gz::https://github.com/ooni/${_pkgname}/archive/refs/tags/v${_pkgver}.tar.gz") sha256sums=('30aeb00da6b2d1217cea3409c7f47b60765a6b1df96aa59474649a54c6d3edf6') sha512sums=('bf20461b94df3eac9b79ab217decc97607c2bfa3104a6a342aae1b7ade926d9a48d56ab1a650070094553a71ba2b565d662cd7261a276141049a82c8840a481b') build() { cd "${_pkgname}-${_pkgver}" GOVERSION=$(cat GOVERSION) export GOTOOLCHAIN=go${GOVERSION} export CGO_ENABLED=1 export CGO_LDFLAGS="$LDFLAGS" export CGO_CFLAGS="$CFLAGS" export CGO_CPPFLAGS="$CPPFLAGS" export CGO_CXXFLAGS="$CXXFLAGS" export GOFLAGS='-ldflags=-linkmode=external -buildmode=pie -trimpath -modcacherw' go build ./cmd/ooniprobe } package() { cd "${_pkgname}-${pkgver}" install -Dm755 ooniprobe -t "$pkgdir/usr/bin" install -Dm644 LICENSE -t "$pkgdir/usr/share/licenses/$pkgname" install -Dm644 Readme.md -t "$pkgdir/usr/share/doc/$pkgname" }