summaryrefslogtreecommitdiff
path: root/sysutils
diff options
context:
space:
mode:
authorhe <he>2015-08-14 12:59:04 +0000
committerhe <he>2015-08-14 12:59:04 +0000
commit6de35bd02c3f355836aabedf0aa2403d7ff49291 (patch)
tree5f205d1b16e95da84119366cf41f6f61f006737d /sysutils
parentc7221981e0afdf88d7357ec076a4ed5971380acc (diff)
downloadpkgsrc-6de35bd02c3f355836aabedf0aa2403d7ff49291.tar.gz
Include sys/rndio.h if it's available to be able to compile the entropy
plugin on newer NetBSD releases (>= 7.99.9, by the looks of it). No PKGREVISION bump since this is a configure+build fix.
Diffstat (limited to 'sysutils')
-rw-r--r--sysutils/collectd/distinfo10
-rw-r--r--sysutils/collectd/patches/patch-configure38
-rw-r--r--sysutils/collectd/patches/patch-configure.ac27
-rw-r--r--sysutils/collectd/patches/patch-src_config.h.in14
-rw-r--r--sysutils/collectd/patches/patch-src_entropy.c18
5 files changed, 84 insertions, 23 deletions
diff --git a/sysutils/collectd/distinfo b/sysutils/collectd/distinfo
index 481f8f9a60b..9047934e239 100644
--- a/sysutils/collectd/distinfo
+++ b/sysutils/collectd/distinfo
@@ -1,18 +1,18 @@
-$NetBSD: distinfo,v 1.10 2015/08/11 14:15:00 he Exp $
+$NetBSD: distinfo,v 1.11 2015/08/14 12:59:04 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) = d39d93002cd7b453122364824784c6b8c177724a
-SHA1 (patch-configure.ac) = 5a9224941ccf0091108346d01714641da79f3f49
+SHA1 (patch-configure) = ca8949de66bd19c4d398223d182e9fbecdcf861a
+SHA1 (patch-configure.ac) = 48c0eedbd3de5e09a5593670017aff661744c7bc
SHA1 (patch-src_Makefile.in) = f94d046ee323fdb9251ad49cf383b3a61df5dcaa
SHA1 (patch-src_collectd-tg.c) = f9f41dfb0b1b55a62202128a165d5c9943faf5bc
SHA1 (patch-src_collectd.conf.in) = f0b35085cf0ddfd766e140b145177ab1f1326f5f
-SHA1 (patch-src_config.h.in) = 08765b041f4764873b4055140d85c4478faeba49
+SHA1 (patch-src_config.h.in) = 911a0441e15e0a85bb4819f1b49eaddbdd5c9d1c
SHA1 (patch-src_df.c) = 19cca888b183a90759b359702e4d65c8afa6e58d
SHA1 (patch-src_disk.c) = 159862e8ca1e841e3c4013c03ba03f059fdbbab5
-SHA1 (patch-src_entropy.c) = 51551cb758115e5fd7f099e787cfa7758a5f1ea9
+SHA1 (patch-src_entropy.c) = d9bfa1bd4d045f2218105eaadf2dda90b7fc4646
SHA1 (patch-src_libcollectclient_network__buffer.c) = e07d403d299613fa0885a0e7285849eb85510253
SHA1 (patch-src_memory.c) = 7bbf24481e2ad6bb8b11a5e6bddd8145e1b2a6ef
SHA1 (patch-src_swap.c) = e7602eb83eed6b90752b8293b9666b94bdd42493
diff --git a/sysutils/collectd/patches/patch-configure b/sysutils/collectd/patches/patch-configure
index 9f1251ff286..1805d3ac3ed 100644
--- a/sysutils/collectd/patches/patch-configure
+++ b/sysutils/collectd/patches/patch-configure
@@ -1,4 +1,4 @@
-$NetBSD: patch-configure,v 1.3 2015/08/11 13:19:21 he Exp $
+$NetBSD: patch-configure,v 1.4 2015/08/14 12:59:04 he Exp $
Regen from configure.ac.
@@ -62,7 +62,37 @@ Regen from configure.ac.
*aix*)
$as_echo "#define KERNEL_AIX 1" >>confdefs.h
-@@ -19171,6 +19177,54 @@ else
+@@ -15876,6 +15882,29 @@ fi
+ done
+
+
++# For entropy plugin on newer NetBSD
++for ac_header in sys/rndio.h
++do :
++ ac_fn_c_check_header_compile "$LINENO" "sys/rndio.h" "ac_cv_header_sys_rndio_h" "#if HAVE_SYS_TYPES_H
++# include <sys/types.h>
++#endif
++#if HAVE_SYS_IOCTL_H
++# include <sys/ioctl.h>
++#endif
++#if HAVE_SYS_PARAM_H
++# include <sys/param.h>
++#endif
++
++"
++if test "x$ac_cv_header_sys_rndio_h" = xyes; then :
++ cat >>confdefs.h <<_ACEOF
++#define HAVE_SYS_RNDIO_H 1
++_ACEOF
++
++fi
++
++done
++
+ # For ping library
+ for ac_header in netinet/in_systm.h
+ do :
+@@ -19171,6 +19200,54 @@ else
fi
@@ -117,7 +147,7 @@ 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 +27702,12 @@ then
+@@ -27648,6 +27725,12 @@ then
plugin_tcpconns="yes"
fi
@@ -130,7 +160,7 @@ Regen from configure.ac.
# Mac OS X devices
if test "x$with_libiokit" = "xyes"
then
-@@ -27890,6 +27950,11 @@ then
+@@ -27890,6 +27973,11 @@ then
plugin_swap="yes"
fi
diff --git a/sysutils/collectd/patches/patch-configure.ac b/sysutils/collectd/patches/patch-configure.ac
index 0f3530d542b..e026c5cc727 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.1 2015/08/11 13:19:21 he Exp $
+$NetBSD: patch-configure.ac,v 1.2 2015/08/14 12:59:04 he Exp $
Add KERNEL_NETBSD, add entry and disk plugins for NetBSD,
and also do swap for "have_swapctl_three_args" (as for NetBSD).
@@ -17,7 +17,26 @@ Also, the start of process support, but that's not yet finished.
*aix*)
AC_DEFINE([KERNEL_AIX], 1, [True if program is to be compiled for a AIX kernel])
ac_system="AIX"
-@@ -1363,6 +1367,21 @@ AC_CHECK_MEMBERS([struct kinfo_proc.p_pi
+@@ -151,6 +155,18 @@ AC_HEADER_STDBOOL
+
+ AC_CHECK_HEADERS(stdio.h errno.h math.h stdarg.h syslog.h fcntl.h signal.h assert.h sys/types.h sys/socket.h sys/select.h poll.h netdb.h arpa/inet.h sys/resource.h sys/param.h kstat.h regex.h sys/ioctl.h endian.h sys/isa_defs.h fnmatch.h libgen.h)
+
++# For entropy plugin on newer NetBSD
++AC_CHECK_HEADERS(sys/rndio.h, [], [],
++[#if HAVE_SYS_TYPES_H
++# include <sys/types.h>
++#endif
++#if HAVE_SYS_IOCTL_H
++# include <sys/ioctl.h>
++#endif
++#if HAVE_SYS_PARAM_H
++# include <sys/param.h>
++#endif
++])
+ # For ping library
+ AC_CHECK_HEADERS(netinet/in_systm.h, [], [],
+ [#if HAVE_STDINT_H
+@@ -1363,6 +1379,21 @@ AC_CHECK_MEMBERS([struct kinfo_proc.p_pi
#include <kvm.h>
])
@@ -39,7 +58,7 @@ 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 +5263,12 @@ then
+@@ -5244,6 +5275,12 @@ then
plugin_tcpconns="yes"
fi
@@ -52,7 +71,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 +5507,11 @@ then
+@@ -5482,6 +5519,11 @@ then
plugin_swap="yes"
fi
diff --git a/sysutils/collectd/patches/patch-src_config.h.in b/sysutils/collectd/patches/patch-src_config.h.in
index fe66e230f30..a4a01c1710b 100644
--- a/sysutils/collectd/patches/patch-src_config.h.in
+++ b/sysutils/collectd/patches/patch-src_config.h.in
@@ -1,4 +1,4 @@
-$NetBSD: patch-src_config.h.in,v 1.1 2015/08/11 13:19:21 he Exp $
+$NetBSD: patch-src_config.h.in,v 1.2 2015/08/14 12:59:04 he Exp $
Optionally define a few vars for NetBSD.
@@ -27,7 +27,17 @@ Optionally define a few vars for NetBSD.
/* Define if struct kinfo_proc exists in the OpenBSD variant. */
#undef HAVE_STRUCT_KINFO_PROC_OPENBSD
-@@ -1507,6 +1516,9 @@
+@@ -1375,6 +1384,9 @@
+ /* Define to 1 if you have the <sys/resource.h> header file. */
+ #undef HAVE_SYS_RESOURCE_H
+
++/* Define to 1 if you have the <sys/rndio.h> header file. */
++#undef HAVE_SYS_RNDIO_H
++
+ /* Define to 1 if you have the <sys/select.h> header file. */
+ #undef HAVE_SYS_SELECT_H
+
+@@ -1507,6 +1519,9 @@
/* True if program is to be compiled for a Linux kernel */
#undef KERNEL_LINUX
diff --git a/sysutils/collectd/patches/patch-src_entropy.c b/sysutils/collectd/patches/patch-src_entropy.c
index 7512fa21fd0..de734e7b9a2 100644
--- a/sysutils/collectd/patches/patch-src_entropy.c
+++ b/sysutils/collectd/patches/patch-src_entropy.c
@@ -1,28 +1,30 @@
-$NetBSD: patch-src_entropy.c,v 1.1 2015/08/11 13:19:21 he Exp $
+$NetBSD: patch-src_entropy.c,v 1.2 2015/08/14 12:59:04 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,43 @@
+@@ -29,27 +29,46 @@
#include "plugin.h"
#if !KERNEL_LINUX
-# error "No applicable input method."
--#endif
+# if defined(__NetBSD__)
+/* Provide a NetBSD implementation, partial from rndctl.c */
-
--#define ENTROPY_FILE "/proc/sys/kernel/random/entropy_avail"
++
+#include <sys/types.h>
+#include <sys/ioctl.h>
+#include <sys/param.h>
+#include <sys/rnd.h>
++#if HAVE_SYS_RNDIO_H
++# include <sys/rndio.h>
+ #endif
--static void entropy_submit (double entropy)
+-#define ENTROPY_FILE "/proc/sys/kernel/random/entropy_avail"
+static void entropy_submit (double);
+static int entropy_read (void);
-+
+
+-static void entropy_submit (double entropy)
+static int
+entropy_read (void)
{
@@ -61,7 +63,7 @@ Provide a NetBSD implementation for graphing available entropy.
static int entropy_read (void)
{
double entropy;
-@@ -74,6 +90,23 @@ static int entropy_read (void)
+@@ -74,6 +93,23 @@ static int entropy_read (void)
return (0);
}