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