sys-process/glances: Remove py2
[gentoo.git] / sys-process / glances / glances-3.1.1.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/future[${PYTHON_USEDEP}]
22         >=dev-python/psutil-5.4.3[${PYTHON_USEDEP}]"
23
24 DEPEND="dev-python/setuptools[${PYTHON_USEDEP}]
25         doc? (
26                 dev-python/sphinx[${PYTHON_USEDEP}]
27                 dev-python/sphinx_rtd_theme[${PYTHON_USEDEP}]
28         )
29         test? ( ${RDEPEND} )
30 "
31
32 CONFIG_CHECK="~TASK_IO_ACCOUNTING ~TASK_DELAY_ACCT ~TASKSTATS"
33
34 pkg_setup() {
35         linux-info_pkg_setup
36 }
37
38 python_prepare_all() {
39         # Remove duplicate entries of a prebuilt doc build and
40         # ensure install of the file glances.conf in /etc/${PN}
41         sed \
42                 -e '/share\/doc\/glances/d' \
43                 -e "s/'CONTRIBUTING.md',//" \
44                 -e "s:'conf/glances.conf':('${EPREFIX}/etc/glances', ['conf/glances.conf':g" \
45                 -i setup.py || die
46
47         distutils-r1_python_prepare_all
48 }
49
50 python_install_all() {
51         # add an intended file from original data set from setup.py to DOCS
52         local DOCS=( README.rst CONTRIBUTING.md conf/glances.conf )
53         # build docs
54         if use doc; then
55                 pushd docs
56                 make html
57                 popd
58                 local HTML_DOCS=( docs/_build/html/. )
59         fi
60         distutils-r1_python_install_all
61 }
62
63 python_test() {
64         esetup.py test
65 }
66
67 pkg_postinst() {
68         optfeature "Action script feature" dev-python/pystache
69         optfeature "Autodiscover mode" dev-python/zeroconf
70         optfeature "Cloud support" dev-python/requests
71         optfeature "Quicklook CPU info" dev-python/py-cpuinfo
72         optfeature "Docker monitoring support" dev-python/docker-py
73         #optfeature "Export module" \
74         #       unpackaged/bernhard \
75         #       unpackaged/cassandra-driver \
76         #       unpackaged/potsdb \
77         #       dev-python/couchdb-python \
78         #       dev-python/elasticsearch-py \
79         #       dev-python/influxdb \
80         #       dev-python/kafka-python \
81         #       dev-python/pika \
82         #       dev-python/paho-mqtt \
83         #       dev-python/prometheus_client \
84         #       dev-python/pyzmq \
85         #       dev-python/statsd
86         optfeature "Folder monitoring" dev-python/scandir
87         #optfeature "Nvidia GPU monitoring" unpackaged/nvidia-ml-py3
88         optfeature "SVG graph support" dev-python/pygal
89         optfeature "IP plugin" dev-python/netifaces
90         optfeature "RAID monitoring" dev-python/pymdstat
91         #optfeature "SMART support" unpackaged/pySMART.smartx
92         optfeature "RAID support" dev-python/pymdstat
93         optfeature "SNMP support" dev-python/pysnmp
94         #optfeature "sparklines plugin" unpackaged/sparklines
95         optfeature "Web server mode" dev-python/bottle dev-python/requests
96         optfeature "WIFI plugin" net-wireless/python-wifi
97 }