Gentoo Archives: gentoo-commits

From: "Markos Chandras (hwoarang)" <hwoarang@g.o>
To: gentoo-commits@l.g.o
Subject: [gentoo-commits] gentoo-x86 commit in app-admin/collectd: ChangeLog collectd-5.1.0-r2.ebuild
Date: Tue, 30 Oct 2012 19:34:05
Message-Id: 20121030193313.695CF21601@flycatcher.gentoo.org
1 hwoarang 12/10/30 19:33:13
2
3 Modified: ChangeLog
4 Added: collectd-5.1.0-r2.ebuild
5 Log:
6 Revbump for #436538 and #437680. Thanks to Johan Bergström <bugs@××××××××××.nu>
7
8 (Portage version: 2.1.11.30/cvs/Linux x86_64, signed Manifest commit with key B4AFF2C2)
9
10 Revision Changes Path
11 1.43 app-admin/collectd/ChangeLog
12
13 file : http://sources.gentoo.org/viewvc.cgi/gentoo-x86/app-admin/collectd/ChangeLog?rev=1.43&view=markup
14 plain: http://sources.gentoo.org/viewvc.cgi/gentoo-x86/app-admin/collectd/ChangeLog?rev=1.43&content-type=text/plain
15 diff : http://sources.gentoo.org/viewvc.cgi/gentoo-x86/app-admin/collectd/ChangeLog?r1=1.42&r2=1.43
16
17 Index: ChangeLog
18 ===================================================================
19 RCS file: /var/cvsroot/gentoo-x86/app-admin/collectd/ChangeLog,v
20 retrieving revision 1.42
21 retrieving revision 1.43
22 diff -u -r1.42 -r1.43
23 --- ChangeLog 16 Sep 2012 11:10:05 -0000 1.42
24 +++ ChangeLog 30 Oct 2012 19:33:13 -0000 1.43
25 @@ -1,6 +1,14 @@
26 # ChangeLog for app-admin/collectd
27 # Copyright 1999-2012 Gentoo Foundation; Distributed under the GPL v2
28 -# $Header: /var/cvsroot/gentoo-x86/app-admin/collectd/ChangeLog,v 1.42 2012/09/16 11:10:05 pacho Exp $
29 +# $Header: /var/cvsroot/gentoo-x86/app-admin/collectd/ChangeLog,v 1.43 2012/10/30 19:33:13 hwoarang Exp $
30 +
31 +*collectd-5.1.0-r2 (30 Oct 2012)
32 +
33 + 30 Oct 2012; Markos Chandras <hwoarang@g.o> +collectd-5.1.0-r2.ebuild,
34 + +files/collectd-5.1.0-libperl.patch, +files/collectd-5.1.0-mongoc06.patch,
35 + +files/collectd-5.10.1-libperl.patch:
36 + Revbump for #436538 and #437680. Thanks to Johan Bergström
37 + <bugs@××××××××××.nu>
38
39 16 Sep 2012; Pacho Ramos <pacho@g.o> -collectd-5.1.0.ebuild,
40 metadata.xml:
41
42
43
44 1.1 app-admin/collectd/collectd-5.1.0-r2.ebuild
45
46 file : http://sources.gentoo.org/viewvc.cgi/gentoo-x86/app-admin/collectd/collectd-5.1.0-r2.ebuild?rev=1.1&view=markup
47 plain: http://sources.gentoo.org/viewvc.cgi/gentoo-x86/app-admin/collectd/collectd-5.1.0-r2.ebuild?rev=1.1&content-type=text/plain
48
49 Index: collectd-5.1.0-r2.ebuild
50 ===================================================================
51 # Copyright 1999-2012 Gentoo Foundation
52 # Distributed under the terms of the GNU General Public License v2
53 # $Header: /var/cvsroot/gentoo-x86/app-admin/collectd/collectd-5.1.0-r2.ebuild,v 1.1 2012/10/30 19:33:13 hwoarang Exp $
54
55 EAPI=4
56
57 inherit eutils base linux-info perl-app autotools multilib user
58
59 DESCRIPTION="A small daemon which collects system performance statistics - with a near-infinite number of plugins"
60 HOMEPAGE="http://collectd.org"
61 SRC_URI="${HOMEPAGE}/files/${P}.tar.bz2"
62
63 LICENSE="GPL-2"
64 SLOT="0"
65 KEYWORDS="~amd64 ~x86"
66 IUSE="contrib debug kernel_linux kernel_FreeBSD kernel_Darwin perl static-libs"
67
68 # The plugin lists have to follow here since they extend IUSE
69
70 # Plugins that to my knowledge cannot be supported (eg. dependencies not in gentoo)
71 COLLECTD_IMPOSSIBLE_PLUGINS="netapp pinba xmms"
72
73 # Plugins that still need some work
74 COLLECTD_UNTESTED_PLUGINS="ipvs apple_sensors tape zfs_arc modbus amqp genericjmx lpar redis threshold write_redis v5upgrade"
75
76 # Plugins that have been (compile) tested and can be enabled via COLLECTD_PLUGINS
77 COLLECTD_TESTED_PLUGINS="apache apcups ascent battery bind conntrack contextswitch
78 cpu cpufreq curl curl_json curl_xml dbi df disk dns email entropy ethstat exec filecount fscache gmond
79 hddtemp interface ipmi iptables irq java libvirt load madwifi mbmon md memcachec
80 memcached memory multimeter mysql netlink network nfs nginx ntpd numa nut olsrd
81 onewire openvpn perl ping postgresql powerdns processes protocols python
82 rrdcached sensors serial snmp swap table tail tcpconns teamspeak2 ted thermal
83 tokyotyrant uptime users varnish vmem vserver wireless csv exec logfile network
84 notify_desktop notify_email oracle perl python routeros rrdcached rrdtool syslog unixsock
85 write_graphite write_http write_mongodb match_empty_counter match_hashed match_regex match_timediff
86 match_value target_notification target_replace target_scale target_set uuid"
87
88 COLLECTD_DISABLED_PLUGINS="${COLLECTD_IMPOSSIBLE_PLUGINS} ${COLLECTD_UNTESTED_PLUGINS}"
89
90 COLLECTD_ALL_PLUGINS=${COLLECTD_TESTED_PLUGINS}
91
92 for plugin in ${COLLECTD_ALL_PLUGINS}; do
93 IUSE="${IUSE} collectd_plugins_${plugin}"
94 done
95 unset plugin
96
97 # Now come the dependencies.
98
99 COMMON_DEPEND="
100 dev-libs/libgcrypt
101 sys-devel/libtool
102 perl? ( dev-lang/perl[ithreads] ( || ( sys-devel/libperl[ithreads] >=sys-devel/libperl-5.10 ) ) )
103 collectd_plugins_apache? ( net-misc/curl )
104 collectd_plugins_ascent? ( net-misc/curl dev-libs/libxml2 )
105 collectd_plugins_bind? ( dev-libs/libxml2 )
106 collectd_plugins_curl? ( net-misc/curl )
107 collectd_plugins_curl_json? ( net-misc/curl dev-libs/yajl )
108 collectd_plugins_curl_xml? ( net-misc/curl dev-libs/libxml2 )
109 collectd_plugins_dbi? ( dev-db/libdbi )
110 collectd_plugins_dns? ( net-libs/libpcap )
111 collectd_plugins_gmond? ( sys-cluster/ganglia )
112 collectd_plugins_ipmi? ( >=sys-libs/openipmi-2.0.16-r1 )
113 collectd_plugins_iptables? ( >=net-firewall/iptables-1.4.13 )
114 collectd_plugins_java? ( virtual/jre dev-java/java-config-wrapper )
115 collectd_plugins_libvirt? ( app-emulation/libvirt dev-libs/libxml2 )
116 collectd_plugins_memcachec? ( dev-libs/libmemcached )
117 collectd_plugins_mysql? ( >=virtual/mysql-5.0 )
118 collectd_plugins_netlink? ( >=sys-apps/iproute2-3.3.0 )
119 collectd_plugins_nginx? ( net-misc/curl )
120 collectd_plugins_notify_desktop? ( x11-libs/libnotify )
121 collectd_plugins_notify_email? ( >=net-libs/libesmtp-1.0.4 dev-libs/openssl )
122 collectd_plugins_nut? ( sys-power/nut )
123 collectd_plugins_onewire? ( sys-fs/owfs )
124 collectd_plugins_oracle? ( >=dev-db/oracle-instantclient-basic-11.2.0.1.0 )
125 collectd_plugins_perl? ( dev-lang/perl[ithreads] ( || ( sys-devel/libperl[ithreads] >=sys-devel/libperl-5.10 ) ) )
126 collectd_plugins_ping? ( net-libs/liboping )
127 collectd_plugins_postgresql? ( >=dev-db/postgresql-base-8.2 )
128 collectd_plugins_python? ( =dev-lang/python-2* )
129 collectd_plugins_routeros? ( net-libs/librouteros )
130 collectd_plugins_rrdcached? ( >=net-analyzer/rrdtool-1.4 )
131 collectd_plugins_rrdtool? ( >=net-analyzer/rrdtool-1.2.27 )
132 collectd_plugins_sensors? ( sys-apps/lm_sensors )
133 collectd_plugins_snmp? ( net-analyzer/net-snmp )
134 collectd_plugins_tokyotyrant? ( net-misc/tokyotyrant )
135 collectd_plugins_varnish? ( www-servers/varnish )
136 collectd_plugins_write_http? ( net-misc/curl )
137 collectd_plugins_write_mongodb? ( dev-libs/mongo-c-driver )
138
139 kernel_FreeBSD? (
140 collectd_plugins_disk? ( >=sys-libs/libstatgrab-0.16 )
141 collectd_plugins_interface? ( >=sys-libs/libstatgrab-0.16 )
142 collectd_plugins_load? ( >=sys-libs/libstatgrab-0.16 )
143 collectd_plugins_memory? ( >=sys-libs/libstatgrab-0.16 )
144 collectd_plugins_swap? ( >=sys-libs/libstatgrab-0.16 )
145 collectd_plugins_users? ( >=sys-libs/libstatgrab-0.16 )
146 )"
147
148 DEPEND="${COMMON_DEPEND}
149 virtual/pkgconfig
150 kernel_linux? (
151 collectd_plugins_vserver? ( sys-kernel/vserver-sources )
152 )"
153
154 RDEPEND="${COMMON_DEPEND}
155 collectd_plugins_syslog? ( virtual/logger )"
156
157 PATCHES=(
158 "${FILESDIR}/${PN}-5.1.0"-libperl.patch
159 "${FILESDIR}/${PN}-4.10.2"-{libocci,nohal}.patch
160 "${FILESDIR}/${PN}-4.10.3"-{lt,werror}.patch
161 "${FILESDIR}/${PN}-5.1.0"-netlink.patch
162 "${FILESDIR}/${PN}-5.1.0"-mongoc06.patch
163 )
164
165 # @FUNCTION: collectd_plugin_kernel_linux
166 # @DESCRIPTION:
167 # USAGE: <plug-in name> <kernel_options> <severity>
168 # kernel_options is a list of kernel configurations options; the check tests whether at least
169 # one of them is enabled. If no, depending on the third argument an elog, ewarn, or eerror message
170 # is emitted.
171 collectd_plugin_kernel_linux() {
172 local multi_opt opt
173 if has ${1} ${COLLECTD_ALL_PLUGINS}; then
174 if use collectd_plugins_${1}; then
175 for opt in ${2}; do
176 if linux_chkconfig_present ${opt}; then return 0; fi
177 done
178 multi_opt=${2//\ /\ or\ }
179 case ${3} in
180 (info)
181 elog "The ${1} plug-in can use kernel features that are disabled now; enable ${multi_opt} in your kernel"
182 ;;
183 (warn)
184 ewarn "The ${1} plug-in uses kernel features that are disabled now; enable ${multi_opt} in your kernel"
185 ;;
186 (error)
187 eerror "The ${1} plug-in needs kernel features that are disabled now; enable ${multi_opt} in your kernel"
188 ;;
189 (*)
190 die "function collectd_plugin_kernel_linux called with invalid third argument"
191 ;;
192 esac
193 fi
194 fi
195 }
196
197 collectd_linux_kernel_checks() {
198 linux-info_pkg_setup
199
200 # battery.c:/proc/pmu/battery_%i
201 # battery.c:/proc/acpi/battery
202 collectd_plugin_kernel_linux battery ACPI_BATTERY warn
203
204 # cpufreq.c:/sys/devices/system/cpu/cpu%d/cpufreq/
205 collectd_plugin_kernel_linux cpufreq SYSFS warn
206 collectd_plugin_kernel_linux cpufreq CPU_FREQ_STAT warn
207
208 # nfs.c:/proc/net/rpc/nfs
209 # nfs.c:/proc/net/rpc/nfsd
210 collectd_plugin_kernel_linux nfs NFS_COMMON warn
211
212 # serial.c:/proc/tty/driver/serial
213 # serial.c:/proc/tty/driver/ttyS
214 collectd_plugin_kernel_linux serial SERIAL_CORE warn
215
216 # swap.c:/proc/meminfo
217 collectd_plugin_kernel_linux swap SWAP warn
218
219 # thermal.c:/proc/acpi/thermal_zone
220 # thermal.c:/sys/class/thermal
221 collectd_plugin_kernel_linux thermal "PROC_FS SYSFS" warn
222 collectd_plugin_kernel_linux thermal ACPI_THERMAL warn
223
224 # vmem.c:/proc/vmstat
225 collectd_plugin_kernel_linux vmem VM_EVENT_COUNTERS warn
226
227 # uuid.c:/sys/hypervisor/uuid
228 collectd_plugin_kernel_linux uuid SYSFS info
229
230 # wireless.c:/proc/net/wireless
231 collectd_plugin_kernel_linux wireless "MAC80211 IEEE80211" warn
232 }
233
234 pkg_setup() {
235 if use kernel_linux; then
236 if linux_config_exists; then
237 einfo "Checking your linux kernel configuration:"
238 collectd_linux_kernel_checks
239 else
240 elog "Cannot find a linux kernel configuration. Continuing anyway."
241 fi
242 fi
243
244 enewgroup collectd
245 enewuser collectd -1 -1 /var/lib/collectd collectd
246 }
247
248 src_prepare() {
249 base_src_prepare
250
251 # There's some strange prefix handling in the default config file, resulting in
252 # paths like "/usr/var/..."
253 sed -i -e "s:@prefix@/var:/var:g" src/collectd.conf.in || die
254
255 rm -r libltdl || die
256
257 eautoreconf
258 }
259
260 src_configure() {
261 # Now come the lists of os-dependent plugins. Any plugin that is not listed anywhere here
262 # should work independent of the operating system.
263
264 local linux_plugins="battery cpu cpufreq disk entropy ethstat interface iptables ipvs irq load
265 memory md netlink nfs numa processes serial swap tcpconns thermal users vmem vserver
266 wireless"
267
268 local libstatgrab_plugins="cpu disk interface load memory swap users"
269 local bsd_plugins="cpu tcpconns ${libstatgrab_plugins}"
270
271 local darwin_plugins="apple_sensors battery cpu disk interface memory processes tcpconns"
272
273 local osdependent_plugins="${linux_plugins} ${bsd_plugins} ${darwin_plugins}"
274 local myos_plugins=""
275 if use kernel_linux; then
276 einfo "Enabling Linux plugins."
277 myos_plugins=${linux_plugins}
278 elif use kernel_FreeBSD; then
279 einfo "Enabling FreeBSD plugins."
280 myos_plugins=${bsd_plugins}
281 elif use kernel_Darwin; then
282 einfo "Enabling Darwin plugins."
283 myos_plugins=${darwin_plugins}
284 fi
285
286 # Do we debug?
287 local myconf="$(use_enable debug)"
288
289 local plugin
290
291 # Disable what needs to be disabled.
292 for plugin in ${COLLECTD_DISABLED_PLUGINS}; do
293 myconf+=" --disable-${plugin}"
294 done
295
296 # Set enable/disable for each single plugin.
297 for plugin in ${COLLECTD_ALL_PLUGINS}; do
298 if has ${plugin} ${osdependent_plugins}; then
299 # plugin is os-dependent ...
300 if has ${plugin} ${myos_plugins}; then
301 # ... and available in this os
302 myconf+=" $(use_enable collectd_plugins_${plugin} ${plugin})"
303 else
304 # ... and NOT available in this os
305 if use collectd_plugins_${plugin}; then
306 ewarn "You try to enable the ${plugin} plugin, but it is not available for this"
307 ewarn "kernel. Disabling it automatically."
308 fi
309 myconf+=" --disable-${plugin}"
310 fi
311 elif [[ "${plugin}" = "collectd_plugins_perl" ]]; then
312 if use collectd_plugins_perl && ! use perl; then
313 ewarn "Perl plugin disabled as perl bindings disabled by -perl use flag"
314 myconf+= --disable-perl
315 else
316 myconf+=" $(use_enable collectd_plugins_${plugin} ${plugin})"
317 fi
318 else
319 myconf+=" $(use_enable collectd_plugins_${plugin} ${plugin})"
320 fi
321 done
322
323 # Need JAVA_HOME for java.
324 if use collectd_plugins_java; then
325 myconf+=" --with-java=$(java-config -g JAVA_HOME)"
326 fi
327
328 # Need libiptc ONLY for iptables. If we try to use it otherwise bug 340109 happens.
329 if ! use collectd_plugins_iptables; then
330 myconf+=" --with-libiptc=no"
331 fi
332
333 # The perl bindings
334 myconf+=" $(use_with perl perl-bindings)"
335
336 # Finally, run econf.
337 KERNEL_DIR="${KERNEL_DIR}" econf --config-cache --without-included-ltdl $(use_enable static-libs static) --localstatedir=/var ${myconf}
338 }
339
340 src_install() {
341 emake DESTDIR="${D}" install || die
342
343 fixlocalpod
344
345 find "${D}/usr/" -name "*.la" -exec rm -f {} +
346 rm "${D}/usr/$(get_libdir)"/collectd/*.a
347
348 # use collectd_plugins_ping && setcap cap_net_raw+ep ${D}/usr/sbin/collectd
349 # we cannot do this yet
350
351 fowners root:collectd /etc/collectd.conf
352 fperms u=rw,g=r,o= /etc/collectd.conf
353
354 dodoc AUTHORS ChangeLog NEWS README TODO
355
356 if use contrib ; then
357 insinto /usr/share/doc/${PF}
358 doins -r contrib
359 fi
360
361 keepdir /var/lib/${PN}
362 fowners collectd:collectd /var/lib/${PN}
363
364 newinitd "${FILESDIR}/${PN}.initd" ${PN}
365 newconfd "${FILESDIR}/${PN}.confd" ${PN}
366
367 insinto /etc/logrotate.d
368 newins "${FILESDIR}/logrotate" collectd
369
370 sed -i -e 's:^.*PIDFile "/var/run/collectd.pid":PIDFile "/var/run/collectd/collectd.pid":' "${D}"/etc/collectd.conf || die
371 sed -i -e 's:^# SocketFile "/var/run/collectd-unixsock":# SocketFile "/var/run/collectd/collectd-unixsock":' "${D}"/etc/collectd.conf || die
372 sed -i -e 's:^.*LoadPlugin perl$:# The new, correct way to load the perl plugin -- \n# <LoadPlugin perl>\n# Globals true\n# </LoadPlugin>:' "${D}"/etc/collectd.conf || die
373 sed -i -e 's:^.*LoadPlugin python$:# The new, correct way to load the python plugin -- \n# <LoadPlugin python>\n# Globals true\n# </LoadPlugin>:' "${D}"/etc/collectd.conf || die
374 }
375
376 collectd_rdeps() {
377 if (use collectd_plugins_${1} && ! has_version "${2}"); then
378 elog "The ${1} plug-in needs ${2} to be installed locally or remotely to work."
379 fi
380 }
381
382 pkg_postinst() {
383 collectd_rdeps apcups sys-power/apcupsd
384 collectd_rdeps hddtemp app-admin/hddtemp
385 collectd_rdeps mbmon sys-apps/xmbmon
386 collectd_rdeps memcached ">=net-misc/memcached-1.2.2-r2"
387 collectd_rdeps ntpd net-misc/ntp
388 collectd_rdeps openvpn ">=net-misc/openvpn-2.0.9"
389
390 echo
391 elog "collectd is now started as unprivileged user by default."
392 elog "You may want to recheck the configuration."
393 elog
394
395 if use collectd_plugins_email; then
396 ewarn "The email plug-in is deprecated. To submit statistics please use the unixsock plugin."
397 fi
398 if use contrib; then
399 elog "The scripts in /usr/share/doc/${PF}/collection3 for generating graphs need dev-perl/HTML-Parser,"
400 elog "dev-perl/config-general, dev-perl/regexp-common, and net-analyzer/rrdtool[perl] to be installed."
401 fi
402
403 if [[ ${REPLACING_VERSIONS} < 5 ]]; then
404 ewarn "Version 5 of collectd uses a database format different from version 4. You will"
405 ewarn "have to migrate your database after the upgrade, following the guide at"
406 ewarn " http://www.collectd.org/wiki/index.php/V4_to_v5_migration_guide"
407 fi
408 }