summaryrefslogtreecommitdiff
path: root/sysutils
diff options
context:
space:
mode:
authorhe <he>2015-08-18 07:47:46 +0000
committerhe <he>2015-08-18 07:47:46 +0000
commitb212d49c90e4916eacb7037c25fb0f8304aa6c9f (patch)
treee1ec8ba633d80d834ba49af54ef19be9c1785a6c /sysutils
parent06085c8ab329fbfb746b17b91877a5cc94888245 (diff)
downloadpkgsrc-b212d49c90e4916eacb7037c25fb0f8304aa6c9f.tar.gz
Another round of update to collectd:
* Add support for the "irq" plugin on NetBSD. * Declare BUILD_DEFS+= VARBASE to silence pkglint. * Tweak Makefile.am instead; commit regenerated Makefile.in with automake. * Adjust the patch for the df plugin so it builds both in newer (> 6.99.19) and older NetBSD (e.g. 6.1.5) * Adjust the entropy plugin to use <paths.h> and _PATH_URANDOM to silence pkglint. PKGREVISION bumped to 5.
Diffstat (limited to 'sysutils')
-rw-r--r--sysutils/collectd/Makefile6
-rw-r--r--sysutils/collectd/PLIST3
-rw-r--r--sysutils/collectd/distinfo17
-rw-r--r--sysutils/collectd/options.mk11
-rw-r--r--sysutils/collectd/patches/patch-Makefile.am15
-rw-r--r--sysutils/collectd/patches/patch-Makefile.in151
-rw-r--r--sysutils/collectd/patches/patch-configure7
-rw-r--r--sysutils/collectd/patches/patch-configure.ac7
-rw-r--r--sysutils/collectd/patches/patch-src_Makefile.am48
-rw-r--r--sysutils/collectd/patches/patch-src_Makefile.in114
-rw-r--r--sysutils/collectd/patches/patch-src_df.c12
-rw-r--r--sysutils/collectd/patches/patch-src_entropy.c13
-rw-r--r--sysutils/collectd/patches/patch-src_irq.c102
13 files changed, 460 insertions, 46 deletions
diff --git a/sysutils/collectd/Makefile b/sysutils/collectd/Makefile
index 59387962c4a..6c9325109a6 100644
--- a/sysutils/collectd/Makefile
+++ b/sysutils/collectd/Makefile
@@ -1,6 +1,6 @@
-# $NetBSD: Makefile,v 1.9 2015/08/14 15:39:28 he Exp $
+# $NetBSD: Makefile,v 1.10 2015/08/18 07:47:46 he Exp $
-PKGREVISION= 4
+PKGREVISION= 5
.include "../../sysutils/collectd/Makefile.common"
COMMENT= Statistics collection daemon base
@@ -30,6 +30,8 @@ MAKE_JOBS_SAFE= no
CONF_FILES+= share/examples/collectd/collectd.conf \
${PKG_SYSCONFDIR}/collectd.conf
+BUILD_DEFS+= VARBASE
+
OWN_DIRS+= ${VARBASE}/db/collectd
COLLECTD_USER?= collectd
diff --git a/sysutils/collectd/PLIST b/sysutils/collectd/PLIST
index a9d79ab88fe..f1c1c8dc618 100644
--- a/sysutils/collectd/PLIST
+++ b/sysutils/collectd/PLIST
@@ -1,4 +1,4 @@
-@comment $NetBSD: PLIST,v 1.4 2015/08/11 13:19:21 he Exp $
+@comment $NetBSD: PLIST,v 1.5 2015/08/18 07:47:46 he Exp $
bin/collectd-nagios
bin/collectd-tg
bin/collectdctl
@@ -21,6 +21,7 @@ lib/collectd/exec.la
lib/collectd/filecount.la
lib/collectd/hddtemp.la
${PLIST.interface}lib/collectd/interface.la
+${PLIST.irq}lib/collectd/irq.la
${PLIST.load}lib/collectd/load.la
lib/collectd/logfile.la
lib/collectd/match_empty_counter.la
diff --git a/sysutils/collectd/distinfo b/sysutils/collectd/distinfo
index fa73fa84e0e..a823a2f88cd 100644
--- a/sysutils/collectd/distinfo
+++ b/sysutils/collectd/distinfo
@@ -1,18 +1,21 @@
-$NetBSD: distinfo,v 1.14 2015/08/16 08:39:02 he Exp $
+$NetBSD: distinfo,v 1.15 2015/08/18 07:47:46 he Exp $
SHA1 (collectd-5.5.0.tar.gz) = d24e284c1eae20c5e75b846c8b2612ab65bd5565
RMD160 (collectd-5.5.0.tar.gz) = 2197758942a5fe56e4eabda3786f09d4138e943a
Size (collectd-5.5.0.tar.gz) = 2244454 bytes
-SHA1 (patch-Makefile.in) = 197307399312fa26c71ca168b92bbe41d31d556d
-SHA1 (patch-configure) = 9157fc6e9924567a8cac0d75dccbba4c4383f641
-SHA1 (patch-configure.ac) = f22091c630bb84a9b24dbc94ed5fc66607ffc23a
-SHA1 (patch-src_Makefile.in) = f94d046ee323fdb9251ad49cf383b3a61df5dcaa
+SHA1 (patch-Makefile.am) = ed45b75293a4ea2dd577d04eeb3b9017b8f47319
+SHA1 (patch-Makefile.in) = a7cf69ca29c526be643af0ef85544e3a2dc80a77
+SHA1 (patch-configure) = d6805e1f0b6f7ced539c0ead1c6cc42288f772cf
+SHA1 (patch-configure.ac) = cd09eb3f27f1beba696a9d311fca9c9bf39abfde
+SHA1 (patch-src_Makefile.am) = 0df5125e05b46fb842d444f94683c4838dfd1f0f
+SHA1 (patch-src_Makefile.in) = bbce87cf8daf2a7d75f81c8019d936cada1191bd
SHA1 (patch-src_collectd-tg.c) = f9f41dfb0b1b55a62202128a165d5c9943faf5bc
SHA1 (patch-src_collectd.conf.in) = f0b35085cf0ddfd766e140b145177ab1f1326f5f
SHA1 (patch-src_config.h.in) = 911a0441e15e0a85bb4819f1b49eaddbdd5c9d1c
-SHA1 (patch-src_df.c) = 4e3bb664bc9795bd22947695145083ca5f2b08d3
+SHA1 (patch-src_df.c) = 3102d42c0e80525df00d4f6c794f17a75d828942
SHA1 (patch-src_disk.c) = 159862e8ca1e841e3c4013c03ba03f059fdbbab5
-SHA1 (patch-src_entropy.c) = d9bfa1bd4d045f2218105eaadf2dda90b7fc4646
+SHA1 (patch-src_entropy.c) = 7a522a6849d39bf4ed4704204a084790d27950ef
+SHA1 (patch-src_irq.c) = 6b621474de35a5879105025d1a2848e4896b8479
SHA1 (patch-src_libcollectclient_network__buffer.c) = e07d403d299613fa0885a0e7285849eb85510253
SHA1 (patch-src_memory.c) = f48d50245176426e26af7fa1b1f4ff6fbf0b1d95
SHA1 (patch-src_processes.c) = 32ca0414efaf57cb0b95b51d98b904008b5fe306
diff --git a/sysutils/collectd/options.mk b/sysutils/collectd/options.mk
index f02a13ed61a..7333ce527ff 100644
--- a/sysutils/collectd/options.mk
+++ b/sysutils/collectd/options.mk
@@ -1,12 +1,15 @@
-# $NetBSD: options.mk,v 1.4 2015/08/14 15:39:28 he Exp $
+# $NetBSD: options.mk,v 1.5 2015/08/18 07:47:46 he Exp $
PKG_OPTIONS_VAR= PKG_OPTIONS.collectd
PKG_SUPPORTED_OPTIONS= cpu df interface load memory syslog uptime
PKG_SUGGESTED_OPTIONS+= cpu df interface load memory syslog uptime
.if ${OPSYS} == "NetBSD"
-PKG_SUPPORTED_OPTIONS+= contextswitch disk entropy pf processes swap tcpconns users
-PKG_SUGGESTED_OPTIONS+= contextswitch disk entropy pf processes swap tcpconns users
+PKG_SUPPORTED_OPTIONS+= contextswitch disk entropy irq pf processes
+PKG_SUPPORTED_OPTIONS+= swap tcpconns users
+
+PKG_SUGGESTED_OPTIONS+= contextswitch disk entropy irq pf processes
+PKG_SUGGESTED_OPTIONS+= swap tcpconns users
.endif
.if ${OPSYS} == "FreeBSD"
@@ -30,7 +33,7 @@ PKG_SUGGESTED_OPTIONS+= disk nfs swap users zfs-arc
PLIST_VARS+= apple-sensors battery contextswitch cpu entropy \
df disk \
- interface load memory nfs pf processes swap \
+ interface irq load memory nfs pf processes swap \
syslog tcpconns uptime users zfs-arc
.for option in ${PLIST_VARS}
diff --git a/sysutils/collectd/patches/patch-Makefile.am b/sysutils/collectd/patches/patch-Makefile.am
new file mode 100644
index 00000000000..2dd339826b6
--- /dev/null
+++ b/sysutils/collectd/patches/patch-Makefile.am
@@ -0,0 +1,15 @@
+$NetBSD: patch-Makefile.am,v 1.1 2015/08/18 07:47:46 he Exp $
+
+Use other data directory.
+
+--- Makefile.am.orig 2015-03-09 09:38:22.000000000 +0000
++++ Makefile.am
+@@ -8,7 +8,7 @@ EXTRA_DIST = contrib version-gen.sh
+
+ install-exec-hook:
+ $(mkinstalldirs) $(DESTDIR)$(localstatedir)/run
+- $(mkinstalldirs) $(DESTDIR)$(localstatedir)/lib/$(PACKAGE_NAME)
++ $(mkinstalldirs) $(DESTDIR)$(localstatedir)/db/$(PACKAGE_NAME)
+ $(mkinstalldirs) $(DESTDIR)$(localstatedir)/log
+
+ maintainer-clean-local:
diff --git a/sysutils/collectd/patches/patch-Makefile.in b/sysutils/collectd/patches/patch-Makefile.in
index 911a9aa890c..ec5d187c5fb 100644
--- a/sysutils/collectd/patches/patch-Makefile.in
+++ b/sysutils/collectd/patches/patch-Makefile.in
@@ -1,9 +1,154 @@
-$NetBSD: patch-Makefile.in,v 1.1 2014/02/17 11:21:55 fhajny Exp $
+$NetBSD: patch-Makefile.in,v 1.2 2015/08/18 07:47:46 he Exp $
+
+Regenerate.
-Use a reasonable db dir.
--- Makefile.in.orig 2014-01-26 08:09:57.577219038 +0000
+++ Makefile.in
-@@ -882,7 +882,7 @@ uninstall-am:
+@@ -1,7 +1,7 @@
+-# Makefile.in generated by automake 1.14.1 from Makefile.am.
++# Makefile.in generated by automake 1.15 from Makefile.am.
+ # @configure_input@
+
+-# Copyright (C) 1994-2013 Free Software Foundation, Inc.
++# Copyright (C) 1994-2014 Free Software Foundation, Inc.
+
+ # This Makefile.in is free software; the Free Software Foundation
+ # gives unlimited permission to copy and/or distribute it,
+@@ -14,7 +14,17 @@
+
+ @SET_MAKE@
+ VPATH = @srcdir@
+-am__is_gnu_make = test -n '$(MAKEFILE_LIST)' && test -n '$(MAKELEVEL)'
++am__is_gnu_make = { \
++ if test -z '$(MAKELEVEL)'; then \
++ false; \
++ elif test -n '$(MAKE_HOST)'; then \
++ true; \
++ elif test -n '$(MAKE_VERSION)' && test -n '$(CURDIR)'; then \
++ true; \
++ else \
++ false; \
++ fi; \
++}
+ am__make_running_with_option = \
+ case $${target_option-} in \
+ ?) ;; \
+@@ -78,25 +88,12 @@ POST_UNINSTALL = :
+ build_triplet = @build@
+ host_triplet = @host@
+ subdir = .
+-DIST_COMMON = $(srcdir)/Makefile.in $(srcdir)/Makefile.am \
+- $(top_srcdir)/configure $(am__configure_deps) \
+- $(top_srcdir)/src/libcollectdclient/collectd/lcc_features.h.in \
+- AUTHORS COPYING ChangeLog INSTALL NEWS README TODO compile \
+- libltdl/config/compile config.guess \
+- libltdl/config/config.guess config.sub \
+- libltdl/config/config.sub depcomp libltdl/config/depcomp \
+- install-sh libltdl/config/install-sh missing \
+- libltdl/config/missing ylwrap libltdl/config/ylwrap ltmain.sh \
+- libltdl/config/ltmain.sh $(top_srcdir)/libltdl/config/compile \
+- $(top_srcdir)/libltdl/config/config.guess \
+- $(top_srcdir)/libltdl/config/config.sub \
+- $(top_srcdir)/libltdl/config/install-sh \
+- $(top_srcdir)/libltdl/config/ltmain.sh \
+- $(top_srcdir)/libltdl/config/missing
+ ACLOCAL_M4 = $(top_srcdir)/aclocal.m4
+ am__aclocal_m4_deps = $(top_srcdir)/configure.ac
+ am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \
+ $(ACLOCAL_M4)
++DIST_COMMON = $(srcdir)/Makefile.am $(top_srcdir)/configure \
++ $(am__configure_deps) $(am__DIST_COMMON)
+ am__CONFIG_DISTCLEAN_FILES = config.status config.cache config.log \
+ configure.lineno config.status.lineno
+ mkinstalldirs = $(install_sh) -d
+@@ -159,6 +156,21 @@ ETAGS = etags
+ CTAGS = ctags
+ CSCOPE = cscope
+ DIST_SUBDIRS = $(SUBDIRS)
++am__DIST_COMMON = $(srcdir)/Makefile.in \
++ $(top_srcdir)/libltdl/config/compile \
++ $(top_srcdir)/libltdl/config/config.guess \
++ $(top_srcdir)/libltdl/config/config.sub \
++ $(top_srcdir)/libltdl/config/install-sh \
++ $(top_srcdir)/libltdl/config/ltmain.sh \
++ $(top_srcdir)/libltdl/config/missing \
++ $(top_srcdir)/src/libcollectdclient/collectd/lcc_features.h.in \
++ AUTHORS COPYING ChangeLog INSTALL NEWS README TODO compile \
++ config.guess config.sub depcomp install-sh \
++ libltdl/config/compile libltdl/config/config.guess \
++ libltdl/config/config.sub libltdl/config/depcomp \
++ libltdl/config/install-sh libltdl/config/ltmain.sh \
++ libltdl/config/missing libltdl/config/ylwrap ltmain.sh missing \
++ ylwrap
+ DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST)
+ distdir = $(PACKAGE)-$(VERSION)
+ top_distdir = $(distdir)
+@@ -353,9 +365,6 @@ LIBADD_DL = @LIBADD_DL@
+ LIBADD_DLD_LINK = @LIBADD_DLD_LINK@
+ LIBADD_DLOPEN = @LIBADD_DLOPEN@
+ LIBADD_SHL_LOAD = @LIBADD_SHL_LOAD@
+-LIBGCRYPT_CFLAGS = @LIBGCRYPT_CFLAGS@
+-LIBGCRYPT_CONFIG = @LIBGCRYPT_CONFIG@
+-LIBGCRYPT_LIBS = @LIBGCRYPT_LIBS@
+ LIBLTDL = @LIBLTDL@
+ LIBNETAPP_CPPFLAGS = @LIBNETAPP_CPPFLAGS@
+ LIBNETAPP_LDFLAGS = @LIBNETAPP_LDFLAGS@
+@@ -493,7 +502,6 @@ $(srcdir)/Makefile.in: $(srcdir)/Makefi
+ echo ' cd $(top_srcdir) && $(AUTOMAKE) --foreign Makefile'; \
+ $(am__cd) $(top_srcdir) && \
+ $(AUTOMAKE) --foreign Makefile
+-.PRECIOUS: Makefile
+ Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status
+ @case '$?' in \
+ *config.status*) \
+@@ -710,15 +718,15 @@ dist-xz: distdir
+ $(am__post_remove_distdir)
+
+ dist-tarZ: distdir
+- @echo WARNING: "Support for shar distribution archives is" \
+- "deprecated." >&2
++ @echo WARNING: "Support for distribution archives compressed with" \
++ "legacy program 'compress' is deprecated." >&2
+ @echo WARNING: "It will be removed altogether in Automake 2.0" >&2
+ tardir=$(distdir) && $(am__tar) | compress -c >$(distdir).tar.Z
+ $(am__post_remove_distdir)
+
+ dist-shar: distdir
+- @echo WARNING: "Support for distribution archives compressed with" \
+- "legacy program 'compress' is deprecated." >&2
++ @echo WARNING: "Support for shar distribution archives is" \
++ "deprecated." >&2
+ @echo WARNING: "It will be removed altogether in Automake 2.0" >&2
+ shar $(distdir) | GZIP=$(GZIP_ENV) gzip -c >$(distdir).shar.gz
+ $(am__post_remove_distdir)
+@@ -754,17 +762,17 @@ distcheck: dist
+ esac
+ chmod -R a-w $(distdir)
+ chmod u+w $(distdir)
+- mkdir $(distdir)/_build $(distdir)/_inst
++ mkdir $(distdir)/_build $(distdir)/_build/sub $(distdir)/_inst
+ chmod a-w $(distdir)
+ test -d $(distdir)/_build || exit 0; \
+ dc_install_base=`$(am__cd) $(distdir)/_inst && pwd | sed -e 's,^[^:\\/]:[\\/],/,'` \
+ && dc_destdir="$${TMPDIR-/tmp}/am-dc-$$$$/" \
+ && am__cwd=`pwd` \
+- && $(am__cd) $(distdir)/_build \
+- && ../configure \
++ && $(am__cd) $(distdir)/_build/sub \
++ && ../../configure \
+ $(AM_DISTCHECK_CONFIGURE_FLAGS) \
+ $(DISTCHECK_CONFIGURE_FLAGS) \
+- --srcdir=.. --prefix="$$dc_install_base" \
++ --srcdir=../.. --prefix="$$dc_install_base" \
+ && $(MAKE) $(AM_MAKEFLAGS) \
+ && $(MAKE) $(AM_MAKEFLAGS) dvi \
+ && $(MAKE) $(AM_MAKEFLAGS) check \
+@@ -944,10 +952,12 @@ uninstall-am:
+ mostlyclean-generic mostlyclean-libtool pdf pdf-am ps ps-am \
+ tags tags-am uninstall uninstall-am
+
++.PRECIOUS: Makefile
++
install-exec-hook:
$(mkinstalldirs) $(DESTDIR)$(localstatedir)/run
diff --git a/sysutils/collectd/patches/patch-configure b/sysutils/collectd/patches/patch-configure
index 89a8582ff81..3c184fb74c2 100644
--- a/sysutils/collectd/patches/patch-configure
+++ b/sysutils/collectd/patches/patch-configure
@@ -1,4 +1,4 @@
-$NetBSD: patch-configure,v 1.5 2015/08/14 15:39:28 he Exp $
+$NetBSD: patch-configure,v 1.6 2015/08/18 07:47:46 he Exp $
Regen from configure.ac.
@@ -147,13 +147,14 @@ Regen from configure.ac.
ac_fn_c_check_member "$LINENO" "struct udphdr" "uh_dport" "ac_cv_member_struct_udphdr_uh_dport" "#define _BSD_SOURCE
#define _DEFAULT_SOURCE
#if HAVE_STDINT_H
-@@ -27648,6 +27725,13 @@ then
+@@ -27648,6 +27725,14 @@ then
plugin_tcpconns="yes"
fi
+if test "x$ac_system" = "xNetBSD"
+then
+ plugin_entropy="yes"
++ plugin_irq="yes"
+ plugin_processes="yes"
+ plugin_disk="yes"
+fi
@@ -161,7 +162,7 @@ Regen from configure.ac.
# Mac OS X devices
if test "x$with_libiokit" = "xyes"
then
-@@ -27890,6 +27974,11 @@ then
+@@ -27890,6 +27975,11 @@ then
plugin_swap="yes"
fi
diff --git a/sysutils/collectd/patches/patch-configure.ac b/sysutils/collectd/patches/patch-configure.ac
index 3337912fc5d..19dd6ec0133 100644
--- a/sysutils/collectd/patches/patch-configure.ac
+++ b/sysutils/collectd/patches/patch-configure.ac
@@ -1,4 +1,4 @@
-$NetBSD: patch-configure.ac,v 1.3 2015/08/14 15:39:28 he Exp $
+$NetBSD: patch-configure.ac,v 1.4 2015/08/18 07:47:46 he Exp $
Add KERNEL_NETBSD, add entry and disk plugins for NetBSD,
and also do swap for "have_swapctl_three_args" (as for NetBSD).
@@ -58,13 +58,14 @@ Also, the start of process support, but that's not yet finished.
AC_CHECK_MEMBERS([struct udphdr.uh_dport, struct udphdr.uh_sport], [], [],
[#define _BSD_SOURCE
#define _DEFAULT_SOURCE
-@@ -5244,6 +5275,13 @@ then
+@@ -5244,6 +5275,14 @@ then
plugin_tcpconns="yes"
fi
+if test "x$ac_system" = "xNetBSD"
+then
+ plugin_entropy="yes"
++ plugin_irq="yes"
+ plugin_processes="yes"
+ plugin_disk="yes"
+fi
@@ -72,7 +73,7 @@ Also, the start of process support, but that's not yet finished.
# Mac OS X devices
if test "x$with_libiokit" = "xyes"
then
-@@ -5482,6 +5520,11 @@ then
+@@ -5482,6 +5521,11 @@ then
plugin_swap="yes"
fi
diff --git a/sysutils/collectd/patches/patch-src_Makefile.am b/sysutils/collectd/patches/patch-src_Makefile.am
new file mode 100644
index 00000000000..cdd27c9fa37
--- /dev/null
+++ b/sysutils/collectd/patches/patch-src_Makefile.am
@@ -0,0 +1,48 @@
+$NetBSD: patch-src_Makefile.am,v 1.1 2015/08/18 07:47:46 he Exp $
+
+Install config file in example directory.
+
+--- src/Makefile.am.orig 2015-05-26 19:38:14.000000000 +0000
++++ src/Makefile.am
+@@ -14,13 +14,15 @@ AM_CPPFLAGS = -I$(srcdir)/daemon
+ AM_CPPFLAGS += -DPREFIX='"${prefix}"'
+ AM_CPPFLAGS += -DCONFIGFILE='"${sysconfdir}/${PACKAGE_NAME}.conf"'
+ AM_CPPFLAGS += -DLOCALSTATEDIR='"${localstatedir}"'
+-AM_CPPFLAGS += -DPKGLOCALSTATEDIR='"${localstatedir}/lib/${PACKAGE_NAME}"'
++AM_CPPFLAGS += -DPKGLOCALSTATEDIR='"${localstatedir}/db/${PACKAGE_NAME}"'
+ if BUILD_FEATURE_DAEMON
+ AM_CPPFLAGS += -DPIDFILE='"${localstatedir}/run/${PACKAGE_NAME}.pid"'
+ endif
+ AM_CPPFLAGS += -DPLUGINDIR='"${pkglibdir}"'
+ AM_CPPFLAGS += -DPKGDATADIR='"${pkgdatadir}"'
+
++egdir = @exec_prefix@/share/examples/@PACKAGE@
++
+ AUTOMAKE_OPTIONS = subdir-objects
+
+ noinst_LTLIBRARIES = libmount.la liblookup.la
+@@ -1363,13 +1365,8 @@ riemann.pb-c.c riemann.pb-c.h: riemann.p
+ endif
+
+ install-exec-hook:
+- $(mkinstalldirs) $(DESTDIR)$(sysconfdir)
+- if test -e $(DESTDIR)$(sysconfdir)/collectd.conf; \
+- then \
+- $(INSTALL) -m 0640 collectd.conf $(DESTDIR)$(sysconfdir)/collectd.conf.pkg-orig; \
+- else \
+- $(INSTALL) -m 0640 collectd.conf $(DESTDIR)$(sysconfdir)/collectd.conf; \
+- fi; \
++ $(mkinstalldirs) $(DESTDIR)$(egdir)
++ $(INSTALL) -m 0640 collectd.conf $(DESTDIR)$(egdir)/collectd.conf
+ $(mkinstalldirs) $(DESTDIR)$(pkgdatadir)
+ $(INSTALL) -m 0644 $(srcdir)/types.db $(DESTDIR)$(pkgdatadir)/types.db;
+ $(INSTALL) -m 0644 $(srcdir)/postgresql_default.conf \
+@@ -1377,7 +1374,7 @@ install-exec-hook:
+
+ uninstall-hook:
+ rm -f $(DESTDIR)$(pkgdatadir)/types.db;
+- rm -f $(DESTDIR)$(sysconfdir)/collectd.conf
++ rm -f $(DESTDIR)$(egdir)/collectd.conf
+ rm -f $(DESTDIR)$(pkgdatadir)/postgresql_default.conf;
+
+ check_PROGRAMS = test_utils_mount test_utils_vl_lookup
diff --git a/sysutils/collectd/patches/patch-src_Makefile.in b/sysutils/collectd/patches/patch-src_Makefile.in
index 2cc95f0414c..dc3c20d4684 100644
--- a/sysutils/collectd/patches/patch-src_Makefile.in
+++ b/sysutils/collectd/patches/patch-src_Makefile.in
@@ -1,18 +1,77 @@
-$NetBSD: patch-src_Makefile.in,v 1.2 2015/06/10 20:05:26 fhajny Exp $
+$NetBSD: patch-src_Makefile.in,v 1.3 2015/08/18 07:47:46 he Exp $
Use a reasonable db dir.
Install config file into examples.
+
--- src/Makefile.in.orig 2015-05-27 07:51:49.001922959 +0000
+++ src/Makefile.in
-@@ -2424,6 +2424,7 @@ srcdir = @srcdir@
- subdirs = @subdirs@
- sys_symbol_underscore = @sys_symbol_underscore@
- sysconfdir = @sysconfdir@
-+egdir = @exec_prefix@/share/examples/@PACKAGE@
- target_alias = @target_alias@
- top_build_prefix = @top_build_prefix@
- top_builddir = @top_builddir@
-@@ -2434,7 +2435,7 @@ PLUGIN_LDFLAGS = -module -avoid-version
+@@ -1,7 +1,7 @@
+-# Makefile.in generated by automake 1.14.1 from Makefile.am.
++# Makefile.in generated by automake 1.15 from Makefile.am.
+ # @configure_input@
+
+-# Copyright (C) 1994-2013 Free Software Foundation, Inc.
++# Copyright (C) 1994-2014 Free Software Foundation, Inc.
+
+ # This Makefile.in is free software; the Free Software Foundation
+ # gives unlimited permission to copy and/or distribute it,
+@@ -16,7 +16,17 @@
+
+
+ VPATH = @srcdir@
+-am__is_gnu_make = test -n '$(MAKEFILE_LIST)' && test -n '$(MAKELEVEL)'
++am__is_gnu_make = { \
++ if test -z '$(MAKELEVEL)'; then \
++ false; \
++ elif test -n '$(MAKE_HOST)'; then \
++ true; \
++ elif test -n '$(MAKE_VERSION)' && test -n '$(CURDIR)'; then \
++ true; \
++ else \
++ false; \
++ fi; \
++}
+ am__make_running_with_option = \
+ case $${target_option-} in \
+ ?) ;; \
+@@ -303,14 +313,11 @@ check_PROGRAMS = test_utils_mount$(EXEEX
+ test_utils_vl_lookup$(EXEEXT)
+ TESTS = test_utils_mount$(EXEEXT) test_utils_vl_lookup$(EXEEXT)
+ subdir = src
+-DIST_COMMON = $(srcdir)/Makefile.in $(srcdir)/Makefile.am \
+- $(srcdir)/config.h.in $(srcdir)/collectd.conf.in \
+- $(top_srcdir)/libltdl/config/depcomp $(dist_man_MANS) \
+- $(top_srcdir)/libltdl/config/test-driver
+ ACLOCAL_M4 = $(top_srcdir)/aclocal.m4
+ am__aclocal_m4_deps = $(top_srcdir)/configure.ac
+ am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \
+ $(ACLOCAL_M4)
++DIST_COMMON = $(srcdir)/Makefile.am $(am__DIST_COMMON)
+ mkinstalldirs = $(install_sh) -d
+ CONFIG_HEADER = config.h
+ CONFIG_CLEAN_FILES = collectd.conf
+@@ -2132,6 +2139,10 @@ TEST_LOG_DRIVER = $(SHELL) $(top_srcdir)
+ TEST_LOG_COMPILE = $(TEST_LOG_COMPILER) $(AM_TEST_LOG_FLAGS) \
+ $(TEST_LOG_FLAGS)
+ DIST_SUBDIRS = libcollectdclient liboconfig daemon
++am__DIST_COMMON = $(dist_man_MANS) $(srcdir)/Makefile.in \
++ $(srcdir)/collectd.conf.in $(srcdir)/config.h.in \
++ $(top_srcdir)/libltdl/config/depcomp \
++ $(top_srcdir)/libltdl/config/test-driver
+ DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST)
+ am__relativize = \
+ dir0=`pwd`; \
+@@ -2310,9 +2321,6 @@ LIBADD_DL = @LIBADD_DL@
+ LIBADD_DLD_LINK = @LIBADD_DLD_LINK@
+ LIBADD_DLOPEN = @LIBADD_DLOPEN@
+ LIBADD_SHL_LOAD = @LIBADD_SHL_LOAD@
+-LIBGCRYPT_CFLAGS = @LIBGCRYPT_CFLAGS@
+-LIBGCRYPT_CONFIG = @LIBGCRYPT_CONFIG@
+-LIBGCRYPT_LIBS = @LIBGCRYPT_LIBS@
+ LIBLTDL = @LIBLTDL@
+ LIBNETAPP_CPPFLAGS = @LIBNETAPP_CPPFLAGS@
+ LIBNETAPP_LDFLAGS = @LIBNETAPP_LDFLAGS@
+@@ -2434,9 +2442,10 @@ PLUGIN_LDFLAGS = -module -avoid-version
AM_CPPFLAGS = -I$(srcdir)/daemon -DPREFIX='"${prefix}"' \
-DCONFIGFILE='"${sysconfdir}/${PACKAGE_NAME}.conf"' \
-DLOCALSTATEDIR='"${localstatedir}"' \
@@ -20,8 +79,37 @@ Install config file into examples.
+ -DPKGLOCALSTATEDIR='"${localstatedir}/db/${PACKAGE_NAME}"' \
$(am__append_2) -DPLUGINDIR='"${pkglibdir}"' \
-DPKGDATADIR='"${pkgdatadir}"'
++egdir = @exec_prefix@/share/examples/@PACKAGE@
AUTOMAKE_OPTIONS = subdir-objects
-@@ -5190,13 +5191,8 @@ uninstall-man: uninstall-man1 uninstall-
+ noinst_LTLIBRARIES = libmount.la liblookup.la
+ libmount_la_SOURCES = utils_mount.c utils_mount.h
+@@ -3108,7 +3117,6 @@ $(srcdir)/Makefile.in: $(srcdir)/Makefi
+ echo ' cd $(top_srcdir) && $(AUTOMAKE) --foreign src/Makefile'; \
+ $(am__cd) $(top_srcdir) && \
+ $(AUTOMAKE) --foreign src/Makefile
+-.PRECIOUS: Makefile
+ Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status
+ @case '$?' in \
+ *config.status*) \
+@@ -4821,7 +4829,7 @@ $(TEST_SUITE_LOG): $(TEST_LOGS)
+ if test -n "$$am__remaking_logs"; then \
+ echo "fatal: making $(TEST_SUITE_LOG): possible infinite" \
+ "recursion detected" >&2; \
+- else \
++ elif test -n "$$redo_logs"; then \
+ am__remaking_logs=yes $(MAKE) $(AM_MAKEFLAGS) $$redo_logs; \
+ fi; \
+ if $(am__make_dryrun); then :; else \
+@@ -5166,6 +5174,8 @@ uninstall-man: uninstall-man1 uninstall-
+ uninstall-man1 uninstall-man5 uninstall-pkglibLTLIBRARIES \
+ uninstall-sbinPROGRAMS
+
++.PRECIOUS: Makefile
++
+
+ .pod.1:
+ pod2man --release=$(VERSION) --center=$(PACKAGE) $< \
+@@ -5190,13 +5200,8 @@ uninstall-man: uninstall-man1 uninstall-
@HAVE_PROTOC_C_TRUE@ protoc-c -I$(srcdir) --c_out . $(srcdir)/riemann.proto
install-exec-hook:
@@ -33,11 +121,11 @@ Install config file into examples.
- $(INSTALL) -m 0640 collectd.conf $(DESTDIR)$(sysconfdir)/collectd.conf; \
- fi; \
+ $(mkinstalldirs) $(DESTDIR)$(egdir)
-+ $(INSTALL) -m 0640 collectd.conf $(DESTDIR)$(egdir)/collectd.conf; \
++ $(INSTALL) -m 0640 collectd.conf $(DESTDIR)$(egdir)/collectd.conf
$(mkinstalldirs) $(DESTDIR)$(pkgdatadir)
$(INSTALL) -m 0644 $(srcdir)/types.db $(DESTDIR)$(pkgdatadir)/types.db;
$(INSTALL) -m 0644 $(srcdir)/postgresql_default.conf \
-@@ -5204,7 +5200,7 @@ install-exec-hook:
+@@ -5204,7 +5209,7 @@ install-exec-hook:
uninstall-hook:
rm -f $(DESTDIR)$(pkgdatadir)/types.db;
diff --git a/sysutils/collectd/patches/patch-src_df.c b/sysutils/collectd/patches/patch-src_df.c
index 0d57ad7f3b1..781ed4225ac 100644
--- a/sysutils/collectd/patches/patch-src_df.c
+++ b/sysutils/collectd/patches/patch-src_df.c
@@ -1,15 +1,19 @@
-$NetBSD: patch-src_df.c,v 1.2 2015/08/16 08:39:02 he Exp $
+$NetBSD: patch-src_df.c,v 1.3 2015/08/18 07:47:46 he Exp $
-NetBSD doesn't have float_t.
+Older NetBSD doesn't have float_t.
---- src/df.c.orig 2014-01-26 08:09:14.856391886 +0000
+--- src/df.c.orig 2015-03-10 14:14:45.000000000 +0000
+++ src/df.c
-@@ -28,6 +28,10 @@
+@@ -28,6 +28,14 @@
#include "utils_mount.h"
#include "utils_ignorelist.h"
+#if defined(__NetBSD__)
++#include <sys/param.h>
+#include <math.h>
++#if __NetBSD_VERSION__ < 699001900
++typedef float float_t;
++#endif
+#endif
+
#if HAVE_STATVFS
diff --git a/sysutils/collectd/patches/patch-src_entropy.c b/sysutils/collectd/patches/patch-src_entropy.c
index de734e7b9a2..9039422231a 100644
--- a/sysutils/collectd/patches/patch-src_entropy.c
+++ b/sysutils/collectd/patches/patch-src_entropy.c
@@ -1,15 +1,15 @@
-$NetBSD: patch-src_entropy.c,v 1.2 2015/08/14 12:59:04 he Exp $
+$NetBSD: patch-src_entropy.c,v 1.3 2015/08/18 07:47:46 he Exp $
Provide a NetBSD implementation for graphing available entropy.
--- src/entropy.c.orig 2015-03-10 14:14:45.000000000 +0000
+++ src/entropy.c
-@@ -29,27 +29,46 @@
+@@ -29,27 +29,47 @@
#include "plugin.h"
#if !KERNEL_LINUX
-# error "No applicable input method."
-+# if defined(__NetBSD__)
++# if KERNEL_NETBSD
+/* Provide a NetBSD implementation, partial from rndctl.c */
+
+#include <sys/types.h>
@@ -19,6 +19,7 @@ Provide a NetBSD implementation for graphing available entropy.
+#if HAVE_SYS_RNDIO_H
+# include <sys/rndio.h>
#endif
++#include <paths.h>
-#define ENTROPY_FILE "/proc/sys/kernel/random/entropy_avail"
+static void entropy_submit (double);
@@ -34,7 +35,7 @@ Provide a NetBSD implementation for graphing available entropy.
+ int fd;
- values[0].gauge = entropy;
-+ fd = open("/dev/urandom", O_RDONLY, 0644);
++ fd = open(_PATH_URANDOM, O_RDONLY, 0644);
+ if (fd < 0)
+ return -1;
@@ -53,7 +54,7 @@ Provide a NetBSD implementation for graphing available entropy.
+ return 0;
}
-+# else /* not NetBSD */
++# else /* KERNEL_NETBSD */
+# error "No applicable input method."
+# endif
+#else /* Linux */
@@ -63,7 +64,7 @@ Provide a NetBSD implementation for graphing available entropy.
static int entropy_read (void)
{
double entropy;
-@@ -74,6 +93,23 @@ static int entropy_read (void)
+@@ -74,6 +94,23 @@ static int entropy_read (void)
return (0);
}
diff --git a/sysutils/collectd/patches/patch-src_irq.c b/sysutils/collectd/patches/patch-src_irq.c
new file mode 100644
index 00000000000..6ae89ea4cfa
--- /dev/null
+++ b/sysutils/collectd/patches/patch-src_irq.c
@@ -0,0 +1,102 @@
+$NetBSD: patch-src_irq.c,v 1.1 2015/08/18 07:47:46 he Exp $
+
+Provide a port to NetBSD.
+
+--- src/irq.c.orig 2014-09-05 08:57:01.000000000 +0000
++++ src/irq.c
+@@ -27,10 +27,22 @@
+ #include "configfile.h"
+ #include "utils_ignorelist.h"
+
+-#if !KERNEL_LINUX
++#if !KERNEL_LINUX && !KERNEL_NETBSD
+ # error "No applicable input method."
+ #endif
+
++#if KERNEL_NETBSD
++
++#include <sys/param.h>
++#include <sys/types.h>
++#include <sys/sysctl.h>
++#include <sys/evcnt.h>
++#include <malloc.h>
++
++#endif /* KERNEL_NETBSD */
++
++
++
+ /*
+ * (Module-)Global variables
+ */
+@@ -90,6 +102,7 @@ static void irq_submit (const char *irq_
+ plugin_dispatch_values (&vl);
+ } /* void irq_submit */
+
++#if KERNEL_LINUX
+ static int irq_read (void)
+ {
+ FILE *fh;
+@@ -183,6 +196,63 @@ static int irq_read (void)
+
+ return (0);
+ } /* int irq_read */
++#endif /* KERNEL_LINUX */
++
++#if KERNEL_NETBSD
++static int
++irq_read (void)
++{
++ const int mib[4] = {
++ CTL_KERN,
++ KERN_EVCNT,
++ EVCNT_TYPE_INTR,
++ KERN_EVCNT_COUNT_NONZERO
++ };
++ size_t buflen = 0;
++ void *buf = NULL;
++ const struct evcnt_sysctl *evs, *last_evs;
++
++ for (;;) {
++ size_t newlen;
++ int error;
++
++ if (buflen)
++ buf = malloc(buflen);
++ error = sysctl(mib, __arraycount(mib),
++ buf, &newlen, NULL, 0);
++ if (error) {
++ ERROR("irq plugin: failed to get event count");
++ return -1;
++ }
++ if (newlen <= buflen) {
++ buflen = newlen;
++ break;
++ }
++ if (buf)
++ free(buf);
++ buflen = newlen;
++ }
++ evs = buf;
++ last_evs = (void*)((char *)buf + buflen);
++ buflen /= sizeof(uint64_t);
++ while(evs < last_evs
++ && buflen > sizeof(*evs) / sizeof(uint64_t)
++ && buflen >= evs->ev_len)
++ {
++ char irqname[80];
++
++ snprintf(irqname, 80, "%s-%s", evs->ev_strings,
++ evs->ev_strings + evs->ev_grouplen + 1);
++
++ irq_submit(irqname, evs->ev_count);
++
++ buflen -= evs->ev_len;
++ evs =(const void*)((const uint64_t *)evs + evs->ev_len);
++ }
++
++ return 0;
++}
++#endif /* KERNEL_NETBSD */
+
+ void module_register (void)
+ {