# Contributor: Łukasz Jendrysik <scadu@yandex.com>
# Contributor: Sören Tempel <soeren+alpine@soeren-tempel.net>
# Contributor: Francesco Colista <fcolista@alpinelinux.org>
# Maintainer: Francesco Colista <fcolista@alpinelinux.org>
pkgname=glances
pkgver=3.4.0.5
pkgrel=1
pkgdesc="CLI curses based monitoring tool"
url="https://nicolargo.github.io/glances/"
arch="noarch"
license="LGPL-3.0-or-later"
depends="
	py3-batinfo
	py3-bottle
	py3-defusedxml
	py3-docker-py
	py3-future
	py3-packaging
	py3-psutil
	py3-snmp
	py3-ujson
	python3
	"
makedepends="py3-setuptools"
subpackages="$pkgname-doc $pkgname-pyc"
source="glances-$pkgver.tar.gz::https://github.com/nicolargo/glances/archive/v$pkgver.tar.gz"
options="!check"  # tests fail on builder infra due to env. limitations

build() {
	python3 setup.py build
}

check() {
	python3 unitest.py
}

package() {
	python3 setup.py install --skip-build --root="$pkgdir"

	# Remove images and HTML doc depending on those
	rm -rf "$pkgdir"/usr/share/doc/$pkgname/$pkgname-doc.html \
		"$pkgdir"/usr/share/doc/$pkgname/images
}

sha512sums="
aca140fedc2acc97ae4901722e0406acb8bea6eac5295d95499860a522e74d29ecbc4cfb28fecfd4a2879f4ee44175bd4efd2429b9d7e302b4a182caabd6a5f8  glances-3.4.0.5.tar.gz
"
