Gentoo Archives: gentoo-commits

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