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-admin/collectd/files/, app-admin/collectd/
Date: Thu, 13 Oct 2016 20:49:19
Message-Id: 1476391732.180eeb25679dbf994da5571521187938e8ec8354.whissi@gentoo
1 commit: 180eeb25679dbf994da5571521187938e8ec8354
2 Author: Thomas Deutschmann <whissi <AT> gentoo <DOT> org>
3 AuthorDate: Thu Oct 13 20:48:26 2016 +0000
4 Commit: Thomas Deutschmann <whissi <AT> gentoo <DOT> org>
5 CommitDate: Thu Oct 13 20:48:52 2016 +0000
6 URL: https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=180eeb25
7
8 app-admin/collectd: Revision bump to address multiple issues
9
10 - When collectd was emerged with "filecaps" USE flag set and at least one
11 chosen plugin required special capabilities systemd was unable to start
12 collectd because CapabilityBoundingSet option in collectd's systemd unit
13 file did not match with the capabilities actual set for
14 "/usr/sbin/collectd". (bug #596852)
15
16 - Cherry picked upstream commit 5e4f2ae61d to get rid of
17
18 > capability: warning: `collectd' uses 32-bit capabilities (legacy support in use)
19
20 message.
21
22 Gentoo-Bug: https://bugs.gentoo.org/596852
23
24 Package-Manager: portage-2.3.2
25
26 app-admin/collectd/Manifest | 1 -
27 app-admin/collectd/collectd-5.6.0.ebuild | 499 ---------------------
28 ...lectd-5.6.1.ebuild => collectd-5.6.1-r1.ebuild} | 54 ++-
29 .../files/collectd-5.6.0-fix-apache-plugin.patch | 26 --
30 .../collectd/files/collectd-5.6.0-issue-1896.patch | 76 ----
31 ...ctd-5.6.0-use-_LINUX_CAPABILITY_VERSION_3.patch | 37 ++
32 6 files changed, 75 insertions(+), 618 deletions(-)
33
34 diff --git a/app-admin/collectd/Manifest b/app-admin/collectd/Manifest
35 index 2485930..ad706b1 100644
36 --- a/app-admin/collectd/Manifest
37 +++ b/app-admin/collectd/Manifest
38 @@ -1,3 +1,2 @@
39 DIST collectd-5.5.2.tar.bz2 1800476 SHA256 017f3a4062187e594d8ab6af685655fb82a8a942dc574668e68242bdb8ba820f SHA512 9d311db4f3677b95e3a47c03af01bdf1127957f6fccb6c601455632d0ea3b39e3f4cd9a6f8f510083e208714bbb0da2e04aaa574a90b0ad6fe984506675475b3 WHIRLPOOL 98ed4fb29eec0ae660d3e1651380a3f17f7bf7f22e687633c4a44974bc84e49cf8de11fd6fea349bfe24809ac3c29a407459a1203b72bcf741e1587c6c0b1773
40 -DIST collectd-5.6.0.tar.bz2 1818470 SHA256 f0ffbbd91fac3682bd324a74b9b4c9eabe781394b303b5cfd457c4cfbe748623 SHA512 5eecd7fe1619850b29e7853e0ab8f9eb7688d0fdf5687cf04930c75a94181c53d7dc0601a1dfa02417bdeb63cccf09b87acd7129e7f155b8d11147ec46982ed8 WHIRLPOOL 690e50f16318e9df39eac62010f8b0a57059356deeedd72505cc4a980876261a198edac095317f97b03913167dcfc49bf9f3b46986bbc3653628856e3a005111
41 DIST collectd-5.6.1.tar.bz2 1903962 SHA256 c30ff644f91407b4dc2d99787b99cc45ec00e538bd1cc269429d3c5e8a4aee2c SHA512 da25f1a9cbaf47533f5a4d2f5f78b966317d4f21865c5a714954ad9d7d02b4798a3e0471ce52199dc80e01dc2808376cb10a7e19c402aafc984bf595f09951a6 WHIRLPOOL 68ed2b27bbd48f5af5e29743dcd2871ab4c2904d5593bbb6f3e68129f318389e32e13b256d489ea7842b90c406974511c8f324383253c7b438e7b6a9d36d299d
42
43 diff --git a/app-admin/collectd/collectd-5.6.0.ebuild b/app-admin/collectd/collectd-5.6.0.ebuild
44 deleted file mode 100644
45 index 9233874..00000000
46 --- a/app-admin/collectd/collectd-5.6.0.ebuild
47 +++ /dev/null
48 @@ -1,499 +0,0 @@
49 -# Copyright 1999-2016 Gentoo Foundation
50 -# Distributed under the terms of the GNU General Public License v2
51 -# $Id$
52 -
53 -EAPI="6"
54 -
55 -PYTHON_COMPAT=( python{2_7,3_4,3_5} )
56 -JAVA_PKG_OPT_USE="collectd_plugins_java"
57 -
58 -inherit autotools fcaps flag-o-matic java-pkg-opt-2 linux-info multilib perl-functions python-single-r1 systemd user
59 -
60 -DESCRIPTION="Collects system statistics and provides mechanisms to store the values"
61 -
62 -HOMEPAGE="https://collectd.org/"
63 -SRC_URI="${HOMEPAGE}/files/${P}.tar.bz2"
64 -
65 -LICENSE="GPL-2"
66 -SLOT="0"
67 -KEYWORDS="~amd64 ~arm ~x86"
68 -IUSE="contrib debug java kernel_Darwin kernel_FreeBSD kernel_linux perl selinux static-libs udev xfs"
69 -
70 -# The plugin lists have to follow here since they extend IUSE
71 -
72 -# Plugins that don't build (e.g. dependencies not in Gentoo)
73 -# apple_sensors: Requires libIOKit
74 -# aquaero: Requires aerotools-ng/libaquaero5
75 -# barometer: Requires libi2c (i2c_smbus_read_i2c_block_data)
76 -# grpc: Requires libgrpc
77 -# lpar: Requires libperfstat (AIX only)
78 -# mic: Requires Intel Many Integrated Core Architecture API
79 -# (part of Intel's Xeon Phi software)
80 -# netapp: Requires libnetapp (http://communities.netapp.com/docs/DOC-1110)
81 -# pf: Requires BSD packet filter
82 -# pinba: Requires MySQL Pinba engine (http://pinba.org/)
83 -# tape: Requires libkstat (Solaris only)
84 -# write_mongodb: https://github.com/collectd/collectd/issues/492
85 -# write_riemann: Requires riemann-c-client
86 -# xmms: Requires libxmms (v1)
87 -# zone: Solaris only...
88 -COLLECTD_IMPOSSIBLE_PLUGINS="apple_sensors aquaero barometer grpc lpar mic
89 - netapp pf pinba tape write_kafka write_mongodb write_riemann xmms
90 - zone"
91 -
92 -# Plugins that have been (compile) tested and can be enabled via COLLECTD_PLUGINS
93 -COLLECTD_TESTED_PLUGINS="aggregation amqp apache apcups ascent battery bind
94 - ceph cgroups chrony conntrack contextswitch cpu cpufreq cpusleep
95 - csv curl curl_json curl_xml dbi df disk dns drbd email entropy
96 - ethstat exec fhcount filecount fscache gmond gps hddtemp interface
97 - ipc ipmi iptables ipvs irq java lua load logfile log_logstash lvm
98 - madwifi match_empty_counter match_hashed match_regex match_timediff
99 - match_value mbmon md memcachec memcached memory modbus mqtt
100 - multimeter mysql netlink network network nfs nginx notify_desktop
101 - notify_email notify_nagios ntpd numa nut olsrd onewire openldap
102 - openvpn oracle perl ping postgresql powerdns processes protocols
103 - python python redis routeros rrdcached rrdtool sensors serial
104 - sigrok smart snmp statsd swap syslog table tail tail_csv
105 - target_notification target_replace target_scale target_set tcpconns
106 - teamspeak2 ted thermal threshold tokyotyrant turbostat unixsock
107 - uptime users uuid varnish virt vmem vserver wireless write_graphite
108 - write_http write_kafka write_log write_redis write_sensu write_tsdb
109 - xencpu zfs_arc zookeeper"
110 -
111 -COLLECTD_DISABLED_PLUGINS="${COLLECTD_IMPOSSIBLE_PLUGINS}"
112 -
113 -COLLECTD_ALL_PLUGINS=${COLLECTD_TESTED_PLUGINS}
114 -
115 -for plugin in ${COLLECTD_ALL_PLUGINS}; do
116 - IUSE="${IUSE} collectd_plugins_${plugin}"
117 -done
118 -unset plugin
119 -
120 -# Now come the dependencies.
121 -
122 -COMMON_DEPEND="
123 - dev-libs/libgcrypt:=
124 - dev-libs/libltdl:0=
125 - perl? ( dev-lang/perl:=[ithreads] )
126 - udev? ( virtual/udev )
127 - xfs? ( sys-fs/xfsprogs )
128 - collectd_plugins_amqp? ( net-libs/rabbitmq-c )
129 - collectd_plugins_apache? ( net-misc/curl:0= )
130 - collectd_plugins_ascent? ( net-misc/curl:0= dev-libs/libxml2:2= )
131 - collectd_plugins_bind? ( dev-libs/libxml2:2= )
132 - collectd_plugins_ceph? ( dev-libs/yajl:= )
133 - collectd_plugins_curl? ( net-misc/curl:0= )
134 - collectd_plugins_curl_json? ( net-misc/curl:0= dev-libs/yajl:= )
135 - collectd_plugins_curl_xml? ( net-misc/curl:0= dev-libs/libxml2:2= )
136 - collectd_plugins_dbi? ( dev-db/libdbi )
137 - collectd_plugins_dns? ( net-libs/libpcap )
138 - collectd_plugins_gmond? ( sys-cluster/ganglia )
139 - collectd_plugins_gps? ( sci-geosciences/gpsd )
140 - collectd_plugins_ipmi? ( >=sys-libs/openipmi-2.0.16-r1 )
141 - collectd_plugins_iptables? ( >=net-firewall/iptables-1.4.13:0= )
142 - collectd_plugins_log_logstash? ( dev-libs/yajl:= )
143 - collectd_plugins_lua? ( dev-lang/lua:0= )
144 - collectd_plugins_lvm? ( sys-fs/lvm2 )
145 - collectd_plugins_memcachec? ( dev-libs/libmemcached )
146 - collectd_plugins_modbus? ( dev-libs/libmodbus )
147 - collectd_plugins_mqtt? ( app-misc/mosquitto )
148 - collectd_plugins_mysql? ( >=virtual/mysql-5.0 )
149 - collectd_plugins_netlink? ( net-libs/libmnl )
150 - collectd_plugins_nginx? ( net-misc/curl:0= )
151 - collectd_plugins_notify_desktop? ( x11-libs/libnotify )
152 - collectd_plugins_notify_email? ( net-libs/libesmtp )
153 - collectd_plugins_nut? ( >=sys-power/nut-2.7.2-r2 )
154 - collectd_plugins_openldap? ( net-nds/openldap )
155 - collectd_plugins_onewire? ( >=sys-fs/owfs-3.1:= )
156 - collectd_plugins_oracle? ( dev-db/oracle-instantclient-basic )
157 - collectd_plugins_perl? ( dev-lang/perl:=[ithreads] )
158 - collectd_plugins_ping? ( net-libs/liboping )
159 - collectd_plugins_postgresql? ( dev-db/postgresql:= )
160 - collectd_plugins_python? ( ${PYTHON_DEPS} )
161 - collectd_plugins_redis? ( dev-libs/hiredis:= )
162 - collectd_plugins_routeros? ( net-libs/librouteros )
163 - collectd_plugins_rrdcached? ( net-analyzer/rrdtool:= )
164 - collectd_plugins_rrdtool? ( net-analyzer/rrdtool:= )
165 - collectd_plugins_sensors? ( sys-apps/lm_sensors )
166 - collectd_plugins_sigrok? ( <sci-libs/libsigrok-0.4 )
167 - collectd_plugins_smart? ( dev-libs/libatasmart )
168 - collectd_plugins_snmp? ( net-analyzer/net-snmp )
169 - collectd_plugins_tokyotyrant? ( net-misc/tokyotyrant )
170 - collectd_plugins_varnish? ( www-servers/varnish )
171 - collectd_plugins_virt? ( app-emulation/libvirt:= dev-libs/libxml2:2= )
172 - collectd_plugins_write_http? ( net-misc/curl:0= )
173 - collectd_plugins_write_kafka? ( >=dev-libs/librdkafka-0.9.0.99:= )
174 - collectd_plugins_write_redis? ( dev-libs/hiredis:= )
175 - collectd_plugins_xencpu? ( app-emulation/xen-tools )
176 -
177 - kernel_FreeBSD? (
178 - collectd_plugins_disk? ( sys-libs/libstatgrab:= )
179 - collectd_plugins_interface? ( sys-libs/libstatgrab:= )
180 - collectd_plugins_load? ( sys-libs/libstatgrab:= )
181 - collectd_plugins_memory? ( sys-libs/libstatgrab:= )
182 - collectd_plugins_swap? ( sys-libs/libstatgrab:= )
183 - collectd_plugins_users? ( sys-libs/libstatgrab:= )
184 - )"
185 -
186 -# Enforcing <=sys-kernel/linux-headers-4.4 due to #577846
187 -DEPEND="${COMMON_DEPEND}
188 - collectd_plugins_iptables? ( <=sys-kernel/linux-headers-4.4 )
189 - collectd_plugins_java? ( >=virtual/jdk-1.6 )
190 - virtual/pkgconfig"
191 -
192 -RDEPEND="${COMMON_DEPEND}
193 - collectd_plugins_java? ( >=virtual/jre-1.6 )
194 - collectd_plugins_syslog? ( virtual/logger )
195 - selinux? ( sec-policy/selinux-collectd )"
196 -
197 -REQUIRED_USE="
198 - collectd_plugins_python? ( ${PYTHON_REQUIRED_USE} )
199 - collectd_plugins_smart? ( udev )"
200 -
201 -PATCHES=(
202 - "${FILESDIR}"/${PN}-5.6.0-gentoo.patch
203 - "${FILESDIR}"/${PN}-5.6.0-issue-1896.patch
204 - "${FILESDIR}"/${PN}-5.6.0-fix-apache-plugin.patch
205 -)
206 -
207 -# @FUNCTION: collectd_plugin_kernel_linux
208 -# @DESCRIPTION:
209 -# USAGE: <plugin name> <kernel_options> <severity>
210 -# kernel_options is a list of kernel configurations options; the check tests whether at least
211 -# one of them is enabled. If no, depending on the third argument an elog, ewarn, or eerror message
212 -# is emitted.
213 -collectd_plugin_kernel_linux() {
214 - local multi_opt opt
215 - if has ${1} ${COLLECTD_ALL_PLUGINS}; then
216 - if use collectd_plugins_${1}; then
217 - for opt in ${2}; do
218 - if linux_chkconfig_present ${opt}; then
219 - return 0;
220 - fi
221 - done
222 - multi_opt=${2//\ /\ or\ }
223 - case ${3} in
224 - (info)
225 - elog "The ${1} plugin can use kernel features that are disabled now; enable ${multi_opt} in your kernel"
226 - ;;
227 - (warn)
228 - ewarn "The ${1} plugin uses kernel features that are disabled now; enable ${multi_opt} in your kernel"
229 - ;;
230 - (error)
231 - eerror "The ${1} plugin needs kernel features that are disabled now; enable ${multi_opt} in your kernel"
232 - ;;
233 - (*)
234 - die "function collectd_plugin_kernel_linux called with invalid third argument"
235 - ;;
236 - esac
237 - fi
238 - fi
239 -}
240 -
241 -collectd_linux_kernel_checks() {
242 - if ! linux_chkconfig_present PROC_FS; then
243 - 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"
244 - fi
245 -
246 - if ! linux_chkconfig_present SYSFS; then
247 - 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"
248 - fi
249 -
250 - # battery.c: /proc/pmu/battery_%i
251 - # battery.c: /proc/acpi/battery
252 - collectd_plugin_kernel_linux battery ACPI_BATTERY warn
253 -
254 - # cgroups.c: /sys/fs/cgroup/
255 - collectd_plugin_kernel_linux cgroups CGROUPS warn
256 -
257 - # cpufreq.c: /sys/devices/system/cpu/cpu%d/cpufreq/
258 - collectd_plugin_kernel_linux cpufreq SYSFS warn
259 - collectd_plugin_kernel_linux cpufreq CPU_FREQ_STAT warn
260 -
261 - # drbd.c: /proc/drbd
262 - collectd_plugin_kernel_linux drbd BLK_DEV_DRBD warn
263 -
264 - # conntrack.c: /proc/sys/net/netfilter/*
265 - collectd_plugin_kernel_linux conntrack NETFILTER warn
266 -
267 - # fscache.c: /proc/fs/fscache/stats
268 - collectd_plugin_kernel_linux fscache FSCACHE warn
269 -
270 - # nfs.c: /proc/net/rpc/nfs
271 - # nfs.c: /proc/net/rpc/nfsd
272 - collectd_plugin_kernel_linux nfs NFS_COMMON warn
273 -
274 - # serial.c: /proc/tty/driver/serial
275 - # serial.c: /proc/tty/driver/ttyS
276 - collectd_plugin_kernel_linux serial SERIAL_CORE warn
277 -
278 - # swap.c: /proc/meminfo
279 - collectd_plugin_kernel_linux swap SWAP warn
280 -
281 - # thermal.c: /proc/acpi/thermal_zone
282 - # thermal.c: /sys/class/thermal
283 - collectd_plugin_kernel_linux thermal ACPI_THERMAL warn
284 -
285 - # turbostat.c: /dev/cpu/%d/msr
286 - collectd_plugin_kernel_linux turbostat X86_MSR warn
287 -
288 - # vmem.c: /proc/vmstat
289 - collectd_plugin_kernel_linux vmem VM_EVENT_COUNTERS warn
290 -
291 - # vserver.c: /proc/virtual
292 - collectd_plugin_kernel_linux vserver VSERVER warn
293 -
294 - # uuid.c: /sys/hypervisor/uuid
295 - collectd_plugin_kernel_linux uuid SYSFS info
296 -
297 - # wireless.c: /proc/net/wireless
298 - collectd_plugin_kernel_linux wireless "WIRELESS MAC80211 IEEE80211" warn
299 -
300 - # zfs_arc.c: /proc/spl/kstat/zfs/arcstats
301 - collectd_plugin_kernel_linux zfs_arc "SPL ZFS" warn
302 -}
303 -
304 -pkg_setup() {
305 - if use kernel_linux; then
306 - linux-info_pkg_setup
307 -
308 - if linux_config_exists; then
309 - einfo "Checking your linux kernel configuration:"
310 - collectd_linux_kernel_checks
311 - else
312 - elog "Cannot find a linux kernel configuration. Continuing anyway."
313 - fi
314 - fi
315 -
316 - if use collectd_plugins_java; then
317 - java-pkg-opt-2_pkg_setup
318 - fi
319 -
320 - use collectd_plugins_python && python-single-r1_pkg_setup
321 -
322 - enewgroup collectd
323 - enewuser collectd -1 -1 /var/lib/collectd collectd
324 -}
325 -
326 -src_prepare() {
327 - default
328 -
329 - # There's some strange prefix handling in the default config file, resulting in
330 - # paths like "/usr/var/..."
331 - sed -i -e "s:@prefix@/var:/var:g" src/collectd.conf.in || die
332 -
333 - # fix installdirs for perl, bug 444360
334 - sed -i -e 's/INSTALL_BASE=$(DESTDIR)$(prefix) //' bindings/Makefile.am || die
335 -
336 - if use collectd_plugins_java; then
337 - # Set javac -source and -target flags according to (R)DEPEND.
338 - sed -i -e "s/\$(JAVAC)/\0 $(java-pkg_javac-args)/g" bindings/java/Makefile.am || die
339 - fi
340 -
341 - ebegin "Removing bundled libltdl"
342 - rm -rf libltdl || die
343 - eend 0
344 -
345 - eautoreconf
346 -}
347 -
348 -src_configure() {
349 - # Now come the lists of os-dependent plugins. Any plugin that is not listed anywhere here
350 - # should work independent of the operating system.
351 -
352 - local linux_plugins="barometer battery cpu cpufreq disk drbd entropy
353 - ethstat interface iptables ipvs irq ipc load memory md netlink nfs
354 - numa processes serial swap tcpconns thermal turbostat users vmem
355 - wireless zfc_arc"
356 -
357 - local need_libstatgrab=0
358 - local libstatgrab_plugins="cpu disk interface load memory swap users"
359 - local bsd_plugins="cpu tcpconns ${libstatgrab_plugins} zfc_arc"
360 -
361 - local darwin_plugins="apple_sensors battery cpu disk interface memory processes tcpconns"
362 -
363 - local osdependent_plugins="${linux_plugins} ${bsd_plugins} ${darwin_plugins}"
364 - local myos_plugins=""
365 - if use kernel_linux; then
366 - einfo "Enabling Linux plugins."
367 - myos_plugins=${linux_plugins}
368 - elif use kernel_FreeBSD; then
369 - einfo "Enabling FreeBSD plugins."
370 - myos_plugins=${bsd_plugins}
371 - elif use kernel_Darwin; then
372 - einfo "Enabling Darwin plugins."
373 - myos_plugins=${darwin_plugins}
374 - fi
375 -
376 - local myconf="--disable-werror"
377 -
378 - # Do we debug?
379 - myconf+=" $(use_enable debug)"
380 -
381 - # udev support?
382 - # Required for smart plugin via REQUIRED_USE; Optional for disk plugin
383 - if use udev; then
384 - myconf+=" --with-libudev"
385 - else
386 - myconf+=" --without-libudev"
387 - fi
388 -
389 - local plugin
390 -
391 - # Disable what needs to be disabled.
392 - for plugin in ${COLLECTD_DISABLED_PLUGINS}; do
393 - myconf+=" --disable-${plugin}"
394 - done
395 -
396 - # Set enable/disable for each single plugin.
397 - for plugin in ${COLLECTD_ALL_PLUGINS}; do
398 - if has ${plugin} ${osdependent_plugins}; then
399 - # plugin is os-dependent ...
400 - if has ${plugin} ${myos_plugins}; then
401 - # ... and available in this os
402 - myconf+=" $(use_enable collectd_plugins_${plugin} ${plugin})"
403 - # ... must we link against libstatgrab? Bug #541518
404 - if use kernel_FreeBSD && has ${plugin} ${libstatgrab_plugins}; then
405 - einfo "We must link against libstatgrab due to plugin \"${plugin}\" ..."
406 - need_libstatgrab=1
407 - fi
408 - else
409 - # ... and NOT available in this os
410 - if use collectd_plugins_${plugin}; then
411 - ewarn "You try to enable the ${plugin} plugin, but it is not available for this"
412 - ewarn "kernel. Disabling it automatically."
413 - fi
414 - myconf+=" --disable-${plugin}"
415 - fi
416 - elif [[ "${plugin}" = "collectd_plugins_perl" ]]; then
417 - if use collectd_plugins_perl && ! use perl; then
418 - ewarn "Perl plugin disabled as perl bindings disabled by -perl use flag"
419 - myconf+= --disable-perl
420 - else
421 - myconf+=" $(use_enable collectd_plugins_${plugin} ${plugin})"
422 - fi
423 - else
424 - myconf+=" $(use_enable collectd_plugins_${plugin} ${plugin})"
425 - fi
426 - done
427 -
428 - if [ "${need_libstatgrab}" -eq 1 ]; then
429 - myconf+=" --with-libstatgrab"
430 - else
431 - myconf+=" --without-libstatgrab"
432 - fi
433 -
434 - # JAVA_HOME is set by eclasses.
435 - if use collectd_plugins_java; then
436 - myconf+=" --with-java"
437 - fi
438 -
439 - # Need libiptc ONLY for iptables. If we try to use it otherwise bug 340109 happens.
440 - # lots of libs are only needed for plugins, if they are disabled, also disable the lib
441 - use collectd_plugins_iptables || myconf+=" --with-libiptc=no"
442 - use collectd_plugins_openldap || myconf+=" --with-libldap=no"
443 - use collectd_plugins_redis || use collectd_plugins_write_redis || myconf+=" --with-libhiredis=no"
444 - use collectd_plugins_smart || myconf+=" --with-libatasmart=no"
445 - use collectd_plugins_gps || myconf+=" --with-libgps=no"
446 -
447 - if use perl; then
448 - myconf+=" --with-perl-bindings=INSTALLDIRS=vendor"
449 - else
450 - myconf+=" --without-perl-bindings"
451 - fi
452 -
453 - # No need for v5upgrade
454 - myconf+=" --disable-target_v5upgrade"
455 -
456 - # Python
457 - if use collectd_plugins_python; then
458 - myconf+=" --with-libpython=yes"
459 - export PYTHON_CONFIG=$(python_get_PYTHON_CONFIG)
460 - else
461 - myconf+=" --with-libpython=no"
462 - fi
463 -
464 - # XFS support
465 - myconf+=" $(use_enable xfs)"
466 -
467 - # Finally, run econf.
468 - KERNEL_DIR="${KERNEL_DIR}" econf --config-cache \
469 - $(use_enable static-libs static) \
470 - --localstatedir=/var ${myconf}
471 -}
472 -
473 -src_install() {
474 - emake DESTDIR="${D%/}" install
475 -
476 - perl_delete_localpod
477 -
478 - find "${ED}"usr/ -name "*.la" -delete || die
479 -
480 - if use collectd_plugins_java; then
481 - java-pkg_regjar "${ED}"usr/share/${PN}/java/*.jar
482 - fi
483 -
484 - fowners root:collectd /etc/collectd.conf
485 - fperms u=rw,g=r,o= /etc/collectd.conf
486 -
487 - dodoc AUTHORS ChangeLog NEWS README TODO
488 -
489 - if use contrib ; then
490 - insinto /usr/share/doc/${PF}
491 - doins -r contrib
492 - fi
493 -
494 - keepdir /var/lib/${PN}
495 - fowners collectd:collectd /var/lib/${PN}
496 -
497 - newinitd "${FILESDIR}/${PN}.initd-r1" ${PN}
498 - newconfd "${FILESDIR}/${PN}.confd-r1" ${PN}
499 - systemd_newunit "contrib/systemd.${PN}.service" ${PN}.service
500 -
501 - insinto /etc/logrotate.d
502 - newins "${FILESDIR}/${PN}.logrotate" ${PN}
503 -
504 - sed -i -e 's:^.*PIDFile "/var/run/collectd.pid":PIDFile "/run/collectd/collectd.pid":' "${ED}"etc/collectd.conf || die
505 - sed -i -e 's:^# SocketFile "/var/run/collectd-unixsock":# SocketFile "/run/collectd/collectd.socket":' "${ED}"etc/collectd.conf || die
506 - 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
507 - 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
508 -}
509 -
510 -pkg_postinst() {
511 - local caps=()
512 - use collectd_plugins_ceph && caps+=('cap_dac_override')
513 - use collectd_plugins_exec && caps+=('cap_setuid' 'cap_setgid')
514 - use collectd_plugins_iptables && caps+=('cap_net_admin')
515 - use collectd_plugins_filecount && caps+=('cap_dac_read_search')
516 - use collectd_plugins_turbostat && caps+=('cap_sys_rawio')
517 -
518 - if use collectd_plugins_dns || use collectd_plugins_ping; then
519 - caps+=('cap_net_raw')
520 - fi
521 -
522 - if [ ${#caps[@]} -gt 0 ]; then
523 - local caps_str=$(IFS=","; echo "${caps[*]}")
524 - fcaps ${caps_str} usr/sbin/collectd
525 - elog "Capabilities for ${EROOT}usr/sbin/collectd set to:"
526 - elog " ${caps_str}+ep"
527 - elog
528 - fi
529 -
530 - elog "Note: Collectd is only the collector."
531 - elog " You need to install 'data' sources (applications) locally or"
532 - elog " remotely on your own."
533 -
534 - elog
535 - elog "Collectd is configured to run as unprivileged user by default."
536 - elog "You may want to revisit the configuration."
537 - elog
538 -
539 - if use collectd_plugins_email; then
540 - ewarn "The email plug-in is deprecated. To submit statistics please use the unixsock plugin."
541 - fi
542 -
543 - if use contrib; then
544 - elog "The scripts in /usr/share/doc/${PF}/collection3 for generating graphs need dev-perl/HTML-Parser,"
545 - elog "dev-perl/config-general, dev-perl/regexp-common, and net-analyzer/rrdtool[perl] to be installed."
546 - fi
547 -}
548
549 diff --git a/app-admin/collectd/collectd-5.6.1.ebuild b/app-admin/collectd/collectd-5.6.1-r1.ebuild
550 similarity index 92%
551 rename from app-admin/collectd/collectd-5.6.1.ebuild
552 rename to app-admin/collectd/collectd-5.6.1-r1.ebuild
553 index fc4601c..d4d794e 100644
554 --- a/app-admin/collectd/collectd-5.6.1.ebuild
555 +++ b/app-admin/collectd/collectd-5.6.1-r1.ebuild
556 @@ -152,6 +152,7 @@ REQUIRED_USE="
557
558 PATCHES=(
559 "${FILESDIR}"/${PN}-5.6.0-gentoo.patch
560 + "${FILESDIR}"/${PN}-5.6.0-use-_LINUX_CAPABILITY_VERSION_3.patch
561 )
562
563 # @FUNCTION: collectd_plugin_kernel_linux
564 @@ -283,6 +284,14 @@ src_prepare() {
565 # fix installdirs for perl, bug 444360
566 sed -i -e 's/INSTALL_BASE=$(DESTDIR)$(prefix) //' bindings/Makefile.am || die
567
568 + # Adjust upstream's systemd unit
569 + # - Get rid of EnvironmentFile directive; These files don't exist on Gentoo!
570 + # - Add User=collectd to run collectd as user "collectd" per default
571 + sed -i \
572 + -e '/^EnvironmentFile=.*/d' \
573 + -e '/^\[Service\]/aUser=collectd' \
574 + contrib/systemd.${PN}.service || die
575 +
576 if use collectd_plugins_java; then
577 # Set javac -source and -target flags according to (R)DEPEND.
578 sed -i -e "s/\$(JAVAC)/\0 $(java-pkg_javac-args)/g" bindings/java/Makefile.am || die
579 @@ -458,23 +467,36 @@ src_install() {
580 }
581
582 pkg_postinst() {
583 - local caps=()
584 - use collectd_plugins_ceph && caps+=('cap_dac_override')
585 - use collectd_plugins_exec && caps+=('cap_setuid' 'cap_setgid')
586 - use collectd_plugins_iptables && caps+=('cap_net_admin')
587 - use collectd_plugins_filecount && caps+=('cap_dac_read_search')
588 - use collectd_plugins_turbostat && caps+=('cap_sys_rawio')
589 -
590 - if use collectd_plugins_dns || use collectd_plugins_ping; then
591 - caps+=('cap_net_raw')
592 - fi
593 + if use filecaps; then
594 + local caps=()
595 + use collectd_plugins_ceph && caps+=('CAP_DAC_OVERRIDE')
596 + use collectd_plugins_exec && caps+=('CAP_SETUID' 'CAP_SETGID')
597 + use collectd_plugins_iptables && caps+=('CAP_NET_ADMIN')
598 + use collectd_plugins_filecount && caps+=('CAP_DAC_READ_SEARCH')
599 + use collectd_plugins_turbostat && caps+=('CAP_SYS_RAWIO')
600 +
601 + if use collectd_plugins_dns || use collectd_plugins_ping; then
602 + caps+=('CAP_NET_RAW')
603 + fi
604
605 - if [ ${#caps[@]} -gt 0 ]; then
606 - local caps_str=$(IFS=","; echo "${caps[*]}")
607 - fcaps ${caps_str} usr/sbin/collectd
608 - elog "Capabilities for ${EROOT}usr/sbin/collectd set to:"
609 - elog " ${caps_str}+ep"
610 - elog
611 + if [ ${#caps[@]} -gt 0 ]; then
612 + local caps_str=$(IFS=","; echo "${caps[*]}")
613 + fcaps ${caps_str} usr/sbin/collectd
614 + elog "Capabilities for ${EROOT}usr/sbin/collectd set to:"
615 + elog " ${caps_str}+EP"
616 + elog
617 +
618 + local systemd_unit="${EROOT}usr/lib/systemd/system/collectd.service"
619 + if [[ -e "${systemd_unit}" ]]; then
620 + caps_str="${caps[*]}"
621 + sed -i -e "s:^CapabilityBoundingSet=.*:CapabilityBoundingSet=${caps_str}:" "${systemd_unit}" || \
622 + die "Failed to set CapabilityBoundingSet in '${systemd_unit}'"
623 +
624 + elog "CapabilityBoundingSet in '${systemd_unit}'"
625 + elog "updated to match capabilities set above."
626 + elog
627 + fi
628 + fi
629 fi
630
631 elog "Note: Collectd is only the collector."
632
633 diff --git a/app-admin/collectd/files/collectd-5.6.0-fix-apache-plugin.patch b/app-admin/collectd/files/collectd-5.6.0-fix-apache-plugin.patch
634 deleted file mode 100644
635 index e3afaeb..00000000
636 --- a/app-admin/collectd/files/collectd-5.6.0-fix-apache-plugin.patch
637 +++ /dev/null
638 @@ -1,26 +0,0 @@
639 -From 60ec28dd104bdeef4c5ed6882fb2b663ca9da2eb Mon Sep 17 00:00:00 2001
640 -From: Florian Forster <octo@××××××××.org>
641 -Date: Sun, 11 Sep 2016 20:31:31 +0200
642 -Subject: [PATCH] apache plugin: End statements with semi-colons.
643 -MIME-Version: 1.0
644 -Content-Type: text/plain; charset=UTF-8
645 -Content-Transfer-Encoding: 8bit
646 -
647 -If only I knew why this wasn't considered a syntax error …
648 ----
649 - src/apache.c | 2 +-
650 - 1 file changed, 1 insertion(+), 1 deletion(-)
651 -
652 -diff --git a/src/apache.c b/src/apache.c
653 -index c515e3c..5b6914c 100644
654 ---- a/src/apache.c
655 -+++ b/src/apache.c
656 -@@ -250,7 +250,7 @@ static int config_add (oconfig_item_t *ci)
657 - ssnprintf (callback_name, sizeof (callback_name),
658 - "apache/%s/%s",
659 - (st->host != NULL) ? st->host : hostname_g,
660 -- (st->name != NULL) ? st->name : "default"),
661 -+ (st->name != NULL) ? st->name : "default");
662 -
663 - status = plugin_register_complex_read (/* group = */ NULL,
664 - /* name = */ callback_name,
665
666 diff --git a/app-admin/collectd/files/collectd-5.6.0-issue-1896.patch b/app-admin/collectd/files/collectd-5.6.0-issue-1896.patch
667 deleted file mode 100644
668 index afcd8d0..00000000
669 --- a/app-admin/collectd/files/collectd-5.6.0-issue-1896.patch
670 +++ /dev/null
671 @@ -1,76 +0,0 @@
672 -From ba52f94929822b1968f05cfbb37985af2e0b83a4 Mon Sep 17 00:00:00 2001
673 -From: Florian Forster <octo@××××××××.org>
674 -Date: Tue, 13 Sep 2016 10:44:46 +0200
675 -Subject: [PATCH] curl_json plugin: Skip unexpected non-map values.
676 -
677 -Assume, for example, the config `Key "*/foo"`. This config expects JSON
678 -in the form:
679 -
680 - {
681 - "bar": {
682 - "foo": 1337
683 - }
684 - }
685 -
686 -If the available JSON is instead:
687 -
688 - {
689 - "error_code": 0,
690 - "bar": {
691 - "foo": 1337
692 - }
693 - }
694 -
695 -the code will take a look at the zero associated with "error_code" and
696 -determine that a map (with key "foo") is expected instead. Previously
697 -the code would continue, eventually calling `cj_get_type()` which
698 -expects that `key->type` is a valid pointer, resulting in a segmentation
699 -fault.
700 -
701 -This patch does three things to ensure that this segmentation fault does
702 -not happen again:
703 -
704 -1. `cj_get_type()` checks its argument to make sure it is valid before
705 - dereferencing any pointers.
706 -2. In case a non-map is found when a map is expected, the code will
707 - return instead of limping on.
708 -3. After calling `cj_cb_inc_array_index()`, which may update the key,
709 - make sure that it actually did and that key is valid now.
710 -
711 -Fixes: #1896
712 ----
713 - src/curl_json.c | 10 ++++++++--
714 - 1 file changed, 8 insertions(+), 2 deletions(-)
715 -
716 -diff --git a/src/curl_json.c b/src/curl_json.c
717 -index 4188f37..a547ddc 100644
718 ---- a/src/curl_json.c
719 -+++ b/src/curl_json.c
720 -@@ -143,6 +143,9 @@ static int cj_get_type (cj_key_t *key)
721 - {
722 - const data_set_t *ds;
723 -
724 -+ if ((key == NULL) || !CJ_IS_KEY (key))
725 -+ return -EINVAL;
726 -+
727 - ds = plugin_get_ds (key->type);
728 - if (ds == NULL)
729 - {
730 -@@ -226,12 +229,15 @@ static int cj_cb_number (void *ctx,
731 - buffer[sizeof (buffer) - 1] = 0;
732 -
733 - if ((key == NULL) || !CJ_IS_KEY (key)) {
734 -- if (key != NULL && !db->state[db->depth].in_array/*can be inhomogeneous*/)
735 -+ if (key != NULL && !db->state[db->depth].in_array/*can be inhomogeneous*/) {
736 - NOTICE ("curl_json plugin: Found \"%s\", but the configuration expects"
737 - " a map.", buffer);
738 -+ return (CJ_CB_CONTINUE);
739 -+ }
740 -+
741 - cj_cb_inc_array_index (ctx, /* update_key = */ 1);
742 - key = db->state[db->depth].key;
743 -- if (key == NULL) {
744 -+ if ((key == NULL) || !CJ_IS_KEY (key)) {
745 - return (CJ_CB_CONTINUE);
746 - }
747 - }
748
749 diff --git a/app-admin/collectd/files/collectd-5.6.0-use-_LINUX_CAPABILITY_VERSION_3.patch b/app-admin/collectd/files/collectd-5.6.0-use-_LINUX_CAPABILITY_VERSION_3.patch
750 new file mode 100644
751 index 00000000..6c7e635
752 --- /dev/null
753 +++ b/app-admin/collectd/files/collectd-5.6.0-use-_LINUX_CAPABILITY_VERSION_3.patch
754 @@ -0,0 +1,37 @@
755 +From 5e4f2ae61dc39938c4df857854724ba1d36f3232 Mon Sep 17 00:00:00 2001
756 +From: Thomas Deutschmann <whissi@g.o>
757 +Date: Tue, 11 Oct 2016 16:16:23 +0200
758 +Subject: [PATCH] common.c: Use _LINUX_CAPABILITY_VERSION_3 in cap_header
759 +
760 +While check_capability() function already requires
761 +_LINUX_CAPABILITY_VERSION_3 via "#ifdef" since commit 448627953c we still
762 +set the cap_header's version to deprecated _LINUX_CAPABILITY_VERSION. This
763 +results in a warning like
764 +
765 + > capability: warning: `collectd' uses 32-bit capabilities (legacy support in use)
766 +
767 +from the kernel when a plugin (like iptables) calls our check_capability()
768 +function.
769 +
770 +With this commit we will set cap_header to kernel's current capability
771 +version (_LINUX_CAPABILITY_VERSION_3), which is default since
772 +kernel 2.6.26.
773 +
774 +Signed-off-by: Florian Forster <octo@××××××××.org>
775 +---
776 + src/daemon/common.c | 2 +-
777 + 1 file changed, 1 insertion(+), 1 deletion(-)
778 +
779 +diff --git a/src/daemon/common.c b/src/daemon/common.c
780 +index e489449..477d759 100644
781 +--- a/src/daemon/common.c
782 ++++ b/src/daemon/common.c
783 +@@ -1698,7 +1698,7 @@ int check_capability (int capability) /* {{{ */
784 + }
785 +
786 + cap_header->pid = getpid();
787 +- cap_header->version = _LINUX_CAPABILITY_VERSION;
788 ++ cap_header->version = _LINUX_CAPABILITY_VERSION_3;
789 + if (capget(cap_header, cap_data) < 0)
790 + {
791 + ERROR("check_capability: capget failed");