Import of pkgsrc-2013Q2

This commit is contained in:
2013-09-26 17:14:40 +02:00
commit 785076ae39
74991 changed files with 4380255 additions and 0 deletions
+7
View File
@@ -0,0 +1,7 @@
The libstatgrab library provides an easy to use interface for
accessing system statistics and information. Available statistics
include CPU, Load, Memory, Swap, Disk I/O, and Network I/O.
Also part of the package are two tools; saidar provides a curses-based
interface to viewing live system statistics, and statgrab is a
sysctl-like interface to the statistics.
+32
View File
@@ -0,0 +1,32 @@
# $NetBSD: Makefile,v 1.23 2013/05/31 12:40:01 wiz Exp $
DISTNAME= libstatgrab-0.17
PKGREVISION= 2
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://www.mirrorservice.org/sites/ftp.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
LICENSE= gnu-gpl-v2
.include "options.mk"
USE_TOOLS+= pkg-config perl:run
GNU_CONFIGURE= yes
USE_LIBTOOL= yes
PKGCONFIG_OVERRIDE= libstatgrab.pc.in
REPLACE_PERL+= src/statgrab/statgrab-make-mrtg-config.in
REPLACE_PERL+= src/statgrab/statgrab-make-mrtg-index.in
CONFIGURE_ARGS+= --disable-examples
CPPFLAGS.NetBSD+= -D_KMEMUSER
.include "../../mk/bsd.pkg.mk"
+32
View File
@@ -0,0 +1,32 @@
@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
${PLIST.statgrab}bin/statgrab-make-mrtg-index
include/statgrab.h
include/statgrab_deprecated.h
lib/libstatgrab.la
lib/pkgconfig/libstatgrab.pc
${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
man/man3/sg_get_disk_io_stats.3
man/man3/sg_get_disk_io_stats_diff.3
man/man3/sg_get_fs_stats.3
man/man3/sg_get_host_info.3
man/man3/sg_get_load_stats.3
man/man3/sg_get_mem_stats.3
man/man3/sg_get_network_iface_stats.3
man/man3/sg_get_network_io_stats.3
man/man3/sg_get_network_io_stats_diff.3
man/man3/sg_get_page_stats.3
man/man3/sg_get_page_stats_diff.3
man/man3/sg_get_process_count.3
man/man3/sg_get_process_stats.3
man/man3/sg_get_swap_stats.3
man/man3/sg_get_user_stats.3
man/man3/statgrab.3
+13
View File
@@ -0,0 +1,13 @@
# $NetBSD: buildlink3.mk,v 1.9 2009/03/20 19:24:23 joerg Exp $
BUILDLINK_TREE+= libstatgrab
.if !defined(LIBSTATGRAB_BUILDLINK3_MK)
LIBSTATGRAB_BUILDLINK3_MK:=
BUILDLINK_API_DEPENDS.libstatgrab+= libstatgrab>=0.10
BUILDLINK_ABI_DEPENDS.libstatgrab+= libstatgrab>=0.10.3nb1
BUILDLINK_PKGSRCDIR.libstatgrab?= ../../devel/libstatgrab
.endif # LIBSTATGRAB_BUILDLINK3_MK
BUILDLINK_TREE+= -libstatgrab
+17
View File
@@ -0,0 +1,17 @@
$NetBSD: distinfo,v 1.10 2010/08/24 06:33:10 sno Exp $
SHA1 (libstatgrab-0.17.tar.gz) = c3f146ac5baa69ca0f8521c5a6daa6e6c8603ee5
RMD160 (libstatgrab-0.17.tar.gz) = 586592626abb2ab4ff8947059d5e29d3a79512f3
Size (libstatgrab-0.17.tar.gz) = 463224 bytes
SHA1 (patch-aa) = 0c903a64ca119b3a317e850631d41aae3e9726ca
SHA1 (patch-ab) = 97c9c8ffc034af1c61e36f1a7d0417b376019496
SHA1 (patch-ac) = ef9124f8066a31012708e7db8bc880ee9714fc95
SHA1 (patch-ad) = 150543e9a0573cc52e4862c11b5836d47551b0cc
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
+24
View File
@@ -0,0 +1,24 @@
# $NetBSD: options.mk,v 1.3 2009/05/16 04:18:13 obache Exp $
PKG_OPTIONS_VAR= PKG_OPTIONS.libstatgrab
PKG_SUPPORTED_OPTIONS= saidar statgrab
PKG_SUGGESTED_OPTIONS= saidar statgrab
PKG_OPTIONS_LEGACY_VARS+= WITHOUT_SAIDAR:-saidar
PKG_OPTIONS_LEGACY_VARS+= WITHOUT_STATGRAB:-statgrab
.include "../../mk/bsd.options.mk"
PLIST_VARS+= saidar statgrab
.if !empty(PKG_OPTIONS:Mstatgrab)
PLIST.statgrab= yes
.else
CONFIGURE_ARGS+= --disable-statgrab
.endif
.if !empty(PKG_OPTIONS:Msaidar)
PLIST.saidar= yes
. include "../../devel/ncurses/buildlink3.mk"
.else
CONFIGURE_ARGS+= --disable-saidar
.endif
+22
View File
@@ -0,0 +1,22 @@
$NetBSD: patch-aa,v 1.4 2009/05/16 11:46:09 obache Exp $
--- 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
-case $host_os in
+case $build_os in
solaris2.[6-7])
for ac_header in kstat.h
@@ -21692,7 +21692,7 @@ cat >>confdefs.h <<\_ACEOF
_ACEOF
;;
-netbsdelf[2-3]*)
+netbsd*)
cat >>confdefs.h <<\_ACEOF
#define ALLBSD
+61
View File
@@ -0,0 +1,61 @@
$NetBSD: patch-ab,v 1.4 2009/05/16 11:46:09 obache Exp $
--- 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)
#include <stdio.h>
#endif
-#if defined(FREEBSD) || defined(DFBSD)
+#if defined(DFBSD)
+#include <sys/param.h>
+#include <kinfo.h>
+#elif defined(FREEBSD)
#include <sys/sysctl.h>
#include <sys/dkstat.h>
#endif
@@ -83,6 +86,8 @@ sg_cpu_stats *sg_get_cpu_stats(){
#endif
#ifdef NETBSD
u_int64_t cp_time[CPUSTATES];
+#elif defined(DFBSD)
+ struct kinfo_cputime cp_time;
#else
long cp_time[CPUSTATES];
#endif
@@ -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
-#if defined(FREEBSD) || defined(DFBSD)
+#if defined(DFBSD)
+ if (kinfo_get_sched_cputime(&cp_time)) {
+ sg_set_error_with_errno(SG_ERROR_SYSCTLBYNAME, "kern.cp_time");
+ return NULL;
+ }
+#elif defined(FREEBSD)
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");
@@ -182,12 +192,21 @@ sg_cpu_stats *sg_get_cpu_stats(){
}
#endif
+#ifdef DFBSD
+ cpu_now.user=cp_time.cp_user;
+ cpu_now.nice=cp_time.cp_nice;
+ cpu_now.kernel=cp_time.cp_sys + cp_time.cp_intr;
+ cpu_now.idle=cp_time.cp_idle;
+
+ cpu_now.total=cpu_now.user+cpu_now.nice+cpu_now.kernel+cpu_now.idle;
+#else
cpu_now.user=cp_time[CP_USER];
cpu_now.nice=cp_time[CP_NICE];
cpu_now.kernel=cp_time[CP_SYS];
cpu_now.idle=cp_time[CP_IDLE];
cpu_now.total=cpu_now.user+cpu_now.nice+cpu_now.kernel+cpu_now.idle;
+#endif
#endif
#ifdef WIN32
+87
View File
@@ -0,0 +1,87 @@
$NetBSD: patch-ac,v 1.3 2010/08/24 06:33:11 sno Exp $
--- src/libstatgrab/disk_stats.c.orig 2009-12-04 22:09:30.000000000 +0000
+++ src/libstatgrab/disk_stats.c
@@ -64,7 +64,9 @@
#include <sys/mount.h>
#endif
#if defined(FREEBSD) || defined(DFBSD)
+#if !defined(DFBSD)
#include <sys/dkstat.h>
+#endif
#include <devstat.h>
#include <sys/param.h>
#include <sys/mount.h>
@@ -457,7 +459,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;
@@ -604,9 +610,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) {
@@ -615,8 +627,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
@@ -635,6 +651,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;
@@ -643,6 +660,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;
@@ -665,8 +686,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) {
+13
View File
@@ -0,0 +1,13 @@
$NetBSD: patch-ad,v 1.1 2006/06/12 16:30:33 joerg Exp $
--- src/saidar/saidar.c.orig 2006-06-12 16:23:53.000000000 +0000
+++ src/saidar/saidar.c
@@ -441,8 +441,6 @@ int main(int argc, char **argv){
WINDOW *window;
- extern int errno;
-
int delay=2;
sg_init();
+14
View File
@@ -0,0 +1,14 @@
$NetBSD: patch-ae,v 1.2 2009/05/16 11:46:09 obache Exp $
--- src/libstatgrab/Makefile.in.orig 2008-03-13 13:59:07.000000000 +0000
+++ src/libstatgrab/Makefile.in
@@ -58,6 +58,9 @@ am__installdirs = "$(DESTDIR)$(libdir)"
libLTLIBRARIES_INSTALL = $(INSTALL)
LTLIBRARIES = $(lib_LTLIBRARIES)
libstatgrab_la_LIBADD =
+.if ${OPSYS} == "DragonFly"
+libstatgrab_la_LIBADD += -lkinfo
+.endif
am__libstatgrab_la_SOURCES_DIST = cpu_stats.c disk_stats.c \
load_stats.c memory_stats.c network_stats.c os_info.c \
page_stats.c process_stats.c swap_stats.c user_stats.c tools.c \
+17
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;
+16
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 +
+32
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");
+25
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);
+17
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;
+17
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
+20
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