#
-# Copyright (C) 2006-2015 OpenWrt.org
+# Copyright (C) 2006-2016 OpenWrt.org
#
# This is free software, licensed under the GNU General Public License v2.
# See /LICENSE for more information.
include $(TOPDIR)/rules.mk
PKG_NAME:=collectd
-PKG_VERSION:=5.5.0
-PKG_RELEASE:=5
+PKG_VERSION:=5.5.1
+PKG_RELEASE:=1
PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.bz2
PKG_SOURCE_URL:=http://collectd.org/files/
-PKG_MD5SUM:=c39305ef5514b44238b0d31f77e29e6a
+PKG_MD5SUM:=fd24b947cef9351ce3e2d6d2a0762e18
PKG_FIXUP:=autoreconf
PKG_REMOVE_FILES:=aclocal.m4 libltdl/aclocal.m4
/* consolidation_functions = */ NULL,
/* consolidation_functions_num = */ 0,
-@@ -1093,6 +1096,14 @@ static int rrd_config (const char *key,
+@@ -1110,6 +1113,14 @@ static int rrd_config (const char *key,
free (value_copy);
}
double tmp = atof (value);
--- a/src/utils_rrdcreate.c
+++ b/src/utils_rrdcreate.c
-@@ -217,6 +217,9 @@ static int rra_get (char ***ret, const v
+@@ -213,6 +213,9 @@ static int rra_get (char ***ret, const v
rts_num = rra_timespans_num;
}
+ rra_types_num = 1;
+
rra_max = rts_num * rra_types_num;
+ assert (rra_max > 0);
- if ((rra_def = (char **) malloc ((rra_max + 1) * sizeof (char *))) == NULL)
--- a/src/utils_rrdcreate.h
+++ b/src/utils_rrdcreate.h
@@ -41,6 +41,8 @@ struct rrdcreate_config_s
--- a/src/daemon/configfile.c
+++ b/src/daemon/configfile.c
-@@ -109,7 +109,7 @@ static cf_global_option_t cf_global_opti
+@@ -111,7 +111,7 @@ static cf_global_option_t cf_global_opti
{"BaseDir", NULL, PKGLOCALSTATEDIR},
{"PIDFile", NULL, PIDFILE},
{"Hostname", NULL, NULL},
+++ b/version-gen.sh
@@ -2,7 +2,7 @@
- DEFAULT_VERSION="5.5.0.git"
+ DEFAULT_VERSION="5.5.1.git"
-VERSION="`git describe 2> /dev/null | grep collectd | sed -e 's/^collectd-//'`"
+#VERSION="`git describe 2> /dev/null | grep collectd | sed -e 's/^collectd-//'`"
rf->rf_effective_interval = rf->rf_interval;
pthread_mutex_lock (&read_lock);
-
+++ /dev/null
-Backport of 780e6a76021a240e95007a04b723d827120afa95
-Subject: [PATCH] build: add libavltree, libcommon & libheap dependencies
-
-Otherwise it can break on very parallel builds since collectd link time
-arrives before one or more of these were built.
-
---- a/src/daemon/Makefile.am
-+++ b/src/daemon/Makefile.am
-@@ -49,7 +49,7 @@ collectd_CPPFLAGS = $(AM_CPPFLAGS) $(LT
- collectd_CFLAGS = $(AM_CFLAGS)
- collectd_LDFLAGS = -export-dynamic
- collectd_LDADD = libavltree.la libcommon.la libheap.la -lm
--collectd_DEPENDENCIES =
-+collectd_DEPENDENCIES = libavltree.la libcommon.la libheap.la
-
- # Link to these libraries..
- if BUILD_WITH_LIBRT
--- /dev/null
+Patch reverts upstream commit:
+https://github.com/collectd/collectd/commit/6124da7a48f28f54fc09ebeb942d1037516fe6ab
+
+The commit changed the detection path due to FreeBSD issues,
+but apparently affects also Openwrt buildroot negatively.
+
+Original explanation:
+ From 6124da7a48f28f54fc09ebeb942d1037516fe6ab Mon Sep 17 00:00:00 2001
+ Subject: [PATCH] Fix libmodbus detection on FreeBSD
+
+ We look for modbus/modbus.h in /usr/local/include/modbus
+ but we should look for modbus.h
+
+ This is only an issue on FreeBSD since /usr/local/include is not
+ in the default search path.
+
+Reversed patch to be applied:
+
+--- a/configure.ac
++++ b/configure.ac
+@@ -2585,7 +2585,7 @@ then
+ SAVE_CPPFLAGS="$CPPFLAGS"
+ CPPFLAGS="$CPPFLAGS $with_libmodbus_cflags"
+
+- AC_CHECK_HEADERS(modbus.h, [], [with_libmodbus="no (modbus.h not found)"])
++ AC_CHECK_HEADERS(modbus/modbus.h, [], [with_libmodbus="no (modbus/modbus.h not found)"])
+
+ CPPFLAGS="$SAVE_CPPFLAGS"
+ fi
+--- a/src/modbus.c
++++ b/src/modbus.c
+@@ -27,7 +27,7 @@
+
+ #include <netdb.h>
+
+-#include <modbus.h>
++#include <modbus/modbus.h>
+
+ #ifndef LIBMODBUS_VERSION_CHECK
+ /* Assume version 2.0.3 */
--- a/configure.ac
+++ b/configure.ac
-@@ -589,6 +589,9 @@ AC_CHECK_HEADERS(net/pfvar.h,
+@@ -663,6 +663,9 @@ AC_CHECK_HEADERS(net/pfvar.h,
have_termios_h="no"
AC_CHECK_HEADERS(termios.h, [have_termios_h="yes"])
# For the turbostat plugin
have_asm_msrindex_h="no"
AC_CHECK_HEADERS(asm/msr-index.h, [have_asm_msrindex_h="yes"])
-@@ -5171,6 +5174,7 @@ plugin_interface="no"
+@@ -5241,6 +5244,7 @@ plugin_interface="no"
plugin_ipmi="no"
plugin_ipvs="no"
plugin_irq="no"
plugin_load="no"
plugin_log_logstash="no"
plugin_memory="no"
-@@ -5562,6 +5566,7 @@ AC_PLUGIN([ipmi], [$plugin_ipmi],
+@@ -5638,6 +5642,7 @@ AC_PLUGIN([ipmi], [$plugin_ipmi],
AC_PLUGIN([iptables], [$with_libiptc], [IPTables rule counters])
AC_PLUGIN([ipvs], [$plugin_ipvs], [IPVS connection statistics])
AC_PLUGIN([irq], [$plugin_irq], [IRQ statistics])
AC_PLUGIN([java], [$with_java], [Embed the Java Virtual Machine])
AC_PLUGIN([load], [$plugin_load], [System load])
AC_PLUGIN([logfile], [yes], [File logging plugin])
-@@ -5891,6 +5896,7 @@ Configuration:
+@@ -5967,6 +5972,7 @@ Configuration:
oracle . . . . . . . $with_oracle
protobuf-c . . . . . $have_protoc_c
python . . . . . . . $with_python
Features:
daemon mode . . . . . $enable_daemon
-@@ -5940,6 +5946,7 @@ Configuration:
+@@ -6016,6 +6022,7 @@ Configuration:
iptables . . . . . . $enable_iptables
ipvs . . . . . . . . $enable_ipvs
irq . . . . . . . . . $enable_irq
--- a/src/collectd.conf.in
+++ b/src/collectd.conf.in
@@ -128,6 +128,7 @@
- #@BUILD_PLUGIN_IPMI_TRUE@LoadPlugin ipmi
+ #@BUILD_PLUGIN_IPTABLES_TRUE@LoadPlugin iptables
#@BUILD_PLUGIN_IPVS_TRUE@LoadPlugin ipvs
#@BUILD_PLUGIN_IRQ_TRUE@LoadPlugin irq
+#@BUILD_PLUGIN_IWINFO_TRUE@LoadPlugin iwinfo
# JVMArg "-Djava.class.path=@prefix@/share/collectd/java/collectd-api.jar"
--- a/src/collectd.conf.pod
+++ b/src/collectd.conf.pod
-@@ -2572,6 +2572,27 @@ and all other interrupts are collected.
+@@ -2608,6 +2608,27 @@ and all other interrupts are collected.
=back
+}
--- a/src/Makefile.am
+++ b/src/Makefile.am
-@@ -459,6 +459,13 @@ irq_la_SOURCES = irq.c \
+@@ -454,6 +454,13 @@ irq_la_SOURCES = irq.c
irq_la_LDFLAGS = $(PLUGIN_LDFLAGS)
endif
+if BUILD_PLUGIN_IWINFO
+pkglib_LTLIBRARIES += iwinfo.la
-+iwinfo_la_SOURCES = iwinfo.c utils_ignorelist.c utils_ignorelist.h
++iwinfo_la_SOURCES = iwinfo.c
+iwinfo_la_LDFLAGS = -module -avoid-version
+iwinfo_la_LIBADD = -liwinfo
+endif
java_la_SOURCES = java.c
--- a/src/types.db
+++ b/src/types.db
-@@ -227,6 +227,7 @@ voltage value:GAUGE:U:U
+@@ -228,6 +228,7 @@ voltage value:GAUGE:U:U
vs_memory value:GAUGE:0:9223372036854775807
vs_processes value:GAUGE:0:65535
vs_threads value:GAUGE:0:65535
--- a/src/ping.c
+++ b/src/ping.c
-@@ -656,7 +656,7 @@ static int ping_read (void) /* {{{ */
+@@ -658,7 +658,7 @@ static int ping_read (void) /* {{{ */
/ ((double) (pkg_recv * (pkg_recv - 1))));
/* Calculate drop rate. */