# Maintainer: Thomas Liske <thomas@fiasko-nw.net>
pkgname=py3-pyroute2
_pkgname=pyroute2
pkgver=0.7.12
pkgrel=1
pkgdesc="Python Netlink library: full installation"
url="https://github.com/svinota/pyroute2"
arch="noarch"
license="GPL-2.0-or-later OR Apache-2.0"
makedepends="py3-gpep517 py3-setuptools py3-wheel"
options="!check" # currently not working, yet
subpackages="$pkgname-pyc"
source="https://files.pythonhosted.org/packages/source/p/pyroute2/pyroute2-$pkgver.tar.gz
	"
builddir="$srcdir/$_pkgname-$pkgver"

replaces="
	py3-pyroute2-minimal
	py3-pyroute2.core
	py3-pyroute2.ethtool
	py3-pyroute2.ipdb
	py3-pyroute2.ipset
	py3-pyroute2.ndb
	py3-pyroute2.nftables
	py3-pyroute2.nslink
	py3-pyroute2.protocols
	"
provides="
	py3-pyroute2-minimal=$pkgver-r$pkgrel
	py3-pyroute2.core=$pkgver-r$pkgrel
	py3-pyroute2.ethtool=$pkgver-r$pkgrel
	py3-pyroute2.ipdb=$pkgver-r$pkgrel
	py3-pyroute2.ipset=$pkgver-r$pkgrel
	py3-pyroute2.ndb=$pkgver-r$pkgrel
	py3-pyroute2.nftables=$pkgver-r$pkgrel
	py3-pyroute2.nslink=$pkgver-r$pkgrel
	py3-pyroute2.protocols=$pkgver-r$pkgrel
	"

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

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

	# do not ship cli scripts for now
	rm -rf "${pkgdir:?}/usr/bin"
}

sha512sums="
928e7f45569d43c1849d9c8d5972b38343ed8dd79137d6bfc757557d3bde23526af6baea61acc720b7e2d5d26731066b93f180138a6227b7d76d094e04111df7  pyroute2-0.7.12.tar.gz
"
