# 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=2.11.1
pkgrel=0
pkgdesc="A CLI curses based monitoring tool"
url="http://nicolargo.github.com/glances/"
arch="noarch"
license="LGPL-3.0-or-later"
depends="py2-psutil py2-bottle py2-snmp py2-batinfo docker-py py-setuptools"
makedepends="python2-dev py-setuptools"
subpackages="$pkgname-doc"
source="$pkgname-$pkgver.tar.gz::https://github.com/nicolargo/$pkgname/archive/v$pkgver.tar.gz"
builddir="$srcdir/$pkgname-$pkgver"
options="!check"  # tests fail on builder infra due to env. limitations

build() {
	cd "$builddir"
	python2 setup.py build
}

check() {
	cd "$builddir"
	python2 unitest.py
}

package() {
	cd "$builddir"
	python2 setup.py install --prefix=/usr --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="244e536faea8173c0c06a51d60ae6804021632336f7c37d61aebc8852ce76e27f9b8f52fac514b7d32a77cdceffb8a0cdaa64af4e46d8a641d2312ffbda2b2e2  glances-2.11.1.tar.gz"
