# Maintainer: bgme # Contributor: ml <> _pkgname=probe-cli pkgname=ooniprobe-cli pkgver=3.19.0 _pkgver=3.19.0 pkgrel=3 pkgdesc='Next generation OONI Probe CLI' arch=('x86_64') url='https://ooni.org/' license=('GPL3') depends=('glibc') makedepends=('go') source=("${_pkgname}-${_pkgver}.tar.gz::https://github.com/ooni/${_pkgname}/archive/refs/tags/v${_pkgver}.tar.gz") sha256sums=('9ec38edb7bb4254e16a58f184ddceafc4a0ede060e08f6741ab02d1e7d6820a2') sha512sums=('3780d7439f51b9a6dc7190ba5414fc88fbdd0ffdb9bbc4a9b7cee924beebcde5556b1199542ec4f7981ee960cc050299742e728c9d87bb2872991929ba550978') 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" }