Gentoo Archives: gentoo-commits

From: Craig Andrews <candrews@g.o>
To: gentoo-commits@l.g.o
Subject: [gentoo-commits] repo/gentoo:master commit in: net-analyzer/netdata/
Date: Mon, 02 Dec 2019 20:52:50
Message-Id: 1575319955.629d6fb6477f4b9d90f92e37dd3af6fbaba68240.candrews@gentoo
1 commit: 629d6fb6477f4b9d90f92e37dd3af6fbaba68240
2 Author: Petr Vaněk <arkamar <AT> atlas <DOT> cz>
3 AuthorDate: Mon Dec 2 18:02:09 2019 +0000
4 Commit: Craig Andrews <candrews <AT> gentoo <DOT> org>
5 CommitDate: Mon Dec 2 20:52:35 2019 +0000
6 URL: https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=629d6fb6
7
8 net-analyzer/netdata: apply all capabilities correctly
9
10 Closes: https://bugs.gentoo.org/701460
11 Package-Manager: Portage-2.3.79, Repoman-2.3.16
12 Signed-off-by: Petr Vaněk <arkamar <AT> atlas.cz>
13 Signed-off-by: Craig Andrews <candrews <AT> gentoo.org>
14
15 net-analyzer/netdata/netdata-1.19.0-r1.ebuild | 131 ++++++++++++++++++++++++++
16 1 file changed, 131 insertions(+)
17
18 diff --git a/net-analyzer/netdata/netdata-1.19.0-r1.ebuild b/net-analyzer/netdata/netdata-1.19.0-r1.ebuild
19 new file mode 100644
20 index 00000000000..7133c9ae7f6
21 --- /dev/null
22 +++ b/net-analyzer/netdata/netdata-1.19.0-r1.ebuild
23 @@ -0,0 +1,131 @@
24 +# Copyright 1999-2019 Gentoo Authors
25 +# Distributed under the terms of the GNU General Public License v2
26 +
27 +EAPI=7
28 +PYTHON_COMPAT=( python{2_7,3_5,3_6,3_7} )
29 +
30 +inherit autotools fcaps linux-info python-r1 systemd
31 +
32 +if [[ ${PV} == *9999 ]] ; then
33 + EGIT_REPO_URI="https://github.com/netdata/${PN}.git"
34 + inherit git-r3
35 +else
36 + SRC_URI="https://github.com/netdata/${PN}/archive/v${PV}.tar.gz -> ${P}.tar.gz"
37 + KEYWORDS="~amd64 ~x86"
38 +fi
39 +
40 +DESCRIPTION="Linux real time system monitoring, done right!"
41 +HOMEPAGE="https://github.com/netdata/netdata https://my-netdata.io/"
42 +
43 +LICENSE="GPL-3+ MIT BSD"
44 +SLOT="0"
45 +IUSE="caps +compression cpu_flags_x86_sse2 cups +dbengine ipmi mysql nfacct nodejs postgres +python tor xen"
46 +REQUIRED_USE="
47 + mysql? ( python )
48 + python? ( ${PYTHON_REQUIRED_USE} )
49 + tor? ( python )"
50 +
51 +# most unconditional dependencies are for plugins.d/charts.d.plugin:
52 +RDEPEND="
53 + acct-group/netdata
54 + acct-user/netdata
55 + app-misc/jq
56 + >=app-shells/bash-4:0
57 + || (
58 + net-analyzer/openbsd-netcat
59 + net-analyzer/netcat
60 + )
61 + net-misc/curl
62 + net-misc/wget
63 + sys-apps/util-linux
64 + virtual/awk
65 + caps? ( sys-libs/libcap )
66 + cups? ( net-print/cups )
67 + dbengine? (
68 + dev-libs/libuv
69 + app-arch/lz4
70 + dev-libs/judy
71 + dev-libs/openssl:=
72 + )
73 + compression? ( sys-libs/zlib )
74 + ipmi? ( sys-libs/freeipmi )
75 + nfacct? (
76 + net-firewall/nfacct
77 + net-libs/libmnl
78 + )
79 + nodejs? ( net-libs/nodejs )
80 + python? (
81 + ${PYTHON_DEPS}
82 + dev-python/pyyaml[${PYTHON_USEDEP}]
83 + mysql? (
84 + || (
85 + dev-python/mysqlclient[${PYTHON_USEDEP}]
86 + dev-python/mysql-python[${PYTHON_USEDEP}]
87 + )
88 + )
89 + postgres? ( dev-python/psycopg:2[${PYTHON_USEDEP}] )
90 + tor? ( net-libs/stem[${PYTHON_USEDEP}] )
91 + )
92 + xen? (
93 + app-emulation/xen-tools
94 + dev-libs/yajl
95 + )"
96 +DEPEND="${RDEPEND}
97 + virtual/pkgconfig"
98 +
99 +FILECAPS=(
100 + 'cap_dac_read_search,cap_sys_ptrace+ep' 'usr/libexec/netdata/plugins.d/apps.plugin'
101 +)
102 +
103 +pkg_setup() {
104 + linux-info_pkg_setup
105 +}
106 +
107 +src_prepare() {
108 + default
109 + eautoreconf
110 +}
111 +
112 +src_configure() {
113 + econf \
114 + --localstatedir="${EPREFIX}"/var \
115 + --with-user=netdata \
116 + --disable-jsonc \
117 + $(use_enable cups plugin-cups) \
118 + $(use_enable dbengine) \
119 + $(use_enable nfacct plugin-nfacct) \
120 + $(use_enable ipmi plugin-freeipmi) \
121 + $(use_enable xen plugin-xenstat) \
122 + $(use_enable cpu_flags_x86_sse2 x86-sse) \
123 + $(use_with compression zlib)
124 +}
125 +
126 +src_install() {
127 + default
128 +
129 + rm -rf "${D}/var/cache" || die
130 +
131 + # Remove unneeded .keep files
132 + find "${ED}" -name ".keep" -delete || die
133 +
134 + fowners -Rc netdata:netdata /var/log/netdata
135 + keepdir /var/log/netdata
136 + fowners -Rc netdata:netdata /var/lib/netdata
137 + keepdir /var/lib/netdata
138 + keepdir /var/lib/netdata/registry
139 +
140 + fowners -Rc root:netdata /usr/share/${PN}
141 +
142 + newinitd system/netdata-openrc ${PN}
143 + systemd_dounit system/netdata.service
144 + insinto /etc/netdata
145 + doins system/netdata.conf
146 +}
147 +
148 +pkg_postinst() {
149 + fcaps_pkg_postinst
150 +
151 + if use xen ; then
152 + fcaps 'cap_dac_override' 'usr/libexec/netdata/plugins.d/xenstat.plugin'
153 + fi
154 +}