Update libstatgrab to 0.16.

Pkgsrc changes:
 * try to fix build failure on recent NetBSD, reported in PR 41178.
 * set LICENSE=gnu-gpl-v2
 * marked as DESTDIR ready

libstatgrab NEWS:

libstatgrab 0.16 (13 March 2008)
 * Fix saidar build on Solaris with Sun's compiler.
 * Add support for FreeBSD 8.0.
 * Fix build on "armel" Debian port.
     (Thanks to Riku Voipio and Martin Guy)
 * Fix statgrab-make-mrtg-config on machines with no swap.
     (Thanks to Tom Carlson)

libstatgrab 0.15 (14 July 2007)
 * Fix breakages in memory stats on OpenBSD that were introduced in
   the last release.
     (Thanks to David Love)
 * Update internal string functions and some related cleanups.
     (Thanks to David Love)
 * Fix compile warning on FreeBSD.

libstatgrab 0.14 (08 January 2007)
 * Fix memory stats on OpenBSD.
 * Add colour support to saidar.
     (Thanks to Angelina Carlton)
 * Fix CPU stats on Solaris - swap and iowait were incorrectly reported.
 * Fix kstat related memory leaks on Solaris.
     (Thanks to Javier Donaire)
 * Fix network stats on some unusual Solaris setups.
 * Fix process time_spent on Linux.
     (Thanks to Fred Barnes)
 * Make interface up status check the link status as well.
     (Thanks to Michelangelo Vassallo)
 * Fix build on NetBSD 3.
     (Thanks to Wijnand Wiersma)
 * Rework curses detection code in the configure script.
 * Fix bug that caused saidar to crash when the window was rapidly resized.

libstatgrab 0.13 (19 March 2006)
 * Fix build problems with recent linux kernels.
 * Make saidar truncate disk/inteface/mount names to fit in display.
 * Add WIN32 support using MINGW (not widely tested).
 * Fix network interface up/down status on Solaris.
 * Add extern "C" to header file to make linking with C++ code easier.
 * Fix statgrab to cope with filesystem paths containing dots.
 * Make NFS a legal filesystem type on all platforms.
 * A few minor build fixes.
This commit is contained in:
obache 2009-05-16 11:46:08 +00:00
parent b461ebc55c
commit 0277f5899b
14 changed files with 263 additions and 34 deletions

View file

@ -1,16 +1,21 @@
# $NetBSD: Makefile,v 1.15 2008/04/09 16:18:39 jlam Exp $
# $NetBSD: Makefile,v 1.16 2009/05/16 11:46:08 obache Exp $
DISTNAME= libstatgrab-0.12
PKGREVISION= 3
DISTNAME= libstatgrab-0.16
CATEGORIES= devel
MASTER_SITES= ftp://ftp.uk.i-scream.org/pub/i-scream/libstatgrab/ \
ftp://ftp.i-scream.org/pub/i-scream/libstatgrab/ \
http://ftp.i-scream.org/pub/i-scream/libstatgrab/
http://ftp.i-scream.org/pub/i-scream/libstatgrab/ \
http://ftp.uk.i-scream.org/pub/i-scream/libstatgrab/ \
http://dl.ambiweb.de/mirrors/ftp.i-scream.org/libstatgrab/
MAINTAINER= pkgsrc-users@NetBSD.org
HOMEPAGE= http://www.i-scream.org/libstatgrab/
COMMENT= Provides a useful interface to system statistics
PKG_DESTDIR_SUPPORT= user-destdir
LICENSE= gnu-gpl-v2
.include "options.mk"
USE_TOOLS+= pkg-config perl:run

View file

@ -1,4 +1,4 @@
@comment $NetBSD: PLIST,v 1.5 2008/04/09 16:18:39 jlam Exp $
@comment $NetBSD: PLIST,v 1.6 2009/05/16 11:46:09 obache Exp $
${PLIST.saidar}bin/saidar
${PLIST.statgrab}bin/statgrab
${PLIST.statgrab}bin/statgrab-make-mrtg-config
@ -7,10 +7,10 @@ include/statgrab.h
include/statgrab_deprecated.h
lib/libstatgrab.la
lib/pkgconfig/libstatgrab.pc
man/man1/saidar.1
man/man1/statgrab-make-mrtg-config.1
man/man1/statgrab-make-mrtg-index.1
man/man1/statgrab.1
${PLIST.saidar}man/man1/saidar.1
${PLIST.statgrab}man/man1/statgrab-make-mrtg-config.1
${PLIST.statgrab}man/man1/statgrab-make-mrtg-index.1
${PLIST.statgrab}man/man1/statgrab.1
man/man3/sg_get_cpu_percents.3
man/man3/sg_get_cpu_stats.3
man/man3/sg_get_cpu_stats_diff.3

