sys-process/glances: 3.1.4.1-r1 amd64 stable, bug #720368
[gentoo.git] / sys-process / glances / glances-3.1.0.ebuild
1 # Copyright 1999-2020 Gentoo Authors
2 # Distributed under the terms of the GNU General Public License v2
3
4 EAPI=6
5
6 PYTHON_COMPAT=( python3_{6,7} )
7 PYTHON_REQ_USE="ncurses"
8
9 inherit distutils-r1 eutils linux-info
10
11 DESCRIPTION="CLI curses based monitoring tool"
12 HOMEPAGE="https://github.com/nicolargo/glances"
13 SRC_URI="https://github.com/nicolargo/${PN}/archive/v${PV}.tar.gz -> ${P}.tar.gz"
14
15 LICENSE="LGPL-3"
16 SLOT="0"
17 KEYWORDS="amd64 ~arm ~x86 ~amd64-linux ~x86-linux"
18 IUSE="doc test"
19 RESTRICT="!test? ( test )"
20
21 RDEPEND=">=dev-python/psutil-5.4.3[${PYTHON_USEDEP}]"
22
23 DEPEND="dev-python/setuptools[${PYTHON_USEDEP}]
24         doc? (
25                 dev-python/sphinx[${PYTHON_USEDEP}]
26                 dev-python/sphinx_rtd_theme[${PYTHON_USEDEP}]
27         )
28         test? ( ${RDEPEND} )
29 "
30
31 CONFIG_CHECK="~TASK_IO_ACCOUNTING ~TASK_DELAY_ACCT ~TASKSTATS"
32
33 pkg_setup() {
34         linux-info_pkg_setup
35 }
36
37 python_prepare_all() {
38         # Remove duplicate entries of a prebuilt doc build and
39         # ensure install of the file glances.conf in /etc/${PN}
40         sed \
41                 -e '/share\/doc\/glances/d' \
42                 -e "s/'CONTRIBUTING.md',//" \
43                 -e "s:'conf/glances.conf':('${EPREFIX}/etc/glances', ['conf/glances.conf':g" \
44                 -i setup.py || die
45
46         distutils-r1_python_prepare_all
47 }
48
49 python_install_all() {
50         # add an intended file from original data set from setup.py to DOCS
51         local DOCS=( README.rst CONTRIBUTING.md conf/glances.conf )
52         # build docs
53         if use doc; then
54                 pushd docs
55                 make html
56                 popd
57                 local HTML_DOCS=( docs/_build/html/. )
58         fi
59         distutils-r1_python_install_all
60 }
61
62 python_test() {
63         esetup.py test
64 }
65
66 pkg_postinst() {
67         optfeature "Action script feature" dev-python/pystache
68         optfeature "Autodiscover mode" dev-python/zeroconf
69         optfeature "Cloud support" dev-python/requests
70         optfeature "Quicklook CPU info" dev-python/py-cpuinfo
71         optfeature "Docker monitoring support" dev-python/docker-py
72         #optfeature "Export module" \
73         #       unpackaged/bernhard \
74         #       unpackaged/cassandra-driver \
75         #       unpackaged/potsdb \
76         #       dev-python/couchdb-python \
77         #       dev-python/elasticsearch-py \
78         #       dev-python/influxdb \
79         #       dev-python/kafka-python \
80         #       dev-python/pika \
81         #       dev-python/paho-mqtt \
82         #       dev-python/prometheus_client \
83         #       dev-python/pyzmq \
84         #       dev-python/statsd
85         optfeature "Folder monitoring" dev-python/scandir
86         #optfeature "Nvidia GPU monitoring" unpackaged/nvidia-ml-py3
87         optfeature "SVG graph support" dev-python/pygal
88         optfeature "IP plugin" dev-python/netifaces
89         optfeature "RAID monitoring" dev-python/pymdstat
90         #optfeature "SMART support" unpackaged/pySMART.smartx
91         optfeature "RAID support" dev-python/pymdstat
92         optfeature "SNMP support" dev-python/pysnmp
93         optfeature "Web server mode" dev-python/bottle dev-python/requests
94         optfeature "WIFI plugin" net-wireless/python-wifi
95 }