# Contributor: knuxify <knuxify@gmail.com>
# Maintainer: knuxify <knuxify@gmail.com>
pkgname=b4
pkgver=0.14.0
pkgrel=0
pkgdesc="Tool to help with email-based patch workflows"
url="https://b4.docs.kernel.org/"
arch="noarch"
license="GPL-2.0-or-later"
depends="py3-requests git git-email git-filter-repo py3-dnspython py3-patatt py3-dkimpy"
makedepends="py3-gpep517 py3-setuptools py3-wheel"
checkdepends="py3-pytest"
subpackages="$pkgname-pyc $pkgname-doc"
source="https://git.kernel.org/pub/scm/utils/b4/b4.git/snapshot/b4-$pkgver.tar.gz"

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

check() {
	pytest src/tests
}

package() {
	python3 -m installer -d "$pkgdir" .dist/*.whl
	rm -r "$pkgdir"/usr/lib/python3.*/site-packages/tests/

	install -Dvm644 src/b4/man/b4.5 \
		-t "$pkgdir"/usr/share/man/man5/
}

sha512sums="
b7e28bd984579944fd2b91382009786148669f308d62f88887746f328fc313217fa38a2517ab36247a3f9a34e95ae345de2e034b9e097d8f259ef0c286bfa53e  b4-0.14.0.tar.gz
"
