# Maintainer: Thomas Liske <thomas@fiasko-nw.net>
pkgname=py3-pyroute2
_pkgname=pyroute2
pkgver=0.9.2
pkgrel=0
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="
b6012f4ab20bed3630a90bcd1672f9f5a467b0ddb6ea180d8bd11868ac2361898e2fa33fafcda857026384fde5952a03b5b7b9d1f2672b963019fd7b2a83a6c3  pyroute2-0.9.2.tar.gz
"
