1 |
commit: c9b8724d6c008b6524314153a66bbc0382fc847a |
2 |
Author: Thomas Deutschmann <whissi <AT> gentoo <DOT> org> |
3 |
AuthorDate: Sun Aug 30 19:11:09 2020 +0000 |
4 |
Commit: Thomas Deutschmann <whissi <AT> gentoo <DOT> org> |
5 |
CommitDate: Sun Aug 30 19:11:09 2020 +0000 |
6 |
URL: https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=c9b8724d |
7 |
|
8 |
app-metrics/collectd: drop old |
9 |
|
10 |
Bug: https://bugs.gentoo.org/730514 |
11 |
Package-Manager: Portage-3.0.4, Repoman-3.0.1 |
12 |
Signed-off-by: Thomas Deutschmann <whissi <AT> gentoo.org> |
13 |
|
14 |
app-metrics/collectd/Manifest | 1 - |
15 |
app-metrics/collectd/collectd-5.10.0.ebuild | 539 ---------------------------- |
16 |
2 files changed, 540 deletions(-) |
17 |
|
18 |
diff --git a/app-metrics/collectd/Manifest b/app-metrics/collectd/Manifest |
19 |
index a588ea2cd5e..5d0f3add513 100644 |
20 |
--- a/app-metrics/collectd/Manifest |
21 |
+++ b/app-metrics/collectd/Manifest |
22 |
@@ -1,2 +1 @@ |
23 |
-DIST collectd-5.10.0.tar.bz2 1856377 BLAKE2B d4c011c5d2d9bfcf8400a35ca92f0b8c82fd58c3201b1b57a6b48c98af63efaab03c5fb1144bae28e7661743626871eaa962959929ff7fcdd5778b72c7054c4e SHA512 1296085fb19bba0c7b7d8684ec877851158b25c9f7b58fc3ae602fba7d7dc718876e730e1cdba96d39101cc5452705bb3445aaee717b219025ae816299b6a3c5 |
24 |
DIST collectd-5.11.0.tar.bz2 1851663 BLAKE2B b07c727ed553b3d11967da734a98fda753794be199377b08a2780b7d3f79acef345f160d930dda68cd12aa0949bbc0aee6ca5e7ae01e16a5e392a4a73e272d1d SHA512 87671545e3d01770c204ba4439265d1c0add6a105bf04ff02dc04db3731fd933d32ecb9b0dc15f2e504d70c3e421a64cf19728c897aa4fb1fda86e393ffc15bf |
25 |
|
26 |
diff --git a/app-metrics/collectd/collectd-5.10.0.ebuild b/app-metrics/collectd/collectd-5.10.0.ebuild |
27 |
deleted file mode 100644 |
28 |
index 08653b81531..00000000000 |
29 |
--- a/app-metrics/collectd/collectd-5.10.0.ebuild |
30 |
+++ /dev/null |
31 |
@@ -1,539 +0,0 @@ |
32 |
-# Copyright 1999-2020 Gentoo Authors |
33 |
-# Distributed under the terms of the GNU General Public License v2 |
34 |
- |
35 |
-EAPI="6" |
36 |
- |
37 |
-PYTHON_COMPAT=( python3_{6,7,8} ) |
38 |
-JAVA_PKG_OPT_USE="collectd_plugins_java" |
39 |
- |
40 |
-inherit autotools fcaps flag-o-matic java-pkg-opt-2 linux-info multilib perl-functions python-single-r1 systemd tmpfiles user |
41 |
- |
42 |
-DESCRIPTION="Collects system statistics and provides mechanisms to store the values" |
43 |
- |
44 |
-HOMEPAGE="https://collectd.org/" |
45 |
-SRC_URI="https://github.com/${PN}/${PN}/releases/download/${PV}/${P}.tar.bz2" |
46 |
- |
47 |
-LICENSE="MIT GPL-2 GPL-2+ GPL-3 GPL-3+" |
48 |
-SLOT="0" |
49 |
-KEYWORDS="~alpha amd64 arm x86" |
50 |
-IUSE="contrib debug java kernel_Darwin kernel_FreeBSD kernel_linux perl selinux static-libs udev xfs" |
51 |
- |
52 |
-# The plugin lists have to follow here since they extend IUSE |
53 |
- |
54 |
-# Plugins that don't build (e.g. dependencies not in Gentoo) |
55 |
-# apple_sensors: Requires libIOKit |
56 |
-# amqp1: Requires libqpid-proton |
57 |
-# aquaero: Requires aerotools-ng/libaquaero5 |
58 |
-# barometer: Requires libi2c (i2c_smbus_read_i2c_block_data) |
59 |
-# dpdkevents: Requires dpdk |
60 |
-# dpdkstat: Requires dpdk |
61 |
-# grpc: Requires libgrpc |
62 |
-# intel_pmu: Requires libjevents (pmu-tools) |
63 |
-# intel_rdt: Requires libpqos from intel-cmt-cat project |
64 |
-# lpar: Requires libperfstat (AIX only) |
65 |
-# mic: Requires Intel Many Integrated Core Architecture API |
66 |
-# (part of Intel's Xeon Phi software) |
67 |
-# netapp: Requires libnetapp (http://communities.netapp.com/docs/DOC-1110) |
68 |
-# pf: Requires BSD packet filter |
69 |
-# pinba: Requires MySQL Pinba engine (http://pinba.org/) |
70 |
-# tape: Requires libkstat (Solaris only) |
71 |
-# tokyotyrant: Requires tokyotyrant |
72 |
-# write_riemann: Requires riemann-c-client |
73 |
-# xmms: Requires libxmms (v1) |
74 |
-# zone: Solaris only... |
75 |
-COLLECTD_IMPOSSIBLE_PLUGINS="apple_sensors amqp1 aquaero barometer dpdkstat |
76 |
- grpc intel_pmu intel_rdt lpar mic netapp pf pinba tape tokyotyrant |
77 |
- write_riemann xmms zone" |
78 |
- |
79 |
-# Plugins that have been (compile) tested and can be enabled via COLLECTD_PLUGINS |
80 |
-COLLECTD_TESTED_PLUGINS="aggregation amqp apache apcups ascent battery bind |
81 |
- ceph cgroups chrony conntrack contextswitch cpu cpufreq cpusleep |
82 |
- csv curl curl_json curl_xml dbi df disk dns drbd email |
83 |
- entropy ethstat exec fhcount filecount fscache gmond gps hddtemp |
84 |
- hugepages interface ipc ipmi iptables ipvs irq java lua |
85 |
- load logfile log_logstash lvm madwifi match_empty_counter |
86 |
- match_hashed match_regex match_timediff match_value mbmon mcelog md |
87 |
- memcachec memcached memory modbus mqtt multimeter mysql netlink |
88 |
- network network nfs nginx notify_desktop notify_email notify_nagios |
89 |
- ntpd numa nut olsrd onewire openldap openvpn oracle ovs_events |
90 |
- ovs_stats perl ping postgresql powerdns processes protocols |
91 |
- python redis routeros rrdcached rrdtool sensors serial sigrok smart |
92 |
- snmp snmp_agent statsd swap sysevent syslog table tail tail_csv |
93 |
- target_notification target_replace target_scale target_set tcpconns |
94 |
- teamspeak2 ted thermal threshold turbostat unixsock |
95 |
- uptime users uuid varnish virt vmem vserver wireless write_graphite |
96 |
- write_http write_kafka write_log write_mongodb write_prometheus |
97 |
- write_redis write_sensu write_tsdb xencpu zfs_arc zookeeper" |
98 |
- |
99 |
-COLLECTD_DISABLED_PLUGINS="${COLLECTD_IMPOSSIBLE_PLUGINS}" |
100 |
- |
101 |
-COLLECTD_ALL_PLUGINS=${COLLECTD_TESTED_PLUGINS} |
102 |
- |
103 |
-for plugin in ${COLLECTD_ALL_PLUGINS}; do |
104 |
- IUSE="${IUSE} collectd_plugins_${plugin}" |
105 |
-done |
106 |
-unset plugin |
107 |
- |
108 |
-# Now come the dependencies. |
109 |
- |
110 |
-COMMON_DEPEND=" |
111 |
- dev-libs/libgcrypt:= |
112 |
- dev-libs/libltdl:0= |
113 |
- perl? ( dev-lang/perl:=[ithreads] ) |
114 |
- udev? ( virtual/udev ) |
115 |
- xfs? ( sys-fs/xfsprogs ) |
116 |
- collectd_plugins_amqp? ( net-libs/rabbitmq-c ) |
117 |
- collectd_plugins_apache? ( net-misc/curl:0= ) |
118 |
- collectd_plugins_ascent? ( net-misc/curl:0= dev-libs/libxml2:2= ) |
119 |
- collectd_plugins_bind? ( net-misc/curl:0= dev-libs/libxml2:2= ) |
120 |
- collectd_plugins_ceph? ( dev-libs/yajl:= ) |
121 |
- collectd_plugins_curl? ( net-misc/curl:0= ) |
122 |
- collectd_plugins_curl_json? ( net-misc/curl:0= dev-libs/yajl:= ) |
123 |
- collectd_plugins_curl_xml? ( net-misc/curl:0= dev-libs/libxml2:2= ) |
124 |
- collectd_plugins_dbi? ( dev-db/libdbi ) |
125 |
- collectd_plugins_dns? ( net-libs/libpcap ) |
126 |
- collectd_plugins_gmond? ( sys-cluster/ganglia ) |
127 |
- collectd_plugins_gps? ( sci-geosciences/gpsd:= ) |
128 |
- collectd_plugins_ipmi? ( >=sys-libs/openipmi-2.0.16-r1 ) |
129 |
- collectd_plugins_iptables? ( >=net-firewall/iptables-1.4.13:0= ) |
130 |
- collectd_plugins_log_logstash? ( dev-libs/yajl:= ) |
131 |
- collectd_plugins_lua? ( dev-lang/lua:0= ) |
132 |
- collectd_plugins_lvm? ( sys-fs/lvm2 ) |
133 |
- collectd_plugins_memcachec? ( dev-libs/libmemcached ) |
134 |
- collectd_plugins_modbus? ( dev-libs/libmodbus ) |
135 |
- collectd_plugins_mqtt? ( app-misc/mosquitto ) |
136 |
- collectd_plugins_mysql? ( dev-db/mysql-connector-c:= ) |
137 |
- collectd_plugins_netlink? ( net-libs/libmnl ) |
138 |
- collectd_plugins_nginx? ( net-misc/curl:0= ) |
139 |
- collectd_plugins_notify_desktop? ( x11-libs/libnotify ) |
140 |
- collectd_plugins_notify_email? ( net-libs/libesmtp ) |
141 |
- collectd_plugins_nut? ( >=sys-power/nut-2.7.2-r2 ) |
142 |
- collectd_plugins_openldap? ( net-nds/openldap ) |
143 |
- collectd_plugins_onewire? ( >=sys-fs/owfs-3.1:= ) |
144 |
- collectd_plugins_oracle? ( dev-db/oracle-instantclient-basic ) |
145 |
- collectd_plugins_ovs_events? ( dev-libs/yajl:= ) |
146 |
- collectd_plugins_ovs_stats? ( dev-libs/yajl:= ) |
147 |
- collectd_plugins_perl? ( dev-lang/perl:=[ithreads] ) |
148 |
- collectd_plugins_ping? ( net-libs/liboping ) |
149 |
- collectd_plugins_postgresql? ( dev-db/postgresql:= ) |
150 |
- collectd_plugins_python? ( ${PYTHON_DEPS} ) |
151 |
- collectd_plugins_redis? ( dev-libs/hiredis:= ) |
152 |
- collectd_plugins_routeros? ( net-libs/librouteros ) |
153 |
- collectd_plugins_rrdcached? ( net-analyzer/rrdtool:= ) |
154 |
- collectd_plugins_rrdtool? ( net-analyzer/rrdtool:= ) |
155 |
- collectd_plugins_sensors? ( sys-apps/lm-sensors:= ) |
156 |
- collectd_plugins_sigrok? ( <sci-libs/libsigrok-0.4:= dev-libs/glib:2 ) |
157 |
- collectd_plugins_smart? ( dev-libs/libatasmart ) |
158 |
- collectd_plugins_snmp? ( net-analyzer/net-snmp ) |
159 |
- collectd_plugins_snmp_agent? ( net-analyzer/net-snmp ) |
160 |
- collectd_plugins_sysevent? ( dev-libs/yajl:= ) |
161 |
- collectd_plugins_varnish? ( www-servers/varnish:= ) |
162 |
- collectd_plugins_virt? ( app-emulation/libvirt:= dev-libs/libxml2:2= ) |
163 |
- collectd_plugins_write_http? ( net-misc/curl:0= dev-libs/yajl:= ) |
164 |
- collectd_plugins_write_kafka? ( >=dev-libs/librdkafka-0.9.0.99:= dev-libs/yajl:= ) |
165 |
- collectd_plugins_write_mongodb? ( >=dev-libs/mongo-c-driver-1.8.2:= ) |
166 |
- collectd_plugins_write_prometheus? ( >=dev-libs/protobuf-c-1.2.1-r1:= net-libs/libmicrohttpd:= ) |
167 |
- collectd_plugins_write_redis? ( dev-libs/hiredis:= ) |
168 |
- collectd_plugins_xencpu? ( app-emulation/xen-tools:= ) |
169 |
- |
170 |
- kernel_FreeBSD? ( |
171 |
- collectd_plugins_disk? ( sys-libs/libstatgrab:= ) |
172 |
- collectd_plugins_interface? ( sys-libs/libstatgrab:= ) |
173 |
- collectd_plugins_load? ( sys-libs/libstatgrab:= ) |
174 |
- collectd_plugins_memory? ( sys-libs/libstatgrab:= ) |
175 |
- collectd_plugins_swap? ( sys-libs/libstatgrab:= ) |
176 |
- collectd_plugins_users? ( sys-libs/libstatgrab:= ) |
177 |
- )" |
178 |
- |
179 |
-# Enforcing !=sys-kernel/linux-headers-4.5 > due to #577846 |
180 |
-DEPEND="${COMMON_DEPEND} |
181 |
- collectd_plugins_iptables? ( || ( <=sys-kernel/linux-headers-4.4 >=sys-kernel/linux-headers-4.6 ) ) |
182 |
- collectd_plugins_java? ( >=virtual/jdk-1.6 ) |
183 |
- virtual/pkgconfig" |
184 |
- |
185 |
-RDEPEND="${COMMON_DEPEND} |
186 |
- collectd_plugins_java? ( >=virtual/jre-1.6 ) |
187 |
- collectd_plugins_syslog? ( virtual/logger ) |
188 |
- selinux? ( sec-policy/selinux-collectd )" |
189 |
- |
190 |
-REQUIRED_USE=" |
191 |
- collectd_plugins_python? ( ${PYTHON_REQUIRED_USE} ) |
192 |
- collectd_plugins_smart? ( udev )" |
193 |
- |
194 |
-# @FUNCTION: collectd_plugin_kernel_linux |
195 |
-# @DESCRIPTION: |
196 |
-# USAGE: <plugin name> <kernel_options> <severity> |
197 |
-# kernel_options is a list of kernel configurations options; the check tests whether at least |
198 |
-# one of them is enabled. If no, depending on the third argument an elog, ewarn, or eerror message |
199 |
-# is emitted. |
200 |
-collectd_plugin_kernel_linux() { |
201 |
- local multi_opt opt |
202 |
- if has ${1} ${COLLECTD_ALL_PLUGINS}; then |
203 |
- if use collectd_plugins_${1}; then |
204 |
- for opt in ${2}; do |
205 |
- if linux_chkconfig_present ${opt}; then |
206 |
- return 0; |
207 |
- fi |
208 |
- done |
209 |
- multi_opt=${2//\ /\ or\ } |
210 |
- case ${3} in |
211 |
- (info) |
212 |
- elog "The ${1} plugin can use kernel features that are disabled now; enable ${multi_opt} in your kernel" |
213 |
- ;; |
214 |
- (warn) |
215 |
- ewarn "The ${1} plugin uses kernel features that are disabled now; enable ${multi_opt} in your kernel" |
216 |
- ;; |
217 |
- (error) |
218 |
- eerror "The ${1} plugin needs kernel features that are disabled now; enable ${multi_opt} in your kernel" |
219 |
- ;; |
220 |
- (*) |
221 |
- die "function collectd_plugin_kernel_linux called with invalid third argument" |
222 |
- ;; |
223 |
- esac |
224 |
- fi |
225 |
- fi |
226 |
-} |
227 |
- |
228 |
-collectd_linux_kernel_checks() { |
229 |
- if ! linux_chkconfig_present PROC_FS; then |
230 |
- ewarn "/proc file system support is disabled, many plugins will not be able to read any statistics from your system unless you enable PROC_FS in your kernel" |
231 |
- fi |
232 |
- |
233 |
- if ! linux_chkconfig_present SYSFS; then |
234 |
- ewarn "/sys file system support is disabled, many plugins will not be able to read any statistics from your system unless you enable SYSFS in your kernel" |
235 |
- fi |
236 |
- |
237 |
- # battery.c: /proc/pmu/battery_%i |
238 |
- # battery.c: /proc/acpi/battery |
239 |
- collectd_plugin_kernel_linux battery ACPI_BATTERY warn |
240 |
- |
241 |
- # cgroups.c: /sys/fs/cgroup/ |
242 |
- collectd_plugin_kernel_linux cgroups CGROUPS warn |
243 |
- |
244 |
- # cpufreq.c: /sys/devices/system/cpu/cpu%d/cpufreq/ |
245 |
- collectd_plugin_kernel_linux cpufreq SYSFS warn |
246 |
- collectd_plugin_kernel_linux cpufreq CPU_FREQ_STAT warn |
247 |
- |
248 |
- # drbd.c: /proc/drbd |
249 |
- collectd_plugin_kernel_linux drbd BLK_DEV_DRBD warn |
250 |
- |
251 |
- # conntrack.c: /proc/sys/net/netfilter/* |
252 |
- collectd_plugin_kernel_linux conntrack NETFILTER warn |
253 |
- |
254 |
- # fscache.c: /proc/fs/fscache/stats |
255 |
- collectd_plugin_kernel_linux fscache FSCACHE warn |
256 |
- |
257 |
- # nfs.c: /proc/net/rpc/nfs |
258 |
- # nfs.c: /proc/net/rpc/nfsd |
259 |
- collectd_plugin_kernel_linux nfs NFS_COMMON warn |
260 |
- |
261 |
- # serial.c: /proc/tty/driver/serial |
262 |
- # serial.c: /proc/tty/driver/ttyS |
263 |
- collectd_plugin_kernel_linux serial SERIAL_CORE warn |
264 |
- |
265 |
- # swap.c: /proc/meminfo |
266 |
- collectd_plugin_kernel_linux swap SWAP warn |
267 |
- |
268 |
- # thermal.c: /proc/acpi/thermal_zone |
269 |
- # thermal.c: /sys/class/thermal |
270 |
- collectd_plugin_kernel_linux thermal ACPI_THERMAL warn |
271 |
- |
272 |
- # turbostat.c: /dev/cpu/%d/msr |
273 |
- collectd_plugin_kernel_linux turbostat X86_MSR warn |
274 |
- |
275 |
- # vmem.c: /proc/vmstat |
276 |
- collectd_plugin_kernel_linux vmem VM_EVENT_COUNTERS warn |
277 |
- |
278 |
- # vserver.c: /proc/virtual |
279 |
- collectd_plugin_kernel_linux vserver VSERVER warn |
280 |
- |
281 |
- # uuid.c: /sys/hypervisor/uuid |
282 |
- collectd_plugin_kernel_linux uuid SYSFS info |
283 |
- |
284 |
- # wireless.c: /proc/net/wireless |
285 |
- collectd_plugin_kernel_linux wireless "WIRELESS MAC80211 IEEE80211" warn |
286 |
- |
287 |
- # zfs_arc.c: /proc/spl/kstat/zfs/arcstats |
288 |
- collectd_plugin_kernel_linux zfs_arc "SPL ZFS" warn |
289 |
-} |
290 |
- |
291 |
-pkg_setup() { |
292 |
- if use kernel_linux; then |
293 |
- linux-info_pkg_setup |
294 |
- |
295 |
- if linux_config_exists; then |
296 |
- einfo "Checking your linux kernel configuration:" |
297 |
- collectd_linux_kernel_checks |
298 |
- else |
299 |
- elog "Cannot find a linux kernel configuration. Continuing anyway." |
300 |
- fi |
301 |
- fi |
302 |
- |
303 |
- if use collectd_plugins_java; then |
304 |
- java-pkg-opt-2_pkg_setup |
305 |
- fi |
306 |
- |
307 |
- use collectd_plugins_python && python-single-r1_pkg_setup |
308 |
- |
309 |
- enewgroup collectd |
310 |
- enewuser collectd -1 -1 /var/lib/collectd collectd |
311 |
-} |
312 |
- |
313 |
-src_prepare() { |
314 |
- default |
315 |
- |
316 |
- # There's some strange prefix handling in the default config file, resulting in |
317 |
- # paths like "/usr/var/..." |
318 |
- sed -i -e "s:@prefix@/var:/var:g" src/collectd.conf.in || die |
319 |
- |
320 |
- # Adjust upstream's systemd unit |
321 |
- # - Get rid of EnvironmentFile directive; These files don't exist on Gentoo! |
322 |
- # - Add User=collectd to run collectd as user "collectd" per default |
323 |
- sed -i \ |
324 |
- -e '/^EnvironmentFile=.*/d' \ |
325 |
- -e '/^\[Service\]/aUser=collectd' \ |
326 |
- contrib/systemd.${PN}.service || die |
327 |
- |
328 |
- eautoreconf |
329 |
-} |
330 |
- |
331 |
-src_configure() { |
332 |
- # Now come the lists of os-dependent plugins. Any plugin that is not listed anywhere here |
333 |
- # should work independent of the operating system. |
334 |
- |
335 |
- local linux_plugins="barometer battery cpu cpufreq disk |
336 |
- drbd entropy ethstat hugepages interface iptables |
337 |
- ipvs irq ipc load memory md netlink nfs numa processes |
338 |
- serial swap tcpconns thermal turbostat users vmem wireless |
339 |
- zfc_arc" |
340 |
- |
341 |
- local need_libstatgrab=0 |
342 |
- local libstatgrab_plugins="cpu disk interface load memory swap users" |
343 |
- local bsd_plugins="cpu tcpconns ${libstatgrab_plugins} zfc_arc" |
344 |
- |
345 |
- local darwin_plugins="apple_sensors battery cpu disk interface memory processes tcpconns" |
346 |
- |
347 |
- local osdependent_plugins="${linux_plugins} ${bsd_plugins} ${darwin_plugins}" |
348 |
- local myos_plugins="" |
349 |
- if use kernel_linux; then |
350 |
- einfo "Enabling Linux plugins." |
351 |
- myos_plugins=${linux_plugins} |
352 |
- elif use kernel_FreeBSD; then |
353 |
- einfo "Enabling FreeBSD plugins." |
354 |
- myos_plugins=${bsd_plugins} |
355 |
- elif use kernel_Darwin; then |
356 |
- einfo "Enabling Darwin plugins." |
357 |
- myos_plugins=${darwin_plugins} |
358 |
- fi |
359 |
- |
360 |
- local myconf="--disable-werror" |
361 |
- |
362 |
- # Do we debug? |
363 |
- myconf+=" $(use_enable debug)" |
364 |
- |
365 |
- # udev support? |
366 |
- # Required for smart plugin via REQUIRED_USE; Optional for disk plugin |
367 |
- if use udev; then |
368 |
- myconf+=" --with-libudev" |
369 |
- else |
370 |
- myconf+=" --without-libudev" |
371 |
- fi |
372 |
- |
373 |
- local plugin |
374 |
- |
375 |
- # Disable what needs to be disabled. |
376 |
- for plugin in ${COLLECTD_DISABLED_PLUGINS}; do |
377 |
- if [[ "${plugin}" == 'dpdkstat' ]]; then |
378 |
- myconf+=" --without-libdpdk" |
379 |
- else |
380 |
- myconf+=" --disable-${plugin}" |
381 |
- fi |
382 |
- done |
383 |
- |
384 |
- # Set enable/disable for each single plugin. |
385 |
- for plugin in ${COLLECTD_ALL_PLUGINS}; do |
386 |
- if has ${plugin} ${osdependent_plugins}; then |
387 |
- # plugin is os-dependent ... |
388 |
- if has ${plugin} ${myos_plugins}; then |
389 |
- # ... and available in this os |
390 |
- myconf+=" $(use_enable collectd_plugins_${plugin} ${plugin})" |
391 |
- # ... must we link against libstatgrab? Bug #541518 |
392 |
- if use kernel_FreeBSD && has ${plugin} ${libstatgrab_plugins}; then |
393 |
- einfo "We must link against libstatgrab due to plugin \"${plugin}\" ..." |
394 |
- need_libstatgrab=1 |
395 |
- fi |
396 |
- else |
397 |
- # ... and NOT available in this os |
398 |
- if use collectd_plugins_${plugin}; then |
399 |
- ewarn "You try to enable the ${plugin} plugin, but it is not available for this" |
400 |
- ewarn "kernel. Disabling it automatically." |
401 |
- fi |
402 |
- myconf+=" --disable-${plugin}" |
403 |
- fi |
404 |
- elif [[ "${plugin}" = "collectd_plugins_perl" ]]; then |
405 |
- if use collectd_plugins_perl && ! use perl; then |
406 |
- ewarn "Perl plugin disabled as perl bindings disabled by -perl use flag" |
407 |
- myconf+= --disable-perl |
408 |
- else |
409 |
- myconf+=" $(use_enable collectd_plugins_${plugin} ${plugin})" |
410 |
- fi |
411 |
- else |
412 |
- myconf+=" $(use_enable collectd_plugins_${plugin} ${plugin})" |
413 |
- fi |
414 |
- done |
415 |
- |
416 |
- if [ "${need_libstatgrab}" -eq 1 ]; then |
417 |
- myconf+=" --with-libstatgrab" |
418 |
- else |
419 |
- myconf+=" --without-libstatgrab" |
420 |
- fi |
421 |
- |
422 |
- # JAVA_HOME is set by eclasses. |
423 |
- if use collectd_plugins_java; then |
424 |
- myconf+=" --with-java" |
425 |
- fi |
426 |
- |
427 |
- # Need libiptc ONLY for iptables. If we try to use it otherwise bug 340109 happens. |
428 |
- # lots of libs are only needed for plugins, if they are disabled, also disable the lib |
429 |
- use collectd_plugins_iptables || myconf+=" --with-libiptc=no" |
430 |
- use collectd_plugins_openldap || myconf+=" --with-libldap=no" |
431 |
- use collectd_plugins_redis || use collectd_plugins_write_redis || myconf+=" --with-libhiredis=no" |
432 |
- use collectd_plugins_smart || myconf+=" --with-libatasmart=no" |
433 |
- use collectd_plugins_gps || myconf+=" --with-libgps=no" |
434 |
- |
435 |
- if use perl; then |
436 |
- myconf+=" --with-perl-bindings=INSTALLDIRS=vendor" |
437 |
- else |
438 |
- myconf+=" --without-perl-bindings" |
439 |
- fi |
440 |
- |
441 |
- # No need for v5upgrade |
442 |
- myconf+=" --disable-target_v5upgrade" |
443 |
- |
444 |
- # Python |
445 |
- if use collectd_plugins_python; then |
446 |
- myconf+=" --with-libpython=yes" |
447 |
- export PYTHON_CONFIG=$(python_get_PYTHON_CONFIG) |
448 |
- else |
449 |
- myconf+=" --with-libpython=no" |
450 |
- fi |
451 |
- |
452 |
- # XFS support |
453 |
- myconf+=" $(use_enable xfs)" |
454 |
- |
455 |
- # Finally, run econf. |
456 |
- KERNEL_DIR="${KERNEL_DIR}" econf --config-cache \ |
457 |
- $(use_enable static-libs static) \ |
458 |
- --localstatedir=/var ${myconf} |
459 |
-} |
460 |
- |
461 |
-src_install() { |
462 |
- emake DESTDIR="${D%/}" install |
463 |
- |
464 |
- perl_delete_localpod |
465 |
- |
466 |
- find "${ED}"usr/ -name "*.la" -delete || die |
467 |
- |
468 |
- if use collectd_plugins_java; then |
469 |
- java-pkg_regjar "${ED}"usr/share/${PN}/java/*.jar |
470 |
- fi |
471 |
- |
472 |
- fowners root:collectd /etc/collectd.conf |
473 |
- fperms u=rw,g=r,o= /etc/collectd.conf |
474 |
- |
475 |
- dodoc AUTHORS ChangeLog README |
476 |
- |
477 |
- if use contrib ; then |
478 |
- insinto /usr/share/${PN} |
479 |
- doins -r contrib |
480 |
- fi |
481 |
- |
482 |
- keepdir /var/lib/${PN} |
483 |
- fowners collectd:collectd /var/lib/${PN} |
484 |
- |
485 |
- newinitd "${FILESDIR}/${PN}.initd-r2" ${PN} |
486 |
- newconfd "${FILESDIR}/${PN}.confd-r2" ${PN} |
487 |
- systemd_newunit "contrib/systemd.${PN}.service" ${PN}.service |
488 |
- |
489 |
- insinto /etc/logrotate.d |
490 |
- newins "${FILESDIR}/${PN}.logrotate" ${PN} |
491 |
- |
492 |
- newtmpfiles "${FILESDIR}"/${PN}.tmpfile ${PN}.conf |
493 |
- |
494 |
- sed -i -e 's:^.*PIDFile "/var/run/collectd.pid":#PIDFile "/run/collectd.pid":' "${ED}"etc/collectd.conf || die |
495 |
- sed -i -e 's:^# SocketFile "/var/run/collectd-unixsock":# SocketFile "/run/collectd/collectd.socket":' "${ED}"etc/collectd.conf || die |
496 |
- sed -i -e 's:^.*LoadPlugin perl$:# The new, correct way to load the perl plugin -- \n# <LoadPlugin perl>\n# Globals true\n# </LoadPlugin>:' "${ED}"etc/collectd.conf || die |
497 |
- sed -i -e 's:^.*LoadPlugin python$:# The new, correct way to load the python plugin -- \n# <LoadPlugin python>\n# Globals true\n# </LoadPlugin>:' "${ED}"etc/collectd.conf || die |
498 |
-} |
499 |
- |
500 |
-pkg_postinst() { |
501 |
- tmpfiles_process "${PN}.conf" |
502 |
- |
503 |
- if use filecaps; then |
504 |
- local caps=() |
505 |
- use collectd_plugins_ceph && caps+=('CAP_DAC_OVERRIDE') |
506 |
- use collectd_plugins_exec && caps+=('CAP_SETUID' 'CAP_SETGID') |
507 |
- use collectd_plugins_iptables && caps+=('CAP_NET_ADMIN') |
508 |
- use collectd_plugins_filecount && caps+=('CAP_DAC_READ_SEARCH') |
509 |
- |
510 |
- if use collectd_plugins_dns || use collectd_plugins_ping; then |
511 |
- caps+=('CAP_NET_RAW') |
512 |
- fi |
513 |
- |
514 |
- if use collectd_plugins_turbostat || use collectd_plugins_smart; then |
515 |
- caps+=('CAP_SYS_RAWIO') |
516 |
- fi |
517 |
- |
518 |
- if [ ${#caps[@]} -gt 0 ]; then |
519 |
- local caps_str=$(IFS=","; echo "${caps[*]}") |
520 |
- fcaps ${caps_str} usr/sbin/collectd |
521 |
- elog "Capabilities for ${EROOT}usr/sbin/collectd set to:" |
522 |
- elog " ${caps_str}+EP" |
523 |
- elog |
524 |
- |
525 |
- local systemd_unit="$(systemd_get_systemunitdir)/collectd.service" |
526 |
- if [[ -e "${systemd_unit}" ]]; then |
527 |
- caps_str="${caps[*]}" |
528 |
- sed -i -e "s:^CapabilityBoundingSet=.*:CapabilityBoundingSet=${caps_str}:" "${systemd_unit}" || \ |
529 |
- die "Failed to set CapabilityBoundingSet in '${systemd_unit}'" |
530 |
- |
531 |
- elog "CapabilityBoundingSet in '${systemd_unit}'" |
532 |
- elog "updated to match capabilities set above." |
533 |
- elog |
534 |
- else |
535 |
- if has_version "sys-apps/systemd"; then |
536 |
- # Bug 596852 |
537 |
- ewarn "Failed to update CapabilityBoundingSet in '${systemd_unit}'" |
538 |
- ewarn "because unit was not found. Please file a bug about this." |
539 |
- fi |
540 |
- fi |
541 |
- fi |
542 |
- fi |
543 |
- |
544 |
- elog "Note: Collectd is only the collector." |
545 |
- elog " You need to install 'data' sources (applications) locally or" |
546 |
- elog " remotely on your own." |
547 |
- |
548 |
- elog |
549 |
- elog "Collectd is configured to run as unprivileged user by default." |
550 |
- elog "You may want to revisit the configuration." |
551 |
- elog |
552 |
- |
553 |
- if use collectd_plugins_email; then |
554 |
- ewarn "The email plug-in is deprecated. To submit statistics please use the unixsock plugin." |
555 |
- fi |
556 |
- |
557 |
- if use collectd_plugins_smart; then |
558 |
- elog "" |
559 |
- elog "If you are using smart plugin and don't run collectd as root make sure" |
560 |
- elog "that the collectd user is allowed to access the disk you want to monitor" |
561 |
- elog "(can be done via udev rule for example) and that collectd has the required" |
562 |
- elog "capabilities set (which is the default when package was emerged with" |
563 |
- elog "'filecaps' USE flag set)." |
564 |
- fi |
565 |
- |
566 |
- if use contrib; then |
567 |
- elog "The scripts in /usr/share/doc/${PF}/collection3 for generating graphs need dev-perl/HTML-Parser," |
568 |
- elog "dev-perl/config-general, dev-perl/regexp-common, and net-analyzer/rrdtool[perl] to be installed." |
569 |
- fi |
570 |
-} |