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/
Date: Fri, 07 Oct 2016 15:17:29
Message-Id: 1475853435.a888bf0135c2b6b318fbe3ac91bf3fff0a215b37.whissi@gentoo
1 commit: a888bf0135c2b6b318fbe3ac91bf3fff0a215b37
2 Author: Thomas Deutschmann <whissi <AT> gentoo <DOT> org>
3 AuthorDate: Fri Oct 7 15:16:55 2016 +0000
4 Commit: Thomas Deutschmann <whissi <AT> gentoo <DOT> org>
5 CommitDate: Fri Oct 7 15:17:15 2016 +0000
6 URL: https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=a888bf01
7
8 app-admin/collectd: Bump to v5.6.1
9
10 Package-Manager: portage-2.3.1
11
12 app-admin/collectd/Manifest | 1 +
13 app-admin/collectd/collectd-5.6.1.ebuild | 491 +++++++++++++++++++++++++++++++
14 2 files changed, 492 insertions(+)
15
16 diff --git a/app-admin/collectd/Manifest b/app-admin/collectd/Manifest
17 index 31a5a53..2485930 100644
18 --- a/app-admin/collectd/Manifest
19 +++ b/app-admin/collectd/Manifest
20 @@ -1,2 +1,3 @@
21 DIST collectd-5.5.2.tar.bz2 1800476 SHA256 017f3a4062187e594d8ab6af685655fb82a8a942dc574668e68242bdb8ba820f SHA512 9d311db4f3677b95e3a47c03af01bdf1127957f6fccb6c601455632d0ea3b39e3f4cd9a6f8f510083e208714bbb0da2e04aaa574a90b0ad6fe984506675475b3 WHIRLPOOL 98ed4fb29eec0ae660d3e1651380a3f17f7bf7f22e687633c4a44974bc84e49cf8de11fd6fea349bfe24809ac3c29a407459a1203b72bcf741e1587c6c0b1773
22 DIST collectd-5.6.0.tar.bz2 1818470 SHA256 f0ffbbd91fac3682bd324a74b9b4c9eabe781394b303b5cfd457c4cfbe748623 SHA512 5eecd7fe1619850b29e7853e0ab8f9eb7688d0fdf5687cf04930c75a94181c53d7dc0601a1dfa02417bdeb63cccf09b87acd7129e7f155b8d11147ec46982ed8 WHIRLPOOL 690e50f16318e9df39eac62010f8b0a57059356deeedd72505cc4a980876261a198edac095317f97b03913167dcfc49bf9f3b46986bbc3653628856e3a005111
23 +DIST collectd-5.6.1.tar.bz2 1903962 SHA256 c30ff644f91407b4dc2d99787b99cc45ec00e538bd1cc269429d3c5e8a4aee2c SHA512 da25f1a9cbaf47533f5a4d2f5f78b966317d4f21865c5a714954ad9d7d02b4798a3e0471ce52199dc80e01dc2808376cb10a7e19c402aafc984bf595f09951a6 WHIRLPOOL 68ed2b27bbd48f5af5e29743dcd2871ab4c2904d5593bbb6f3e68129f318389e32e13b256d489ea7842b90c406974511c8f324383253c7b438e7b6a9d36d299d
24
25 diff --git a/app-admin/collectd/collectd-5.6.1.ebuild b/app-admin/collectd/collectd-5.6.1.ebuild
26 new file mode 100644
27 index 00000000..29cb16f
28 --- /dev/null
29 +++ b/app-admin/collectd/collectd-5.6.1.ebuild
30 @@ -0,0 +1,491 @@
31 +# Copyright 1999-2016 Gentoo Foundation
32 +# Distributed under the terms of the GNU General Public License v2
33 +# $Id$
34 +
35 +EAPI="6"
36 +
37 +PYTHON_COMPAT=( python{2_7,3_4,3_5} )
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 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="GPL-2"
48 +SLOT="0"
49 +KEYWORDS="~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 +# grpc: Requires libgrpc
59 +# lpar: Requires libperfstat (AIX only)
60 +# mic: Requires Intel Many Integrated Core Architecture API
61 +# (part of Intel's Xeon Phi software)
62 +# netapp: Requires libnetapp (http://communities.netapp.com/docs/DOC-1110)
63 +# pf: Requires BSD packet filter
64 +# pinba: Requires MySQL Pinba engine (http://pinba.org/)
65 +# tape: Requires libkstat (Solaris only)
66 +# write_mongodb: https://github.com/collectd/collectd/issues/492
67 +# write_riemann: Requires riemann-c-client
68 +# xmms: Requires libxmms (v1)
69 +# zone: Solaris only...
70 +COLLECTD_IMPOSSIBLE_PLUGINS="apple_sensors aquaero barometer grpc lpar mic
71 + netapp pf pinba tape write_kafka write_mongodb write_riemann xmms
72 + zone"
73 +
74 +# Plugins that have been (compile) tested and can be enabled via COLLECTD_PLUGINS
75 +COLLECTD_TESTED_PLUGINS="aggregation amqp apache apcups ascent battery bind
76 + ceph cgroups chrony conntrack contextswitch cpu cpufreq cpusleep
77 + csv curl curl_json curl_xml dbi df disk dns drbd email entropy
78 + ethstat exec fhcount filecount fscache gmond gps hddtemp interface
79 + ipc ipmi iptables ipvs irq java lua load logfile log_logstash lvm
80 + madwifi match_empty_counter match_hashed match_regex match_timediff
81 + match_value mbmon md memcachec memcached memory modbus mqtt
82 + multimeter mysql netlink network network nfs nginx notify_desktop
83 + notify_email notify_nagios ntpd numa nut olsrd onewire openldap
84 + openvpn oracle perl ping postgresql powerdns processes protocols
85 + python python redis routeros rrdcached rrdtool sensors serial
86 + sigrok smart snmp statsd swap syslog table tail tail_csv
87 + target_notification target_replace target_scale target_set tcpconns
88 + teamspeak2 ted thermal threshold tokyotyrant turbostat unixsock
89 + uptime users uuid varnish virt vmem vserver wireless write_graphite
90 + write_http write_kafka write_log write_redis write_sensu write_tsdb
91 + xencpu zfs_arc zookeeper"
92 +
93 +COLLECTD_DISABLED_PLUGINS="${COLLECTD_IMPOSSIBLE_PLUGINS}"
94 +
95 +COLLECTD_ALL_PLUGINS=${COLLECTD_TESTED_PLUGINS}
96 +
97 +for plugin in ${COLLECTD_ALL_PLUGINS}; do
98 + IUSE="${IUSE} collectd_plugins_${plugin}"
99 +done
100 +unset plugin
101 +
102 +# Now come the dependencies.
103 +
104 +COMMON_DEPEND="
105 + dev-libs/libgcrypt:=
106 + dev-libs/libltdl:0=
107 + perl? ( dev-lang/perl:=[ithreads] )
108 + udev? ( virtual/udev )
109 + xfs? ( sys-fs/xfsprogs )
110 + collectd_plugins_amqp? ( net-libs/rabbitmq-c )
111 + collectd_plugins_apache? ( net-misc/curl:0= )
112 + collectd_plugins_ascent? ( net-misc/curl:0= dev-libs/libxml2:2= )
113 + collectd_plugins_bind? ( net-misc/curl:0= dev-libs/libxml2:2= )
114 + collectd_plugins_ceph? ( dev-libs/yajl:= )
115 + collectd_plugins_curl? ( net-misc/curl:0= )
116 + collectd_plugins_curl_json? ( net-misc/curl:0= dev-libs/yajl:= )
117 + collectd_plugins_curl_xml? ( net-misc/curl:0= dev-libs/libxml2:2= )
118 + collectd_plugins_dbi? ( dev-db/libdbi )
119 + collectd_plugins_dns? ( net-libs/libpcap )
120 + collectd_plugins_gmond? ( sys-cluster/ganglia )
121 + collectd_plugins_gps? ( sci-geosciences/gpsd )
122 + collectd_plugins_ipmi? ( >=sys-libs/openipmi-2.0.16-r1 )
123 + collectd_plugins_iptables? ( >=net-firewall/iptables-1.4.13:0= )
124 + collectd_plugins_log_logstash? ( dev-libs/yajl:= )
125 + collectd_plugins_lua? ( dev-lang/lua:0= )
126 + collectd_plugins_lvm? ( sys-fs/lvm2 )
127 + collectd_plugins_memcachec? ( dev-libs/libmemcached )
128 + collectd_plugins_modbus? ( dev-libs/libmodbus )
129 + collectd_plugins_mqtt? ( app-misc/mosquitto )
130 + collectd_plugins_mysql? ( >=virtual/mysql-5.0 )
131 + collectd_plugins_netlink? ( net-libs/libmnl )
132 + collectd_plugins_nginx? ( net-misc/curl:0= )
133 + collectd_plugins_notify_desktop? ( x11-libs/libnotify )
134 + collectd_plugins_notify_email? ( net-libs/libesmtp )
135 + collectd_plugins_nut? ( >=sys-power/nut-2.7.2-r2 )
136 + collectd_plugins_openldap? ( net-nds/openldap )
137 + collectd_plugins_onewire? ( >=sys-fs/owfs-3.1:= )
138 + collectd_plugins_oracle? ( dev-db/oracle-instantclient-basic )
139 + collectd_plugins_perl? ( dev-lang/perl:=[ithreads] )
140 + collectd_plugins_ping? ( net-libs/liboping )
141 + collectd_plugins_postgresql? ( dev-db/postgresql:= )
142 + collectd_plugins_python? ( ${PYTHON_DEPS} )
143 + collectd_plugins_redis? ( dev-libs/hiredis:= )
144 + collectd_plugins_routeros? ( net-libs/librouteros )
145 + collectd_plugins_rrdcached? ( net-analyzer/rrdtool:= )
146 + collectd_plugins_rrdtool? ( net-analyzer/rrdtool:= )
147 + collectd_plugins_sensors? ( sys-apps/lm_sensors )
148 + collectd_plugins_sigrok? ( <sci-libs/libsigrok-0.4 dev-libs/glib:2 )
149 + collectd_plugins_smart? ( dev-libs/libatasmart )
150 + collectd_plugins_snmp? ( net-analyzer/net-snmp )
151 + collectd_plugins_tokyotyrant? ( net-misc/tokyotyrant )
152 + collectd_plugins_varnish? ( www-servers/varnish )
153 + collectd_plugins_virt? ( app-emulation/libvirt:= dev-libs/libxml2:2= )
154 + collectd_plugins_write_http? ( net-misc/curl:0= dev-libs/yajl:= )
155 + collectd_plugins_write_kafka? ( >=dev-libs/librdkafka-0.9.0.99:= dev-libs/yajl:= )
156 + collectd_plugins_write_redis? ( dev-libs/hiredis:= )
157 + collectd_plugins_xencpu? ( app-emulation/xen-tools )
158 +
159 + kernel_FreeBSD? (
160 + collectd_plugins_disk? ( sys-libs/libstatgrab:= )
161 + collectd_plugins_interface? ( sys-libs/libstatgrab:= )
162 + collectd_plugins_load? ( sys-libs/libstatgrab:= )
163 + collectd_plugins_memory? ( sys-libs/libstatgrab:= )
164 + collectd_plugins_swap? ( sys-libs/libstatgrab:= )
165 + collectd_plugins_users? ( sys-libs/libstatgrab:= )
166 + )"
167 +
168 +# Enforcing <=sys-kernel/linux-headers-4.4 due to #577846
169 +DEPEND="${COMMON_DEPEND}
170 + collectd_plugins_iptables? ( <=sys-kernel/linux-headers-4.4 )
171 + collectd_plugins_java? ( >=virtual/jdk-1.6 )
172 + virtual/pkgconfig"
173 +
174 +RDEPEND="${COMMON_DEPEND}
175 + collectd_plugins_java? ( >=virtual/jre-1.6 )
176 + collectd_plugins_syslog? ( virtual/logger )
177 + selinux? ( sec-policy/selinux-collectd )"
178 +
179 +REQUIRED_USE="
180 + collectd_plugins_python? ( ${PYTHON_REQUIRED_USE} )
181 + collectd_plugins_smart? ( udev )"
182 +
183 +PATCHES=(
184 + "${FILESDIR}"/${PN}-5.6.0-gentoo.patch
185 +)
186 +
187 +# @FUNCTION: collectd_plugin_kernel_linux
188 +# @DESCRIPTION:
189 +# USAGE: <plugin name> <kernel_options> <severity>
190 +# kernel_options is a list of kernel configurations options; the check tests whether at least
191 +# one of them is enabled. If no, depending on the third argument an elog, ewarn, or eerror message
192 +# is emitted.
193 +collectd_plugin_kernel_linux() {
194 + local multi_opt opt
195 + if has ${1} ${COLLECTD_ALL_PLUGINS}; then
196 + if use collectd_plugins_${1}; then
197 + for opt in ${2}; do
198 + if linux_chkconfig_present ${opt}; then
199 + return 0;
200 + fi
201 + done
202 + multi_opt=${2//\ /\ or\ }
203 + case ${3} in
204 + (info)
205 + elog "The ${1} plugin can use kernel features that are disabled now; enable ${multi_opt} in your kernel"
206 + ;;
207 + (warn)
208 + ewarn "The ${1} plugin uses kernel features that are disabled now; enable ${multi_opt} in your kernel"
209 + ;;
210 + (error)
211 + eerror "The ${1} plugin needs kernel features that are disabled now; enable ${multi_opt} in your kernel"
212 + ;;
213 + (*)
214 + die "function collectd_plugin_kernel_linux called with invalid third argument"
215 + ;;
216 + esac
217 + fi
218 + fi
219 +}
220 +
221 +collectd_linux_kernel_checks() {
222 + if ! linux_chkconfig_present PROC_FS; then
223 + 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"
224 + fi
225 +
226 + if ! linux_chkconfig_present SYSFS; then
227 + 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"
228 + fi
229 +
230 + # battery.c: /proc/pmu/battery_%i
231 + # battery.c: /proc/acpi/battery
232 + collectd_plugin_kernel_linux battery ACPI_BATTERY warn
233 +
234 + # cgroups.c: /sys/fs/cgroup/
235 + collectd_plugin_kernel_linux cgroups CGROUPS warn
236 +
237 + # cpufreq.c: /sys/devices/system/cpu/cpu%d/cpufreq/
238 + collectd_plugin_kernel_linux cpufreq SYSFS warn
239 + collectd_plugin_kernel_linux cpufreq CPU_FREQ_STAT warn
240 +
241 + # drbd.c: /proc/drbd
242 + collectd_plugin_kernel_linux drbd BLK_DEV_DRBD warn
243 +
244 + # conntrack.c: /proc/sys/net/netfilter/*
245 + collectd_plugin_kernel_linux conntrack NETFILTER warn
246 +
247 + # fscache.c: /proc/fs/fscache/stats
248 + collectd_plugin_kernel_linux fscache FSCACHE warn
249 +
250 + # nfs.c: /proc/net/rpc/nfs
251 + # nfs.c: /proc/net/rpc/nfsd
252 + collectd_plugin_kernel_linux nfs NFS_COMMON warn
253 +
254 + # serial.c: /proc/tty/driver/serial
255 + # serial.c: /proc/tty/driver/ttyS
256 + collectd_plugin_kernel_linux serial SERIAL_CORE warn
257 +
258 + # swap.c: /proc/meminfo
259 + collectd_plugin_kernel_linux swap SWAP warn
260 +
261 + # thermal.c: /proc/acpi/thermal_zone
262 + # thermal.c: /sys/class/thermal
263 + collectd_plugin_kernel_linux thermal ACPI_THERMAL warn
264 +
265 + # turbostat.c: /dev/cpu/%d/msr
266 + collectd_plugin_kernel_linux turbostat X86_MSR warn
267 +
268 + # vmem.c: /proc/vmstat
269 + collectd_plugin_kernel_linux vmem VM_EVENT_COUNTERS warn
270 +
271 + # vserver.c: /proc/virtual
272 + collectd_plugin_kernel_linux vserver VSERVER warn
273 +
274 + # uuid.c: /sys/hypervisor/uuid
275 + collectd_plugin_kernel_linux uuid SYSFS info
276 +
277 + # wireless.c: /proc/net/wireless
278 + collectd_plugin_kernel_linux wireless "WIRELESS MAC80211 IEEE80211" warn
279 +
280 + # zfs_arc.c: /proc/spl/kstat/zfs/arcstats
281 + collectd_plugin_kernel_linux zfs_arc "SPL ZFS" warn
282 +}
283 +
284 +pkg_setup() {
285 + if use kernel_linux; then
286 + linux-info_pkg_setup
287 +
288 + if linux_config_exists; then
289 + einfo "Checking your linux kernel configuration:"
290 + collectd_linux_kernel_checks
291 + else
292 + elog "Cannot find a linux kernel configuration. Continuing anyway."
293 + fi
294 + fi
295 +
296 + if use collectd_plugins_java; then
297 + java-pkg-opt-2_pkg_setup
298 + fi
299 +
300 + use collectd_plugins_python && python-single-r1_pkg_setup
301 +
302 + enewgroup collectd
303 + enewuser collectd -1 -1 /var/lib/collectd collectd
304 +}
305 +
306 +src_prepare() {
307 + default
308 +
309 + # There's some strange prefix handling in the default config file, resulting in
310 + # paths like "/usr/var/..."
311 + sed -i -e "s:@prefix@/var:/var:g" src/collectd.conf.in || die
312 +
313 + # fix installdirs for perl, bug 444360
314 + sed -i -e 's/INSTALL_BASE=$(DESTDIR)$(prefix) //' bindings/Makefile.am || die
315 +
316 + if use collectd_plugins_java; then
317 + # Set javac -source and -target flags according to (R)DEPEND.
318 + sed -i -e "s/\$(JAVAC)/\0 $(java-pkg_javac-args)/g" bindings/java/Makefile.am || die
319 + fi
320 +
321 + ebegin "Removing bundled libltdl"
322 + rm -rf libltdl || die
323 + eend 0
324 +
325 + eautoreconf
326 +}
327 +
328 +src_configure() {
329 + # Now come the lists of os-dependent plugins. Any plugin that is not listed anywhere here
330 + # should work independent of the operating system.
331 +
332 + local linux_plugins="barometer battery cpu cpufreq disk drbd entropy
333 + ethstat interface iptables ipvs irq ipc load memory md netlink nfs
334 + numa processes serial swap tcpconns thermal turbostat users vmem
335 + wireless zfc_arc"
336 +
337 + local need_libstatgrab=0
338 + local libstatgrab_plugins="cpu disk interface load memory swap users"
339 + local bsd_plugins="cpu tcpconns ${libstatgrab_plugins} zfc_arc"
340 +
341 + local darwin_plugins="apple_sensors battery cpu disk interface memory processes tcpconns"
342 +
343 + local osdependent_plugins="${linux_plugins} ${bsd_plugins} ${darwin_plugins}"
344 + local myos_plugins=""
345 + if use kernel_linux; then
346 + einfo "Enabling Linux plugins."
347 + myos_plugins=${linux_plugins}
348 + elif use kernel_FreeBSD; then
349 + einfo "Enabling FreeBSD plugins."
350 + myos_plugins=${bsd_plugins}
351 + elif use kernel_Darwin; then
352 + einfo "Enabling Darwin plugins."
353 + myos_plugins=${darwin_plugins}
354 + fi
355 +
356 + local myconf="--disable-werror"
357 +
358 + # Do we debug?
359 + myconf+=" $(use_enable debug)"
360 +
361 + # udev support?
362 + # Required for smart plugin via REQUIRED_USE; Optional for disk plugin
363 + if use udev; then
364 + myconf+=" --with-libudev"
365 + else
366 + myconf+=" --without-libudev"
367 + fi
368 +
369 + local plugin
370 +
371 + # Disable what needs to be disabled.
372 + for plugin in ${COLLECTD_DISABLED_PLUGINS}; do
373 + myconf+=" --disable-${plugin}"
374 + done
375 +
376 + # Set enable/disable for each single plugin.
377 + for plugin in ${COLLECTD_ALL_PLUGINS}; do
378 + if has ${plugin} ${osdependent_plugins}; then
379 + # plugin is os-dependent ...
380 + if has ${plugin} ${myos_plugins}; then
381 + # ... and available in this os
382 + myconf+=" $(use_enable collectd_plugins_${plugin} ${plugin})"
383 + # ... must we link against libstatgrab? Bug #541518
384 + if use kernel_FreeBSD && has ${plugin} ${libstatgrab_plugins}; then
385 + einfo "We must link against libstatgrab due to plugin \"${plugin}\" ..."
386 + need_libstatgrab=1
387 + fi
388 + else
389 + # ... and NOT available in this os
390 + if use collectd_plugins_${plugin}; then
391 + ewarn "You try to enable the ${plugin} plugin, but it is not available for this"
392 + ewarn "kernel. Disabling it automatically."
393 + fi
394 + myconf+=" --disable-${plugin}"
395 + fi
396 + elif [[ "${plugin}" = "collectd_plugins_perl" ]]; then
397 + if use collectd_plugins_perl && ! use perl; then
398 + ewarn "Perl plugin disabled as perl bindings disabled by -perl use flag"
399 + myconf+= --disable-perl
400 + else
401 + myconf+=" $(use_enable collectd_plugins_${plugin} ${plugin})"
402 + fi
403 + else
404 + myconf+=" $(use_enable collectd_plugins_${plugin} ${plugin})"
405 + fi
406 + done
407 +
408 + if [ "${need_libstatgrab}" -eq 1 ]; then
409 + myconf+=" --with-libstatgrab"
410 + else
411 + myconf+=" --without-libstatgrab"
412 + fi
413 +
414 + # JAVA_HOME is set by eclasses.
415 + if use collectd_plugins_java; then
416 + myconf+=" --with-java"
417 + fi
418 +
419 + # Need libiptc ONLY for iptables. If we try to use it otherwise bug 340109 happens.
420 + # lots of libs are only needed for plugins, if they are disabled, also disable the lib
421 + use collectd_plugins_iptables || myconf+=" --with-libiptc=no"
422 + use collectd_plugins_openldap || myconf+=" --with-libldap=no"
423 + use collectd_plugins_redis || use collectd_plugins_write_redis || myconf+=" --with-libhiredis=no"
424 + use collectd_plugins_smart || myconf+=" --with-libatasmart=no"
425 + use collectd_plugins_gps || myconf+=" --with-libgps=no"
426 +
427 + if use perl; then
428 + myconf+=" --with-perl-bindings=INSTALLDIRS=vendor"
429 + else
430 + myconf+=" --without-perl-bindings"
431 + fi
432 +
433 + # No need for v5upgrade
434 + myconf+=" --disable-target_v5upgrade"
435 +
436 + # Python
437 + if use collectd_plugins_python; then
438 + myconf+=" --with-libpython=yes"
439 + export PYTHON_CONFIG=$(python_get_PYTHON_CONFIG)
440 + else
441 + myconf+=" --with-libpython=no"
442 + fi
443 +
444 + # XFS support
445 + myconf+=" $(use_enable xfs)"
446 +
447 + # Finally, run econf.
448 + KERNEL_DIR="${KERNEL_DIR}" econf --config-cache \
449 + $(use_enable static-libs static) \
450 + --localstatedir=/var ${myconf}
451 +}
452 +
453 +src_install() {
454 + emake DESTDIR="${D%/}" install
455 +
456 + perl_delete_localpod
457 +
458 + find "${ED}"usr/ -name "*.la" -delete || die
459 +
460 + if use collectd_plugins_java; then
461 + java-pkg_regjar "${ED}"usr/share/${PN}/java/*.jar
462 + fi
463 +
464 + fowners root:collectd /etc/collectd.conf
465 + fperms u=rw,g=r,o= /etc/collectd.conf
466 +
467 + dodoc AUTHORS ChangeLog NEWS README TODO
468 +
469 + if use contrib ; then
470 + insinto /usr/share/doc/${PF}
471 + doins -r contrib
472 + fi
473 +
474 + keepdir /var/lib/${PN}
475 + fowners collectd:collectd /var/lib/${PN}
476 +
477 + newinitd "${FILESDIR}/${PN}.initd-r1" ${PN}
478 + newconfd "${FILESDIR}/${PN}.confd-r1" ${PN}
479 + systemd_newunit "contrib/systemd.${PN}.service" ${PN}.service
480 +
481 + insinto /etc/logrotate.d
482 + newins "${FILESDIR}/${PN}.logrotate" ${PN}
483 +
484 + sed -i -e 's:^.*PIDFile "/var/run/collectd.pid":PIDFile "/run/collectd/collectd.pid":' "${ED}"etc/collectd.conf || die
485 + sed -i -e 's:^# SocketFile "/var/run/collectd-unixsock":# SocketFile "/run/collectd/collectd.socket":' "${ED}"etc/collectd.conf || die
486 + 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
487 + 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
488 +}
489 +
490 +pkg_postinst() {
491 + local caps=()
492 + use collectd_plugins_ping && caps+=('cap_net_raw')
493 + use collectd_plugins_iptables && caps+=('cap_net_admin')
494 + use collectd_plugins_filecount && caps+=('cap_dac_read_search')
495 +
496 + if [ ${#caps[@]} -gt 0 ]; then
497 + local caps_str=$(IFS=","; echo "${caps[*]}")
498 + fcaps ${caps_str} usr/sbin/collectd
499 + elog "Capabilities for ${EROOT}usr/sbin/collectd set to:"
500 + elog " ${caps_str}+ep"
501 + elog
502 + fi
503 +
504 + elog "Note: Collectd is only the collector."
505 + elog " You need to install 'data' sources (applications) locally or"
506 + elog " remotely on your own."
507 +
508 + elog
509 + elog "Collectd is configured to run as unprivileged user by default."
510 + elog "You may want to revisit the configuration."
511 + elog
512 +
513 + if use collectd_plugins_email; then
514 + ewarn "The email plug-in is deprecated. To submit statistics please use the unixsock plugin."
515 + fi
516 +
517 + if use contrib; then
518 + elog "The scripts in /usr/share/doc/${PF}/collection3 for generating graphs need dev-perl/HTML-Parser,"
519 + elog "dev-perl/config-general, dev-perl/regexp-common, and net-analyzer/rrdtool[perl] to be installed."
520 + fi
521 +}