# Maintainer: bgme # Contributor: ml <> _pkgname=probe-cli pkgname=ooniprobe-cli pkgver=3.20.0 _pkgver=3.20.0 pkgrel=1 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=('701bdcbd42ef34fc04b581b278b3cda914c5a78b39bbba9d7ffa74095472bdb2') sha512sums=('5366b6630fad66a8c65ef3d9906a98a649a1b23c771e20b0a346ffcc324cfecb76085cba43682b9f6fa5c9d2b46946589c9b59e28ccb056536effb0519c565db') 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" }