View file

@ -1,10 +1,17 @@
$NetBSD: distinfo,v 1.8 2008/09/16 22:25:50 dholland Exp $
$NetBSD: distinfo,v 1.9 2009/05/16 11:46:09 obache Exp $
SHA1 (libstatgrab-0.12.tar.gz) = 2a1b7c641f7f088997cc1b07b4967d064b1e4d67
RMD160 (libstatgrab-0.12.tar.gz) = acb53a4339e85471c6ab87b413998df1bfd7a92f
Size (libstatgrab-0.12.tar.gz) = 429711 bytes
SHA1 (patch-aa) = 3d5f053ea143602fce3fa23687e437b782f56361
SHA1 (patch-ab) = 38776d375ab92a9d611a86126b8d2983a31d0c9d
SHA1 (patch-ac) = 5ec9924671d352aa48a446810ff5fd640bda0a8e
SHA1 (libstatgrab-0.16.tar.gz) = 233c752dd26e0cc16e88b3da13bcf63d733637c8
RMD160 (libstatgrab-0.16.tar.gz) = 1ded8eb8b213b9c86ad89031e4501e0546181f9a
Size (libstatgrab-0.16.tar.gz) = 462691 bytes
SHA1 (patch-aa) = 0c903a64ca119b3a317e850631d41aae3e9726ca
SHA1 (patch-ab) = 97c9c8ffc034af1c61e36f1a7d0417b376019496
SHA1 (patch-ac) = 313d6888c7e254d2f980877e0034f25e33bda663
SHA1 (patch-ad) = 150543e9a0573cc52e4862c11b5836d47551b0cc
SHA1 (patch-ae) = b90c82f7993dcefa42f8fe52a0d66622b7bfefe2
SHA1 (patch-ae) = dda8152c3bc2e5d75c1ce4ab56cef9ecdd44695c
SHA1 (patch-af) = 1b1bdf5f6772b8d981b2b42d2806ae1cd1fc617c
SHA1 (patch-ag) = 2810b88869e2bd6b770e7b8aa4e7f09e1d98eff4
SHA1 (patch-ah) = 3095e161c78a92a4c029dd2751bf168bdcfae780
SHA1 (patch-ai) = bbdd9e6a9fd646d09140cb2fe1eb280c16ca10a3
SHA1 (patch-aj) = 70852991608ecb5818922fb0b7e7ab61bc043527
SHA1 (patch-ak) = e2b94da5dbb997ef3276fd7b5e384f2a8c73b11a
SHA1 (patch-al) = cdab623bd895ae1dd0b81afe82d1a937ee8e5799

View file

@ -1,8 +1,8 @@
$NetBSD: patch-aa,v 1.3 2008/09/16 22:25:50 dholland Exp $
$NetBSD: patch-aa,v 1.4 2009/05/16 11:46:09 obache Exp $
--- configure.orig 2005-07-30 09:41:24.000000000 -0400
+++ configure 2008-09-16 18:16:49.000000000 -0400
@@ -20938,7 +20938,7 @@ fi
--- configure.orig 2008-03-13 13:59:03.000000000 +0000
+++ configure
@@ -21107,7 +21107,7 @@ fi
# Set things up for different OS's
# We define the name of the OS so the code can act accordingly
# We also need to add the right LDFLAGS
@ -11,11 +11,11 @@ $NetBSD: patch-aa,v 1.3 2008/09/16 22:25:50 dholland Exp $
solaris2.[6-7])
for ac_header in kstat.h
@@ -21410,7 +21410,7 @@ cat >>confdefs.h <<\_ACEOF
@@ -21692,7 +21692,7 @@ cat >>confdefs.h <<\_ACEOF
_ACEOF
;;
-netbsdelf2*)
-netbsdelf[2-3]*)
+netbsd*)
cat >>confdefs.h <<\_ACEOF

View file

