# Maintainer: Ariadne Conill <ariadne@dereferenced.org>
pkgname=rpki-client
pkgver=9.0
pkgrel=0
pkgdesc="RPKI validator to support BGP Origin Validation"
url="https://www.rpki-client.org/"
arch="all"
license="ISC"
depends="rsync"
makedepends="
	expat-dev
	libretls-dev
	musl-fts-dev
	openssl-dev>3
	zlib-dev
	"
install="$pkgname.pre-install"
pkgusers="rpki-client"
pkggroups="rpki-client"
subpackages="$pkgname-doc"
source="https://cdn.openbsd.org/pub/OpenBSD/rpki-client/rpki-client-$pkgver.tar.gz"

prepare() {
	default_prepare
	update_config_sub
}

build() {
	./configure \
		--build=$CBUILD \
		--host=$CHOST \
		--prefix=/usr \
		--sysconfdir=/etc \
		--mandir=/usr/share/man \
		--localstatedir=/var \
		--with-user=rpki-client
	make
}

check() {
	make check
}

package() {
	make DESTDIR="$pkgdir" install
}

sha512sums="
006de9c56d1eea1bb50917cef83039b43f76cfc3436c1f4a5fe2121e656258eff3c8737c12172e501cd5eb9b1ef8d9ffff2e74592c3a5b40c884169fdf2d4424  rpki-client-9.0.tar.gz
"
