# Contributor:
# Maintainer:
pkgname=cfssl
pkgver=1.3.1
pkgrel=0
pkgdesc="Cloudflare PKI and TLS toolkit"
url="https://cfssl.org"
arch="all"
license="BSD-2-Clause"
makedepends="go"
source="$pkgname-$pkgver.tar.gz::https://github.com/cloudflare/$pkgname/archive/$pkgver.tar.gz"
builddir="$srcdir/$pkgname-$pkgver"

build() {
	cd "$srcdir"

	mkdir -p src/github.com/cloudflare
	cp -r "$builddir" src/github.com/cloudflare/cfssl

	export GOPATH="$PWD"
	go install -tags pkcs11 github.com/cloudflare/cfssl/cmd/...
}

package() {
	cd "$srcdir"/bin

	mkdir -p "$pkgdir"/usr/bin
	install -m755 "$srcdir"/bin/* "$pkgdir"/usr/bin/
}

sha512sums="1c33527d1d0c08cac39647e7c6237e655569c474a872b144b962af3e7c39c420d002e719875bbea1f5b502fa640483e63d9a7061bed7875c64565d3f6c15cf47  cfssl-1.3.1.tar.gz"