@ -1,6 +1,6 @@
$NetBSD: patch-ab,v 1.3 2006/06/12 16:30:33 joerg Exp $
$NetBSD: patch-ab,v 1.4 2009/05/16 11:46:09 obache Exp $
--- src/libstatgrab/cpu_stats.c.orig 2006-06-12 16:09:20.000000000 +0000
--- src/libstatgrab/cpu_stats.c.orig 2006-10-09 13:52:06.000000000 +0000
+++ src/libstatgrab/cpu_stats.c
@@ -35,7 +35,10 @@
#if defined(LINUX) || defined(CYGWIN)
@ -14,7 +14,7 @@ $NetBSD: patch-ab,v 1.3 2006/06/12 16:30:33 joerg Exp $
#include <sys/sysctl.h>
#include <sys/dkstat.h>
#endif
@@ -79,6 +82,8 @@ sg_cpu_stats *sg_get_cpu_stats(){
@@ -83,6 +86,8 @@ sg_cpu_stats *sg_get_cpu_stats(){
#endif
#ifdef NETBSD
u_int64_t cp_time[CPUSTATES];
@ -23,7 +23,7 @@ $NetBSD: patch-ab,v 1.3 2006/06/12 16:30:33 joerg Exp $
#else
long cp_time[CPUSTATES];
#endif
@@ -152,7 +157,12 @@ sg_cpu_stats *sg_get_cpu_stats(){
@@ -156,7 +161,12 @@ sg_cpu_stats *sg_get_cpu_stats(){
cpu_now.total=cpu_now.user+cpu_now.nice+cpu_now.kernel+cpu_now.idle;
#endif
#ifdef ALLBSD
@ -37,7 +37,7 @@ $NetBSD: patch-ab,v 1.3 2006/06/12 16:30:33 joerg Exp $
size = sizeof cp_time;
if (sysctlbyname("kern.cp_time", &cp_time, &size, NULL, 0) < 0){
sg_set_error_with_errno(SG_ERROR_SYSCTLBYNAME, "kern.cp_time");
@@ -178,12 +188,21 @@ sg_cpu_stats *sg_get_cpu_stats(){
@@ -182,12 +192,21 @@ sg_cpu_stats *sg_get_cpu_stats(){
}
#endif
@ -58,4 +58,4 @@ $NetBSD: patch-ab,v 1.3 2006/06/12 16:30:33 joerg Exp $
+#endif
#endif
#ifdef WIN32

View file

@ -1,6 +1,6 @@
$NetBSD: patch-ac,v 1.1 2006/06/12 16:30:33 joerg Exp $
$NetBSD: patch-ac,v 1.2 2009/05/16 11:46:09 obache Exp $
--- src/libstatgrab/disk_stats.c.orig 2006-06-12 16:18:08.000000000 +0000
--- src/libstatgrab/disk_stats.c.orig 2006-10-09 14:09:38.000000000 +0000
+++ src/libstatgrab/disk_stats.c
@@ -64,7 +64,9 @@
#include <sys/mount.h>
@ -12,3 +12,76 @@ $NetBSD: patch-ac,v 1.1 2006/06/12 16:30:33 joerg Exp $
#include <devstat.h>
#define VALID_FS_TYPES {"hpfs", "msdosfs", "ntfs", "udf", "ext2fs", \
"ufs", "mfs", "nfs"}
@@ -430,7 +432,11 @@ sg_disk_io_stats *sg_get_disk_io_stats(i
struct devstat *dev_ptr;
#endif
#ifdef NETBSD
+#ifdef HW_DISKSTATS
struct disk_sysctl *stats;
+#else
+ struct io_sysctl *stats;
+#endif
#endif
#ifdef OPENBSD
int diskcount;
@@ -577,9 +583,15 @@ sg_disk_io_stats *sg_get_disk_io_stats(i
#if defined(NETBSD) || defined(OPENBSD)
mib[0] = CTL_HW;
+#ifdef HW_DISKSTATS
mib[1] = HW_DISKSTATS;
+#endif
#ifdef NETBSD
+#ifdef HW_DISKSTATS
mib[2] = sizeof(struct disk_sysctl);
+#else
+ mib[2] = sizeof(struct io_sysctl);
+#endif
#endif
if (sysctl(mib, MIBSIZE, NULL, &size, NULL, 0) < 0) {
@@ -588,8 +600,12 @@ sg_disk_io_stats *sg_get_disk_io_stats(i
}
#ifdef NETBSD
+#ifdef HW_DISKSTATS
num_disks = size / sizeof(struct disk_sysctl);
#else
+ num_disks = size / sizeof(struct io_sysctl);
+#endif
+#else
num_disks = size / sizeof(struct diskstats);
#endif
@@ -608,6 +624,7 @@ sg_disk_io_stats *sg_get_disk_io_stats(i
u_int64_t rbytes, wbytes;
#ifdef NETBSD
+#ifdef HW_DISKSTATS
#ifdef HAVE_DK_RBYTES
rbytes = stats[i].dk_rbytes;
wbytes = stats[i].dk_wbytes;
@@ -616,6 +633,10 @@ sg_disk_io_stats *sg_get_disk_io_stats(i
rbytes = wbytes = stats[i].dk_bytes;
#endif
#else
+ rbytes = stats[i].rbytes;
+ wbytes = stats[i].wbytes;
+#endif
+#else
#ifdef HAVE_DS_RBYTES
rbytes = stats[i].ds_rbytes;
wbytes = stats[i].ds_wbytes;
@@ -638,8 +659,12 @@ sg_disk_io_stats *sg_get_disk_io_stats(i
diskio_stats_ptr->read_bytes = rbytes;
diskio_stats_ptr->write_bytes = wbytes;
#ifdef NETBSD
+#ifdef HAVE_DISKSTATS
name = stats[i].dk_name;
#else
+ name = stats[i].name;
+#endif
+#else
name = dk_name[i];
#endif
if (sg_update_string(&diskio_stats_ptr->disk_name, name) < 0) {

View file

@ -1,8 +1,8 @@
$NetBSD: patch-ae,v 1.1 2006/06/12 16:30:33 joerg Exp $
$NetBSD: patch-ae,v 1.2 2009/05/16 11:46:09 obache Exp $
--- src/libstatgrab/Makefile.in.orig 2006-06-12 16:24:29.000000000 +0000
--- src/libstatgrab/Makefile.in.orig 2008-03-13 13:59:07.000000000 +0000
+++ src/libstatgrab/Makefile.in
@@ -62,6 +62,9 @@ am__installdirs = "$(DESTDIR)$(libdir)"
@@ -58,6 +58,9 @@ am__installdirs = "$(DESTDIR)$(libdir)"
libLTLIBRARIES_INSTALL = $(INSTALL)
LTLIBRARIES = $(lib_LTLIBRARIES)
libstatgrab_la_LIBADD =

View file

@ -0,0 +1,17 @@
$NetBSD: patch-af,v 1.1 2009/05/16 11:46:09 obache Exp $
--- src/libstatgrab/memory_stats.c.orig 2007-06-18 20:56:22.000000000 +0000
+++ src/libstatgrab/memory_stats.c
@@ -92,8 +92,12 @@ sg_mem_stats *sg_get_mem_stats(){
int pagesize;
#endif
#if defined(NETBSD)
+#if defined(__NetBSD_Version__) && (__NetBSD_Version__ > 106000000)
+ struct uvmexp_sysctl *uvm;
+#else
struct uvmexp *uvm;
#endif
+#endif
#if defined(OPENBSD)
int mib[2];
struct vmtotal vmtotal;

View file

@ -0,0 +1,16 @@
$NetBSD: patch-ag,v 1.1 2009/05/16 11:46:09 obache Exp $
--- src/libstatgrab/process_stats.c.orig 2006-10-09 14:47:58.000000000 +0000
+++ src/libstatgrab/process_stats.c
@@ -564,7 +564,11 @@ sg_process_stats *sg_get_process_stats(i
kp_stats[i].kp_eproc.e_vm.vm_rssize * getpagesize();
#if defined(NETBSD) || defined(OPENBSD)
proc_state_ptr->time_spent =
+#if defined(__NetBSD_Version__) && (499004400 <= __NetBSD_Version__)
+ kp_stats[i].kp_proc.p_rtime.sec;
+#else
kp_stats[i].kp_proc.p_rtime.tv_sec;
+#endif
#elif defined(DFBSD)
proc_state_ptr->time_spent =
( kp_stats[i].kp_thread.td_uticks +

View file

@ -0,0 +1,32 @@
$NetBSD: patch-ah,v 1.1 2009/05/16 11:46:09 obache Exp $
--- src/libstatgrab/tools.c.orig 2007-06-18 20:58:12.000000000 +0000
+++ src/libstatgrab/tools.c
@@ -498,14 +498,27 @@ kvm_t *sg_get_kvm2() {
#endif
#if defined(NETBSD) || defined(OPENBSD)
+#if defined(__NetBSD_Version__) && (__NetBSD_Version__ > 106000000)
+struct uvmexp_sysctl *sg_get_uvmexp() {
+#else
struct uvmexp *sg_get_uvmexp() {
+#endif
int mib[2];
+#if defined(__NetBSD_Version__) && (__NetBSD_Version__ > 106000000)
+ size_t size = sizeof(struct uvmexp_sysctl);
+ static struct uvmexp_sysctl uvm;
+ struct uvmexp_sysctl *new;
+
+ mib[0] = CTL_VM;
+ mib[1] = VM_UVMEXP2;
+#else
size_t size = sizeof(struct uvmexp);
static struct uvmexp uvm;
struct uvmexp *new;
mib[0] = CTL_VM;
mib[1] = VM_UVMEXP;
+#endif
if (sysctl(mib, 2, &uvm, &size, NULL, 0) < 0) {
sg_set_error_with_errno(SG_ERROR_SYSCTL, "CTL_VM.VM_UVMEXP");

View file

@ -0,0 +1,25 @@
$NetBSD: patch-ai,v 1.1 2009/05/16 11:46:09 obache Exp $
--- src/libstatgrab/tools.h.orig 2005-09-24 13:29:23.000000000 +0000
+++ src/libstatgrab/tools.h
@@ -30,6 +30,7 @@
#endif
#ifdef NETBSD
#include <uvm/uvm_extern.h>
+#include <sys/param.h>
#endif
#ifdef HPUX
#include <sys/param.h>
@@ -59,8 +60,12 @@ kvm_t *sg_get_kvm2(void);
#endif
#if defined(NETBSD) || defined(OPENBSD)
+#if defined(__NetBSD_Version__) && (__NetBSD_Version__ > 106000000)
+struct uvmexp_sysctl *sg_get_uvmexp(void);
+#else
struct uvmexp *sg_get_uvmexp(void);
#endif
+#endif
#ifdef HPUX
struct pst_static *sg_get_pstat_static(void);

View file

@ -0,0 +1,17 @@
$NetBSD: patch-aj,v 1.1 2009/05/16 11:46:09 obache Exp $
--- src/libstatgrab/page_stats.c.orig 2005-09-24 13:29:22.000000000 +0000
+++ src/libstatgrab/page_stats.c
@@ -68,8 +68,12 @@ sg_page_stats *sg_get_page_stats(){
size_t size;
#endif
#if defined(NETBSD) || defined(OPENBSD)
+#if defined(__NetBSD_Version__) && (__NetBSD_Version__ > 106000000)
+ struct uvmexp_sysctl *uvm;
+#else
struct uvmexp *uvm;
#endif
+#endif
page_stats.systime = time(NULL);
page_stats.pages_pagein=0;

View file

@ -0,0 +1,17 @@
$NetBSD: patch-ak,v 1.1 2009/05/16 11:46:09 obache Exp $
--- src/libstatgrab/swap_stats.c.orig 2007-07-05 16:46:06.000000000 +0000
+++ src/libstatgrab/swap_stats.c
@@ -93,8 +93,12 @@ sg_swap_stats *sg_get_swap_stats(){
#endif
#endif
#if defined(NETBSD) || defined(OPENBSD)
+#if defined(__NetBSD_Version__) && (__NetBSD_Version__ > 106000000)
+ struct uvmexp_sysctl *uvm;
+#else
struct uvmexp *uvm;
#endif
+#endif
#ifdef WIN32
MEMORYSTATUSEX memstats;
#endif

View file

@ -0,0 +1,20 @@
$NetBSD: patch-al,v 1.1 2009/05/16 11:46:09 obache Exp $
--- src/libstatgrab/network_stats.c.orig 2006-10-09 17:25:06.000000000 +0000
+++ src/libstatgrab/network_stats.c
@@ -177,6 +177,7 @@ sg_network_io_stats *sg_get_network_io_s
net_ptr->ifa_name) < 0) {
return NULL;
}
+ if (net_ptr->ifa_data != NULL) {
net_data=(struct if_data *)net_ptr->ifa_data;
network_stat_ptr->rx=net_data->ifi_ibytes;
network_stat_ptr->tx=net_data->ifi_obytes;
@@ -187,6 +188,7 @@ sg_network_io_stats *sg_get_network_io_s
network_stat_ptr->collisions=net_data->ifi_collisions;
network_stat_ptr->systime=time(NULL);
interfaces++;
+ }
}
freeifaddrs(net);
#endif