diff --git a/collectd-new_libstatgrab.patch b/collectd-new_libstatgrab.patch new file mode 100644 index 0000000..1661d35 --- /dev/null +++ b/collectd-new_libstatgrab.patch @@ -0,0 +1,63 @@ +--- configure.ac ++++ configure.ac +@@ -4003,6 +4003,34 @@ + LDFLAGS="$SAVE_LDFLAGS" + fi + ++if test "x$with_libstatgrab" = "xyes" ++then ++ SAVE_CFLAGS="$CFLAGS" ++ SAVE_LDFLAGS="$LDFLAGS" ++ ++ CFLAGS="$CFLAGS $with_libstatgrab_cflags" ++ LDFLAGS="$LDFLAGS $with_libstatgrab_ldflags" ++ ++ AC_CACHE_CHECK([if sg_init() requires an argument], ++ [c_cv_have_libstatgrab_init_arg], ++ AC_LINK_IFELSE([AC_LANG_PROGRAM( ++[[[ ++#include ++#include ++]]], ++[[[ ++ if (sg_init()) return 0; ++]]] ++ )], ++ [c_cv_have_libstatgrab_init_arg="no"], ++ [c_cv_have_libstatgrab_init_arg="yes"] ++ ) ++ ) ++ ++ CFLAGS="$SAVE_CFLAGS" ++ LDFLAGS="$SAVE_LDFLAGS" ++fi ++ + AM_CONDITIONAL(BUILD_WITH_LIBSTATGRAB, test "x$with_libstatgrab" = "xyes") + if test "x$with_libstatgrab" = "xyes" + then +@@ -4011,6 +4039,10 @@ + BUILD_WITH_LIBSTATGRAB_LDFLAGS="$with_libstatgrab_ldflags" + AC_SUBST(BUILD_WITH_LIBSTATGRAB_CFLAGS) + AC_SUBST(BUILD_WITH_LIBSTATGRAB_LDFLAGS) ++ if test "x$c_cv_have_libstatgrab_init_arg" = "xyes" ++ then ++ AC_DEFINE(HAVE_LIBSTATGRAB_INIT_ARG, 1, [Define to 1 if sg_init does require an argument]) ++ fi + fi + # }}} + +--- src/collectd.c ++++ src/collectd.c +@@ -288,7 +288,11 @@ + #endif + + #if HAVE_LIBSTATGRAB +- if (sg_init ()) ++ if (sg_init ( ++# if HAVE_LIBSTATGRAB_INIT_ARG ++ 0 ++# endif ++ )) + { + ERROR ("sg_init: %s", sg_str_error (sg_get_error ())); + return (-1); diff --git a/collectd.changes b/collectd.changes index bf7fae6..b28aa2d 100644 --- a/collectd.changes +++ b/collectd.changes @@ -1,3 +1,10 @@ +------------------------------------------------------------------- +Thu Dec 17 17:56:16 CET 2015 - ro@suse.de + +- add patch collectd-new_libstatgrab.patch: + fix build with recent libstatgrab (basically backport from git) +- do not (build)require sensors on s390/s390x + ------------------------------------------------------------------- Sat Sep 12 10:58:03 UTC 2015 - matwey.kornilov@gmail.com diff --git a/collectd.spec b/collectd.spec index 8a24ae7..5c44683 100644 --- a/collectd.spec +++ b/collectd.spec @@ -22,7 +22,14 @@ %define snmp 1 %define with_esmtp 1 %define ipvs_plugin ipvs -%define plugins apache apcups battery %{expand:%{bind_plugin}} cgroups curl %{expand:%{curl_json_plugin}} %{expand:%{curl_xml_plugin}} conntrack contextswitch cpu cpufreq csv df disk %{expand:%{dns_plugin}} email entropy exec filecount fscache hddtemp interface %{expand:%{ipvs_plugin}} irq load logfile match_empty_counter match_hashed match_regex match_timediff match_value mbmon %{expand:%{memcached_plugin}} memory multimeter netlink network nfs nginx ntpd olsrd openvpn perl ping protocols powerdns processes rrdtool sensors serial statsd swap syslog table tail target_notification target_replace target_scale target_set target_v5upgrade tcpconns teamspeak2 ted thermal threshold unixsock uptime users uuid vmem vserver wireless write_http %{expand:%{ascent_plugin}} %{expand:%{iptables_plugin}} %{expand:%{madwifi_plugin}} %{expand:%{rrdcached_plugin}} aggregation ethstat md numa tail_csv write_graphite write_riemann +%define plugins apache apcups battery %{expand:%{bind_plugin}} cgroups curl %{expand:%{curl_json_plugin}} %{expand:%{curl_xml_plugin}} conntrack contextswitch cpu cpufreq csv df disk %{expand:%{dns_plugin}} email entropy exec filecount fscache hddtemp interface %{expand:%{ipvs_plugin}} irq load logfile match_empty_counter match_hashed match_regex match_timediff match_value mbmon %{expand:%{memcached_plugin}} memory multimeter netlink network nfs nginx ntpd olsrd openvpn perl ping protocols powerdns processes rrdtool %{expand:%{sensors_plugin}} serial statsd swap syslog table tail target_notification target_replace target_scale target_set target_v5upgrade tcpconns teamspeak2 ted thermal threshold unixsock uptime users uuid vmem vserver wireless write_http %{expand:%{ascent_plugin}} %{expand:%{iptables_plugin}} %{expand:%{madwifi_plugin}} %{expand:%{rrdcached_plugin}} aggregation ethstat md numa tail_csv write_graphite write_riemann +%ifnarch s390 s390x +%define sensors 1 +%define sensors_plugin sensors +%else +%define sensors 0 +%define sensors_plugin %{nil} +%endif %if 0%{?_with_xmms:1}0 %define xmms 1 %else @@ -146,6 +153,7 @@ Patch20: collectd-split_README.patch Patch21: collectd-fix_collectd_config_path_in_snmp_probe.patch Patch23: collectd-javac_target.patch Patch25: collectd-df-remove-duplicates.patch +Patch26: collectd-new_libstatgrab.patch # for /etc/apache2/... ownership (rpmlint): BuildRequires: apache2 BuildRequires: autoconf @@ -177,11 +185,13 @@ BuildRequires: perl BuildRequires: pkgconfig BuildRequires: python-devel BuildRequires: rrdtool -BuildRequires: sensors BuildRequires: xfsprogs-devel BuildRequires: zlib-devel Requires: rrdtool +%if %{sensors} +BuildRequires: sensors Requires: sensors +%endif # FIXME: use proper Requires(pre/post/preun/...) PreReq: %fillup_prereq # in case we'd like to split it later: @@ -549,6 +559,7 @@ to write %{name} unixsock clients. %patch24 -p1 %endif %patch25 +%patch26 sed -i 's|@@VERSION@@|%{version}|g' configure.ac