# Contributor: Duncan Bellamy <dunk@denkimushi.com>
# Maintainer: Duncan Bellamy <dunk@denkimushi.com>
pkgname=pebble
pkgver=2.7.0
pkgrel=4
pkgdesc="small RFC 8555 ACME test server not for a production certificate authority"
url="https://github.com/letsencrypt/pebble"
arch="all"
license="MPL-2.0"
options="!check net" # no testsuite, needs to download dependencies
makedepends="go"
source="$pkgname-$pkgver.tar.gz::https://github.com/letsencrypt/pebble/archive/refs/tags/v$pkgver.tar.gz
	"

export GOCACHE="${GOCACHE:-"$srcdir/go-cache"}"
export GOTMPDIR="${GOTMPDIR:-"$srcdir"}"
export GOMODCACHE="${GOMODCACHE:-"$srcdir/go"}"

prepare() {
	default_prepare

	go mod download
}

build() {
	go build ./cmd/pebble
	go build ./cmd/pebble-challtestsrv
}

package() {
	install -Dm755 \
		pebble \
		pebble-challtestsrv \
		-t "$pkgdir"/usr/bin
}

sha512sums="
8958903fdc480cb6250cd8ea9848bdbc1c9709fe0a397d985cb28ea877b6e62aa2bd2a38f708bc42508eeb927b5a9d0f1a6d3291c9a7890d84541ff9882f8997  pebble-2.7.0.tar.gz
"
