From e2f06a774d36973b308488c8d2ee5d3299f465692cf2205903991f3d404e311c Mon Sep 17 00:00:00 2001 From: Stephan Kulow Date: Fri, 16 Sep 2011 14:32:49 +0000 Subject: [PATCH 1/4] prepare_spec OBS-URL: https://build.opensuse.org/package/show/server:monitoring/collectd?expand=0&rev=90 --- collectd.spec | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/collectd.spec b/collectd.spec index 0e7bd47..61f166d 100644 --- a/collectd.spec +++ b/collectd.spec @@ -115,7 +115,7 @@ Name: collectd Version: 4.10.3 -Release: 1 +Release: 0 Summary: Statistics Collection Daemon for filling RRD Files Source: http://collectd.org/files/collectd-%{version}.tar.bz2 Source1: collectd.suse.init From 86e49426a1ea215484d299f70fb59782ae7ff7d687c5da4dc4067901982e0b62 Mon Sep 17 00:00:00 2001 From: Stephan Kulow Date: Fri, 16 Sep 2011 14:35:58 +0000 Subject: [PATCH 2/4] - adding patch from jengelh to fix build OBS-URL: https://build.opensuse.org/package/show/server:monitoring/collectd?expand=0&rev=91 --- collectd-iptc.diff | 125 +++++++++++++++++++++++++++++++++++++++++++++ collectd.changes | 5 ++ collectd.spec | 29 ++--------- 3 files changed, 133 insertions(+), 26 deletions(-) create mode 100644 collectd-iptc.diff diff --git a/collectd-iptc.diff b/collectd-iptc.diff new file mode 100644 index 0000000..aa2b401 --- /dev/null +++ b/collectd-iptc.diff @@ -0,0 +1,125 @@ +--- + configure.in | 102 +---------------------------------------------------------- + 1 file changed, 3 insertions(+), 99 deletions(-) + +Index: collectd-4.10.3/configure.in +=================================================================== +--- collectd-4.10.3.orig/configure.in ++++ collectd-4.10.3/configure.in +@@ -1560,100 +1560,10 @@ AM_CONDITIONAL(BUILD_WITH_LIBGCRYPT, tes + # }}} + + # --with-libiptc {{{ +-with_own_libiptc="no" +-AC_ARG_WITH(libiptc, [AS_HELP_STRING([--with-libiptc@<:@=PREFIX@:>@], [Path to libiptc.])], +-[ +- if test "x$withval" = "xshipped" +- then +- with_own_libiptc="yes" +- with_libiptc="yes" +- else if test "x$withval" != "xno" && test "x$withval" != "xyes" +- then +- LIBIPTC_CPPFLAGS="$LIBIPTC_CPPFLAGS -I$withval/include" +- LIBIPTC_LDFLAGS="$LIBIPTC_LDFLAGS -L$withval/lib" +- with_libiptc="yes" +- else +- with_libiptc="$withval" +- fi; fi +-], +-[ +- if test "x$ac_system" = "xLinux" +- then +- with_libiptc="yes" +- else +- with_libiptc="no (Linux only)" +- fi +-]) +-SAVE_CPPFLAGS="$CPPFLAGS" +-SAVE_LDFLAGS="$LDFLAGS" +-CPPFLAGS="$CPPFLAGS $LIBIPTC_CPPFLAGS" +-LDFLAGS="$LDFLAGS $LIBIPTC_LDFLAGS" +-# check whether the header file for libiptc is available. +-if test "x$with_libiptc" = "xyes" && test "x$with_own_libiptc" = "xno" +-then +- AC_CHECK_HEADERS(libiptc/libiptc.h, +- [ +- AC_DEFINE(HAVE_LIBIPTC_LIBIPTC_H, 1, [Define to 1 if you have the header file.]) +- ], +- [ +- with_libiptc="yes" +- with_own_libiptc="yes" +- ]) +-fi +-if test "x$with_libiptc" = "xyes" && test "x$with_own_libiptc" = "xno" +-then +- AC_CHECK_HEADERS(libiptc/libip6tc.h, +- [ +- AC_DEFINE(HAVE_LIBIPTC_LIBIP6TC_H, 1, [Define to 1 if you have the header file.]) +- ], +- [ +- with_libiptc="yes" +- with_own_libiptc="yes" +- ]) +-fi +-# If the header file is available, check for the required type declaractions. +-# They may be missing in old versions of libiptc. In that case, they will be +-# declared in the iptables plugin. +-if test "x$with_libiptc" = "xyes" && test "x$with_own_libiptc" = "xno" +-then +- AC_CHECK_TYPES([iptc_handle_t, ip6tc_handle_t], [], [], +- [ +-#if OWN_LIBIPTC +-# include "$srcdir/src/owniptc/libiptc.h" +-# include "$srcdir/src/owniptc/libip6tc.h" +-#else +-# include +-# include +-#endif +- ]) +-fi +-# Check for the iptc_init symbol in the library. +-if test "x$with_libiptc" = "xyes" && test "x$with_own_libiptc" = "xno" +-then +- AC_CHECK_LIB(iptc, iptc_init, +- [ +- AC_DEFINE(HAVE_LIBIPTC, 1, [Define to 1 if you have the iptc library (-liptc).]) +- ], +- [ +- with_libiptc="yes" +- with_own_libiptc="yes" +- ]) +-fi +-# The system wide version failed for some reason. Check if we have the required +-# headers to build the shipped version. +-if test "x$with_libiptc" = "xyes" && test "x$with_own_libiptc" = "xyes" +-then +- AC_CHECK_HEADERS(linux/netfilter_ipv4/ip_tables.h linux/netfilter_ipv6/ip6_tables.h linux/netfilter/x_tables.h, [], +- [ +- with_libiptc="no (Linux iptables headers not found)" +- with_own_libiptc="no" +- ], +- [ +-#include "$srcdir/src/owniptc/ipt_kernel_headers.h" +- ]) +-fi ++PKG_CHECK_MODULES([LIBIPTC], [libiptc], [with_libiptc=yes], [with_libiptc=no]) ++LIBIPTC_CPPFLAGS="$LIBIPTC_CFLAGS"; ++AC_SUBST([LIBIPTC_CPPFLAGS]) + AM_CONDITIONAL(BUILD_WITH_LIBIPTC, test "x$with_libiptc" = "xyes") +-AM_CONDITIONAL(BUILD_WITH_OWN_LIBIPTC, test "x$with_own_libiptc" = "xyes") + if test "x$with_libiptc" = "xyes" + then + BUILD_WITH_LIBIPTC_CPPFLAGS="$LIBIPTC_CPPFLAGS" +@@ -1661,12 +1571,6 @@ then + AC_SUBST(BUILD_WITH_LIBIPTC_CPPFLAGS) + AC_SUBST(BUILD_WITH_LIBIPTC_LDFLAGS) + fi +-if test "x$with_own_libiptc" = "xyes" +-then +- AC_DEFINE(OWN_LIBIPTC, 1, [Define to 1 if we use the shipped iptc library.]) +-fi +-CPPFLAGS="$SAVE_CPPFLAGS" +-LDFLAGS="$SAVE_LDFLAGS" + # }}} + + # --with-java {{{ diff --git a/collectd.changes b/collectd.changes index c386229..1c53764 100644 --- a/collectd.changes +++ b/collectd.changes @@ -1,3 +1,8 @@ +------------------------------------------------------------------- +Fri Sep 16 14:35:10 UTC 2011 - coolo@suse.com + +- adding patch from jengelh to fix build + ------------------------------------------------------------------- Tue Aug 2 22:55:45 UTC 2011 - stefan.bruens@rwth-aachen.de diff --git a/collectd.spec b/collectd.spec index 61f166d..a58f7b3 100644 --- a/collectd.spec +++ b/collectd.spec @@ -126,6 +126,7 @@ Source10: http://devresources.linux-foundation.org/dev/iproute2/download/i # workaround for missing pthread.pc on openSUSE, required by OpenIPMIpthread.pc # see https://bugzilla.novell.com/show_bug.cgi?id=388026 Source20: collectd-pthread.pc +Source99: collectd-rpmlintrc Patch4: collectd-lib64.patch Patch7: collectd-fix-config.patch Patch9: collectd-version.patch @@ -146,7 +147,7 @@ Patch24: collectd-pkgconfig_libnotify_add_gtk.patch Patch25: collectd-df-remove-duplicates.patch Patch26: collectd-libip4tc.patch Patch27: collectd-libnotify_070.patch -Source99: collectd-rpmlintrc +Patch28: collectd-iptc.diff Url: http://collectd.org/ Group: System/Monitoring License: GNU General Public License (GPL) @@ -247,15 +248,7 @@ Since the daemon doesn't need to startup every time it wants to update the files it's very fast and easy on the system. Also, the statistics are very fine grained since the files are updated every 10 seconds. - - - -Authors: --------- - Florian octo Forster - %package web - Summary: Web Frontend for watching the %{name} Statistics Group: System/Monitoring Requires: perl apache2 rrdtool @@ -271,7 +264,6 @@ Web frontend CGI for watching %{name} statistics from a browser. Please look at /etc/apache2/conf.d/%{name}.conf on how to enable. %package web-js - Summary: Web/JavaScript Frontend for watching %{name} Statistics Group: System/Monitoring Requires: perl apache2 rrdtool @@ -292,7 +284,6 @@ enable. %if %libnotify %package plugin-notify-desktop - Summary: Desktop Notification Plugin for %{name} Group: System/Monitoring Requires: %{name} = %{version}-%{release} @@ -304,7 +295,6 @@ Desktop Notification Support for %{name} %if %ipmi %package plugin-ipmi - Summary: OpenIPMI Monitoring Plugin for %{name} Group: System/Monitoring Requires: %{name} = %{version}-%{release} @@ -317,7 +307,6 @@ library, for IPMI enabled systems. %if %snmp %package plugin-snmp - Summary: SNMP Monitoring Plugin for %{name} Group: System/Monitoring Requires: %{name} = %{version}-%{release} @@ -332,7 +321,6 @@ Optional %{name} plugin to monitor devices using SNMP. %if %with_mysql %package plugin-mysql - Summary: MySQL Monitoring Plugin for %{name} Group: System/Monitoring Requires: %{name} = %{version}-%{release} @@ -344,7 +332,6 @@ Optional %{name} plugin to monitor MySQL server instances. %if %with_pgsql %package plugin-postgresql - Summary: PostgreSQL Monitoring Plugin for %{name} Group: System/Monitoring Requires: %{name} = %{version}-%{release} @@ -354,7 +341,6 @@ Optional %{name} plugin to monitor PostgreSQL server instances. %endif #with_pgsql %package plugin-python - Summary: Python API for %{name} Group: System/Monitoring Requires: %{name} = %{version}-%{release} @@ -366,7 +352,6 @@ Python. %if %java %package plugin-java - Summary: Java API for %{name} Group: System/Monitoring Requires: %{name} = %{version}-%{release} @@ -379,7 +364,6 @@ Java. %if %virt %package plugin-virt - Summary: Virtual Machine Statistics Plugin for %{name} Group: System/Monitoring Requires: %{name} = %{version}-%{release} @@ -392,7 +376,6 @@ machines using libvirt. %if %xmms %package plugin-xmms - Summary: XMMS Monitoring Plugin for %{name} Group: System/Monitoring Requires: %{name} = %{version}-%{release} @@ -405,7 +388,6 @@ bitrates of files played with XMMS. %if %dbi %package plugin-dbi - Summary: DBI Storage Plugin for %{name} Group: System/Monitoring Requires: %{name} = %{version}-%{release} @@ -418,7 +400,6 @@ various databases as supported by libdbi. %if %memcachec %package plugin-memcachec - Summary: Memcache Daemon Monitoring Plugin for %{name} Group: System/Monitoring Requires: %{name} = %{version}-%{release} @@ -430,7 +411,6 @@ Optional %{name} plugin to sample memcached statistics. %if %protobuf %package plugin-pinba - Summary: Pinba Collector Plugin for %{name} Group: System/Monitoring Requires: %{name} = %{version}-%{release} @@ -441,7 +421,6 @@ profiling extension for PHP. %endif #protobuf %package plugins-all - Summary: All Monitoring Plugins for %{name} Group: System/Monitoring Requires: %{name} = %{version}-%{release} @@ -484,7 +463,6 @@ Metapackage that installs %{name} and all the available monitoring plugin subpackages, except %{name}-plugin-xmms %package spamassassin - Summary: Spamassassin Monitoring for %{name} Group: System/Monitoring Requires: %{name} = %{version}-%{release} @@ -495,7 +473,6 @@ Plugin for filling %{name} with statistics from the SpamAsssassin anti-spam engine. %package -n libcollectdclient0 - Summary: Library for %{name} clients Group: System/Monitoring Provides: libcollectdclient = %{version}-%{release} @@ -505,7 +482,6 @@ Library which abstracts communication with the %{name} unixsock plugin for clients. %package -n libcollectdclient-devel - Summary: Development Environment for %{name} clients Group: Development/Libraries/C and C++ Requires: libcollectdclient0 = %{version}-%{release} @@ -541,6 +517,7 @@ popd #iproute2 %patch25 -p1 %patch26 -p1 %patch27 -p1 +%patch28 -p1 %__sed -i 's|@@VERSION@@|%{version}|g' configure.in From a7df4f3e01ec675c44f682298c3745e4578a51e99ec6271b41fbcea063fd7543 Mon Sep 17 00:00:00 2001 From: Stephan Kulow Date: Sat, 17 Sep 2011 14:51:55 +0000 Subject: [PATCH 3/4] Accepting request 82484 from home:jengelh:nl iptc fixage, tested OBS-URL: https://build.opensuse.org/request/show/82484 OBS-URL: https://build.opensuse.org/package/show/server:monitoring/collectd?expand=0&rev=92 --- collectd-iptc.diff | 56 +++++++++++++++++++++++++++++++---------- collectd-libip4tc.patch | 16 ------------ collectd.spec | 6 ++--- 3 files changed, 45 insertions(+), 33 deletions(-) delete mode 100644 collectd-libip4tc.patch diff --git a/collectd-iptc.diff b/collectd-iptc.diff index aa2b401..2415d5f 100644 --- a/collectd-iptc.diff +++ b/collectd-iptc.diff @@ -1,12 +1,13 @@ --- - configure.in | 102 +---------------------------------------------------------- - 1 file changed, 3 insertions(+), 99 deletions(-) + configure.in | 107 -------------------------------------------------------- + src/Makefile.am | 15 ++----- + 2 files changed, 5 insertions(+), 117 deletions(-) Index: collectd-4.10.3/configure.in =================================================================== --- collectd-4.10.3.orig/configure.in +++ collectd-4.10.3/configure.in -@@ -1560,100 +1560,10 @@ AM_CONDITIONAL(BUILD_WITH_LIBGCRYPT, tes +@@ -1560,113 +1560,8 @@ AM_CONDITIONAL(BUILD_WITH_LIBGCRYPT, tes # }}} # --with-libiptc {{{ @@ -102,18 +103,16 @@ Index: collectd-4.10.3/configure.in -#include "$srcdir/src/owniptc/ipt_kernel_headers.h" - ]) -fi -+PKG_CHECK_MODULES([LIBIPTC], [libiptc], [with_libiptc=yes], [with_libiptc=no]) -+LIBIPTC_CPPFLAGS="$LIBIPTC_CFLAGS"; -+AC_SUBST([LIBIPTC_CPPFLAGS]) ++PKG_CHECK_MODULES([libiptc], [libiptc], [with_libiptc=yes], [with_libiptc=no]) AM_CONDITIONAL(BUILD_WITH_LIBIPTC, test "x$with_libiptc" = "xyes") -AM_CONDITIONAL(BUILD_WITH_OWN_LIBIPTC, test "x$with_own_libiptc" = "xyes") - if test "x$with_libiptc" = "xyes" - then - BUILD_WITH_LIBIPTC_CPPFLAGS="$LIBIPTC_CPPFLAGS" -@@ -1661,12 +1571,6 @@ then - AC_SUBST(BUILD_WITH_LIBIPTC_CPPFLAGS) - AC_SUBST(BUILD_WITH_LIBIPTC_LDFLAGS) - fi +-if test "x$with_libiptc" = "xyes" +-then +- BUILD_WITH_LIBIPTC_CPPFLAGS="$LIBIPTC_CPPFLAGS" +- BUILD_WITH_LIBIPTC_LDFLAGS="$LIBIPTC_LDFLAGS" +- AC_SUBST(BUILD_WITH_LIBIPTC_CPPFLAGS) +- AC_SUBST(BUILD_WITH_LIBIPTC_LDFLAGS) +-fi -if test "x$with_own_libiptc" = "xyes" -then - AC_DEFINE(OWN_LIBIPTC, 1, [Define to 1 if we use the shipped iptc library.]) @@ -123,3 +122,34 @@ Index: collectd-4.10.3/configure.in # }}} # --with-java {{{ +Index: collectd-4.10.3/src/Makefile.am +=================================================================== +--- collectd-4.10.3.orig/src/Makefile.am ++++ collectd-4.10.3/src/Makefile.am +@@ -1,7 +1,4 @@ + SUBDIRS = libcollectdclient +-if BUILD_WITH_OWN_LIBIPTC +-SUBDIRS += owniptc +-endif + if BUILD_WITH_OWN_LIBOCONFIG + SUBDIRS += liboconfig + endif +@@ -413,14 +410,10 @@ endif # BUILD_PLUGIN_INTERFACE + if BUILD_PLUGIN_IPTABLES + pkglib_LTLIBRARIES += iptables.la + iptables_la_SOURCES = iptables.c +-iptables_la_CPPFLAGS = $(AM_CPPFLAGS) $(BUILD_WITH_LIBIPTC_CPPFLAGS) +-iptables_la_LDFLAGS = -module -avoid-version $(BUILD_WITH_LIBIPTC_LDFLAGS) +-if BUILD_WITH_OWN_LIBIPTC +-iptables_la_LIBADD = owniptc/libiptc.la +-iptables_la_DEPENDENCIES = owniptc/libiptc.la +-else +-iptables_la_LIBADD = -liptc +-endif ++iptables_la_CPPFLAGS = $(AM_CPPFLAGS) ++iptables_la_CFLAGS = ${AM_CFLAGS} ${libiptc_CFLAGS} ++iptables_la_LDFLAGS = -module -avoid-version ++iptables_la_LIBADD = ${libiptc_LIBS} + collectd_LDADD += "-dlopen" iptables.la + collectd_DEPENDENCIES += iptables.la + endif diff --git a/collectd-libip4tc.patch b/collectd-libip4tc.patch deleted file mode 100644 index c40de02..0000000 --- a/collectd-libip4tc.patch +++ /dev/null @@ -1,16 +0,0 @@ -diff --git a/configure.in b/configure.in -index 5c3564c..d1c293c 100644 ---- a/configure.in -+++ b/configure.in -@@ -1630,9 +1630,9 @@ fi - # Check for the iptc_init symbol in the library. - if test "x$with_libiptc" = "xyes" && test "x$with_own_libiptc" = "xno" - then -- AC_CHECK_LIB(iptc, iptc_init, -+ AC_CHECK_LIB(ip4tc, iptc_init, - [ -- AC_DEFINE(HAVE_LIBIPTC, 1, [Define to 1 if you have the iptc library (-liptc).]) -+ AC_DEFINE(HAVE_LIBIPTC, 1, [Define to 1 if you have the iptc library (-lip4tc).]) - ], - [ - with_libiptc="yes" diff --git a/collectd.spec b/collectd.spec index a58f7b3..296cf71 100644 --- a/collectd.spec +++ b/collectd.spec @@ -145,9 +145,8 @@ Patch22: collectd-collection3.patch Patch23: collectd-javac_target.patch Patch24: collectd-pkgconfig_libnotify_add_gtk.patch Patch25: collectd-df-remove-duplicates.patch -Patch26: collectd-libip4tc.patch +Patch26: collectd-iptc.diff Patch27: collectd-libnotify_070.patch -Patch28: collectd-iptc.diff Url: http://collectd.org/ Group: System/Monitoring License: GNU General Public License (GPL) @@ -515,9 +514,8 @@ popd #iproute2 %patch23 %patch24 %patch25 -p1 -%patch26 -p1 +%patch -P 26 -p1 %patch27 -p1 -%patch28 -p1 %__sed -i 's|@@VERSION@@|%{version}|g' configure.in From 8dc9feb5fab1c315112a80f601f36176144978a7da2c25fda5714fda6ade7b5d Mon Sep 17 00:00:00 2001 From: Stefan Schubert Date: Mon, 17 Oct 2011 09:20:44 +0000 Subject: [PATCH 4/4] fixed build OBS-URL: https://build.opensuse.org/package/show/server:monitoring/collectd?expand=0&rev=93 --- collectd-fix_new_yajl_lib.patch | 24 ++++++++++++++++++++++++ collectd.changes | 5 +++++ collectd.spec | 2 ++ 3 files changed, 31 insertions(+) create mode 100644 collectd-fix_new_yajl_lib.patch diff --git a/collectd-fix_new_yajl_lib.patch b/collectd-fix_new_yajl_lib.patch new file mode 100644 index 0000000..d6e4f10 --- /dev/null +++ b/collectd-fix_new_yajl_lib.patch @@ -0,0 +1,24 @@ +--- src/curl_json.c ++++ src/curl_json.c +@@ -100,11 +100,9 @@ + status = yajl_parse(db->yajl, (unsigned char *)buf, len); + if (status == yajl_status_ok) + { +- status = yajl_parse_complete(db->yajl); ++ status = yajl_complete_parse(db->yajl); + return (len); + } +- else if (status == yajl_status_insufficient_data) +- return (len); + + if (status != yajl_status_ok) + { +@@ -760,7 +758,7 @@ + char *url; + yajl_handle yprev = db->yajl; + +- db->yajl = yajl_alloc (&ycallbacks, NULL, NULL, (void *)db); ++ db->yajl = yajl_alloc (&ycallbacks, NULL, (void *)db); + if (db->yajl == NULL) + { + ERROR ("curl_json plugin: yajl_alloc failed."); diff --git a/collectd.changes b/collectd.changes index 1c53764..dfd53e5 100644 --- a/collectd.changes +++ b/collectd.changes @@ -1,3 +1,8 @@ +------------------------------------------------------------------- +Mon Oct 17 09:19:25 UTC 2011 - schubi@suse.com + +- fixed build ( new yajl lib API ) + ------------------------------------------------------------------- Fri Sep 16 14:35:10 UTC 2011 - coolo@suse.com diff --git a/collectd.spec b/collectd.spec index 296cf71..e979813 100644 --- a/collectd.spec +++ b/collectd.spec @@ -147,6 +147,7 @@ Patch24: collectd-pkgconfig_libnotify_add_gtk.patch Patch25: collectd-df-remove-duplicates.patch Patch26: collectd-iptc.diff Patch27: collectd-libnotify_070.patch +Patch28: collectd-fix_new_yajl_lib.patch Url: http://collectd.org/ Group: System/Monitoring License: GNU General Public License (GPL) @@ -516,6 +517,7 @@ popd #iproute2 %patch25 -p1 %patch -P 26 -p1 %patch27 -p1 +%patch28 %__sed -i 's|@@VERSION@@|%{version}|g' configure.in