# Contributor: Duncan Bellamy <dunk@denkimushi.com>
# Maintainer: Duncan Bellamy <dunk@denkimushi.com>
pkgname=py3-dnsrobocert
pkgver=3.25.0
pkgrel=1
pkgdesc="A tool to manage your DNS-challenged TLS certificates"
url="https://dnsrobocert.readthedocs.io/en/latest/"
arch="noarch"
license="MIT"
depends="
	certbot
	py3-acme
	py3-boto3
	py3-cffi
	py3-cryptography
	py3-colorama
	py3-coloredlogs
	py3-dnspython
	py3-dns-lexicon
	py3-jsonschema
	py3-localzone
	py3-lxml
	py3-openssl
	py3-pem
	py3-schedule
	py3-softlayer
	py3-softlayer-zeep
	py3-tldextract
	py3-xmltodict
	py3-yaml
	"
makedepends="
	py3-gpep517
	py3-poetry-core
	"
checkdepends="pebble py3-pytest"
subpackages="$pkgname-pyc"
source="$pkgname-$pkgver.tar.gz::https://github.com/adferrand/dnsrobocert/archive/v$pkgver.tar.gz
	pebble.patch
	revert-old-python.patch
	"
builddir="$srcdir/dnsrobocert-$pkgver"

case "$CARCH" in
# blocked by pebble
riscv64) options="$options !check" ;;
esac

build() {
	gpep517 build-wheel \
		--wheel-dir .dist \
		--output-fd 3 3>&1 >&2
}

check() {
	python3 -m venv --clear --without-pip --system-site-packages .testenv
	.testenv/bin/python3 -m installer .dist/*.whl
	.testenv/bin/python3 -m pytest -k 'not test_pfx'
}

package() {
	python3 -m installer -d "$pkgdir" .dist/*.whl
}

sha512sums="
bd0998bc5de09bb79c4810d555aa74c40ac497e72f6d40dec64d1472d08a085dc4ce99ec39fa8580a96cb2c1af7bbf88cebc18baba2b4697220d4d72f2cdabe1  py3-dnsrobocert-3.25.0.tar.gz
3a8f2d9a74a35aea2e5eebcede656d2861382c975dc94560eca4f94cd8b13f1bb4a98b5b667cb5937ef9123a8f1da20dcef58a8ffc903e93e979d928bca9f9b1  pebble.patch
bcaf7e5eccad8a713577269e2458502a089ff59c949c4ea583da6b13d6504f5ad9f905fdf1b0d30c759aa7a1555abcf16cedc11869f6ffef71b09a0204364493  revert-old-python.patch
"
