# Maintainer: Thomas Liske <thomas@fiasko-nw.net>
pkgname=ifstate
pkgver=1.13.9
pkgrel=0
pkgdesc="Manage host interface settings in a declarative manner"
url="https://ifstate.net/"
arch="noarch"
license="GPL-3.0-or-later"
depends="iproute2
	python3
	py3-jsonschema
	py3-pyroute2
	py3-setproctitle
	py3-yaml"
makedepends="py3-gpep517 py3-setuptools py3-wheel"
options="!check" # no tests available
source="https://files.pythonhosted.org/packages/source/i/ifstate/ifstate-$pkgver.tar.gz
	ifstate.conf
	ifstate.initd
	"
subpackages="$pkgname-openrc $pkgname-pyc"

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

package() {
	python3 -m installer -d "$pkgdir" \
		.dist/*.whl
	install -Dm755 "$srcdir"/ifstate.conf "$pkgdir"/etc/modprobe.d/ifstate.conf
	install -Dm755 "$srcdir"/ifstate.initd "$pkgdir"/etc/init.d/ifstate
}

sha512sums="
0deace3eb76669cd396b5d3ab837e31f91a576935243a9ad6d52353ebc90ab77f4099ae8cc4d165ad1a874cb3c51709bbc3b3cc89420fa5d8e30d4a6a94ca1f6  ifstate-1.13.9.tar.gz
dfc31dc7452c63ec18d368803ffb3bef1cd96d98345d0c5ef1baeb8b2819130b504d3e6e82d99ee86fa18d4576b7927d0b80d6d79f9f20e388e07faa09a87285  ifstate.conf
9c9ba8289ae0fa2566bbed490f3c3171674c19f01988bb53920bf0aefe7951341886046876355746db28c9009591671dc1df7025cf25445ba824ab92335a7bae  ifstate.initd
"
