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
+5
View File
@@ -0,0 +1,5 @@
xosview (or XOsview, or XOSView, take your pick!) is an application
originally developed by Mike Romberg for Linux. It can be summarized
as a graphical performance meter.
Author: Mike Romberg <romberg@fsl.noaa.gov>
+59
View File
@@ -0,0 +1,59 @@
# $NetBSD: Makefile,v 1.71 2013/03/14 15:11:11 wiz Exp $
DISTNAME= xosview-1.8.3
PKGREVISION= 2
CATEGORIES= sysutils
MASTER_SITES= ${MASTER_SITE_SOURCEFORGE:=xosview/}
MAINTAINER= pkgsrc-users@NetBSD.org
HOMEPAGE= http://www.pogo.org.uk/~mark/xosview/
COMMENT= X11 graphical display of OS statistics
PKG_INSTALLATION_TYPES= overwrite pkgviews
USE_X11BASE= YES
USE_LANGUAGES= c c++
HAS_CONFIGURE= YES
CONFIGURE_ARGS+= --prefix=${PREFIX}
CONFIGURE_ARGS+= --x-includes=${X11BASE}/include
CONFIGURE_ARGS+= --x-libraries=${X11BASE}/lib
INSTALLATION_DIRS= bin lib/X11/app-defaults ${PKGMANDIR}/man1
INSTALL_MAKE_FLAGS+= MANDIR=${DESTDIR}${PREFIX}/${PKGMANDIR}/man1
INSTALL_MAKE_FLAGS+= PREFIX_TO_USE=${DESTDIR}${PREFIX}
.include "../../mk/bsd.prefs.mk"
.if ${OPSYS} == "NetBSD"
. if !defined(UVM) && exists(/usr/include/uvm/uvm.h)
CFLAGS+= -DUVM
UVM= yes
BUILD_DEFS+= UVM
. endif
.elif ${OPSYS} == "SunOS"
USE_TOOLS+= gmake
CPPFLAGS+= -I${X11BASE}/include
LIBS+= -lsocket -lnsl
.elif ${OPSYS} == "Linux"
USE_TOOLS+= gmake
.endif
.if ${OPSYS} == "NetBSD" || ${OPSYS} == "FreeBSD" || \
${OPSYS} == "OpenBSD" || ${OPSYS} == "DragonFly"
SPECIAL_PERMS+= bin/xosview ${REAL_ROOT_USER} kmem 2555
.endif
SUBST_CLASSES+= unpriv
SUBST_STAGE.unpriv= pre-configure
SUBST_FILES.unpriv= config/Makefile.top.in
SUBST_SED.unpriv= -e s,@INSTALL_ARGS@,,
SUBST_CLASSES+= paths
SUBST_STAGE.paths= post-configure
SUBST_MESSAGE.paths= Fixing manpage path.
SUBST_FILES.paths= Makefile
SUBST_SED.paths= -e s,share/man/man1,${PKGMANDIR}/man1,
.include "../../x11/libXpm/buildlink3.mk"
.include "../../mk/bsd.pkg.mk"
+4
View File
@@ -0,0 +1,4 @@
@comment $NetBSD: PLIST,v 1.2 2009/06/12 19:09:38 rillig Exp $
bin/xosview
lib/X11/app-defaults/XOsview
man/man1/xosview.1
+13
View File
@@ -0,0 +1,13 @@
$NetBSD: distinfo,v 1.26 2013/01/11 23:33:35 joerg Exp $
SHA1 (xosview-1.8.3.tar.gz) = 420fd0620ff9fb9ba83fc833eeb8b872414e377e
RMD160 (xosview-1.8.3.tar.gz) = 595e812dee686ccaa5d95eb537782679d752271b
Size (xosview-1.8.3.tar.gz) = 259793 bytes
SHA1 (patch-aa) = 4a618b50e5c852b454db84019e7fa281c4b67337
SHA1 (patch-ab) = 2bc4ca0772c931dc208edb99158e7f7ae7261b3b
SHA1 (patch-ac) = 3e9073c4ccd7e08d29a76b08f2ed0c7f9f9d9ede
SHA1 (patch-ad) = 02ae8395e200e5cbf8d6339eced33fe5aa421d38
SHA1 (patch-ae) = 6ff69eeffd40ec4ee3686f2069fd46853f346fff
SHA1 (patch-af) = c556f02c7d8297968a78eb087f413f9472371c54
SHA1 (patch-linux_lmstemp.cc) = d46c27884963901d0e5f5bed7cc880dc7fddc01c
SHA1 (patch-sunos5_diskmeter.cc) = 99e119cb645c9982f2a116950ac2ffe84eeff1d4
+184
View File
@@ -0,0 +1,184 @@
$NetBSD: patch-aa,v 1.19 2007/12/17 22:08:12 veego Exp $
--- bsd/kernel.cc.orig 2006-02-18 08:36:06.000000000 +0100
+++ bsd/kernel.cc 2007-12-17 21:23:26.000000000 +0100
@@ -115,8 +115,16 @@
// in __NetBSD_Version__ for us if needed.
#if defined(XOSVIEW_NETBSD) && defined(__NetBSD_Version__) && (__NetBSD_Version__ >= 106010000)
#define NETBSD_1_6A
+#ifdef HW_DISKSTATS
+static int dmib[3] = {CTL_HW, HW_DISKSTATS, sizeof(struct disk_sysctl)};
+#endif
+#ifdef HW_IOSTATS
+static int dmib[3] = {CTL_HW, HW_IOSTATS, sizeof(struct io_sysctl)};
+#include <sys/iostat.h>
+#endif
#endif
+#include "netmeter.h" /* For netIface_ */
#include "general.h"
#include "kernel.h" /* To grab CVSID stuff. */
@@ -303,9 +311,11 @@
void
OpenKDIfNeeded() {
+ static int initialized = 0;
char unusederrorstring[_POSIX2_LINE_MAX];
- if (kd) return; // kd is non-NULL, so it has been initialized. BCG
+ if (initialized) return;
+ initialized = 1;
/* Open it read-only, for a little added safety. */
/* If the first character of kernelFileName is not '\0', then use
@@ -313,8 +323,10 @@
specifying NULL. */
if ((kd = kvm_openfiles ((kernelFileName[0]) ? kernelFileName : NULL,
NULL, NULL, O_RDONLY, unusederrorstring))
- == NULL)
- err (-1, "OpenKDIfNeeded():kvm-open()");
+ == NULL) {
+ warn ("OpenKDIfNeeded():kvm-open()");
+ return;
+ }
// Parenthetical note: FreeBSD kvm_openfiles() uses getbootfile() to get
// the correct kernel file if the 1st arg is NULL. As far as I can see,
// one should always use NULL in FreeBSD, but I suppose control is never a
@@ -400,6 +412,8 @@
static int mib[] = { CTL_KERN, KERN_CPUSTATS };
#endif
#if defined(XOSVIEW_NETBSD) && (__NetBSD_Version__ >= 104260000)
+ uint64_t cp_time[CPUSTATES];
+ size_t size = sizeof(cp_time[0]) * CPUSTATES;
static int mib[] = { CTL_KERN, KERN_CP_TIME };
#endif
@@ -407,14 +421,11 @@
if (CPUSTATES != 5)
errx (-1, "Error: xosview for *BSD expects 5 cpu states!\n");
#if defined(__NetBSD_Version__) && __NetBSD_Version__ > 104260000 /* > 1.4Z */
- struct schedstate_percpu ssp;
- size_t size = sizeof(ssp.spc_cp_time);
- if (sysctl(mib, 2, ssp.spc_cp_time, &size, NULL, 0) < 0) {
- fprintf(stderr, "can't get schedstate_percpu: %s\n", strerror(errno));
- memset(&ssp, 0, sizeof(ssp));
+ if (sysctl(mib, 2, cp_time, &size, NULL, 0) < 0) {
+ fprintf(stderr, "xosview: sysctl kern.cp_time failed: %s\n", strerror(errno));
+ bzero(&cp_time, size);
}
- for (size = 0; size < CPUSTATES; size++)
- timeArray[size] = (long) ssp.spc_cp_time[size];
+ bcopy (cp_time, timeArray, size);
#else
#ifdef XOSVIEW_BSDI
if (sysctl(mib, 2, &cpu, &size, NULL, 0) < 0) {
@@ -441,7 +452,7 @@
}
void
-BSDGetNetInOut (long long * inbytes, long long * outbytes) {
+NetMeter::BSDGetNetInOut (long long * inbytes, long long * outbytes) {
struct ifnet * ifnetp;
@@ -466,7 +477,8 @@
while (ifnetp) {
// Now, dereference the pointer to get the ifnet struct.
safe_kvm_read ((u_long) ifnetp, &ifnet, sizeof(ifnet));
-#ifdef NET_DEBUG
+#ifdef XOSVIEW_NETBSD
+ if (netIface_ != "False" ) {
char ifname[256];
#ifdef NETBSD_OLD_IFACE
// In pre-1.2A, getting the interface name was more complicated.
@@ -476,15 +488,21 @@
safe_kvm_read ((u_long) (((char*)ifnetp) + (&ifnet.if_xname[0] - (char*)&ifnet)), ifname, 256);
snprintf (ifname, 256, "%s", ifname);
#endif
+#ifdef NET_DEBUG
printf ("Interface name is %s\n", ifname);
printf ("Ibytes: %8llu Obytes %8llu\n",
(unsigned long long) ifnet.if_ibytes,
(unsigned long long) ifnet.if_obytes);
printf ("Ipackets: %8llu\n", (unsigned long long) ifnet.if_ipackets);
-#endif
+#endif /* NET_DEBUG */
+ if (ifname != netIface_)
+ goto skipif;
+ }
+#endif /* XOSVIEW_NETBSD */
*inbytes += ifnet.if_ibytes;
*outbytes += ifnet.if_obytes;
+ skipif:
// Linked-list step taken from if.c in netstat source, line 120.
#ifdef XOSVIEW_FREEBSD
#if (__FreeBSD_version >= 300000)
@@ -773,13 +791,12 @@
#ifdef NETBSD_1_6A
// Do a sysctl with a NULL data pointer to get the size that would
// have been returned, and use that to figure out # drives.
- int mib[3] = {CTL_HW, HW_DISKSTATS, sizeof(struct disk_sysctl)};
size_t size;
- if (sysctl(mib, 3, NULL, &size, NULL, 0) < 0) {
+ if (sysctl(dmib, 3, NULL, &size, NULL, 0) < 0) {
warnx("!!! The DiskMeter sysctl failed. Disabling DiskMeter.");
return 0;
}
- NetBSD_N_Drives = size / sizeof(struct disk_sysctl);
+ NetBSD_N_Drives = size / dmib[2];
return 1;
#endif
return ValidSymbol(DISKLIST_SYM_INDEX);
@@ -816,19 +833,29 @@
#else
#if defined(NETBSD_1_6A)
// Use the new sysctl to do this for us.
- int mib[3] = {CTL_HW, HW_DISKSTATS, sizeof(struct disk_sysctl)};
- size_t sysctl_sz = NetBSD_N_Drives * sizeof(struct disk_sysctl);
+ size_t sysctl_sz = NetBSD_N_Drives * dmib[2];
+#ifdef HW_DISKSTATS
struct disk_sysctl drive_stats[NetBSD_N_Drives];
+#endif
+#ifdef HW_IOSTATS
+ struct io_sysctl drive_stats[NetBSD_N_Drives];
+#endif
// Do the sysctl.
- if (sysctl(mib, 3, drive_stats, &sysctl_sz, NULL, 0) < 0) {
+ if (sysctl(dmib, 3, drive_stats, &sysctl_sz, NULL, 0) < 0) {
err(1, "sysctl hw.diskstats failed");
}
// Now accumulate the total.
unsigned long long xferred = 0;
for (unsigned int i = 0; i < NetBSD_N_Drives; i++) {
+#ifdef HW_DISKSTATS
xferred += drive_stats[i].dk_rbytes + drive_stats[i].dk_wbytes;
+#endif
+#ifdef HW_IOSTATS
+ if (drive_stats[i].type == IOSTAT_DISK)
+ xferred += drive_stats[i].rbytes + drive_stats[i].wbytes;
+#endif
}
*bytesXferred = xferred;
#else
@@ -1016,7 +1043,7 @@
while (evptr && i < NUM_INTR) {
- safe_kvm_read((unsigned int)evptr, &evcnt, sizeof(evcnt));
+ safe_kvm_read((u_long)evptr, &evcnt, sizeof(evcnt));
evptr = evcnt.ev_list.tqe_next;
@@ -1024,7 +1051,7 @@
if (evcnt.ev_type != EVCNT_TYPE_INTR)
continue;
- safe_kvm_read((unsigned int)evcnt.ev_name, evname, evcnt.ev_namelen);
+ safe_kvm_read((u_long)evcnt.ev_name, evname, evcnt.ev_namelen);
// If it's a soft interrupt (has a name that starts with "soft"), skip it.
if (!strncmp(evname, "soft", 4))
continue;
+32
View File
@@ -0,0 +1,32 @@
$NetBSD: patch-ab,v 1.13 2013/01/11 23:33:36 joerg Exp $
--- bsd/memmeter.cc.orig 2002-07-14 03:48:45.000000000 +0000
+++ bsd/memmeter.cc
@@ -26,6 +26,8 @@
#include <sys/sysctl.h> /* Needed for kvm_cnt, kvm_uvm_exp. */
-#if defined(XOSVIEW_BSDI) || defined(XOSVIEW_FREEBSD) || defined(XOSVIEW_OPENBSD) /* Does
- OpenBSD need this? */
+#if defined(XOSVIEW_BSDI) || defined(XOSVIEW_FREEBSD) || defined(XOSVIEW_OPENBSD)
# include <sys/vmmeter.h>
#endif
+#if defined(__NetBSD__)
+#include <uvm/uvm_extern.h>
+#endif
@@ -79,3 +81,3 @@ void MemMeter::getmeminfo (void) {
size_t meminfosize = sizeof (struct vmtotal);
- sysctl (params, 2, &meminfo, &meminfosize, NULL, NULL);
+ sysctl (params, 2, &meminfo, &meminfosize, NULL, 0);
/* Note that the numbers are in terms of 4K pages. */
@@ -93,4 +95,11 @@ void MemMeter::getmeminfo (void) {
#if defined(UVM) && (defined(XOSVIEW_NETBSD) || defined(XOSVIEW_OPENBSD))
+#ifdef VM_UVMEXP2
+ int params[] = {CTL_VM, VM_UVMEXP2};
+ struct uvmexp_sysctl kvm_uvm_exp;
+ size_t kvm_uvm_exp_size = sizeof (kvm_uvm_exp);
+ sysctl (params, 2, &kvm_uvm_exp, &kvm_uvm_exp_size, NULL, 0);
+#else
struct uvmexp kvm_uvm_exp;
BSDGetUVMPageStats(&kvm_uvm_exp);
+#endif
int pgsize = kvm_uvm_exp.pagesize;
+16
View File
@@ -0,0 +1,16 @@
$NetBSD: patch-ac,v 1.8 2007/04/09 21:22:11 veego Exp $
--- bsd/netmeter.h.orig 2003-10-09 06:23:10.000000000 +0200
+++ bsd/netmeter.h
@@ -33,8 +33,11 @@ public:
void checkevent( void );
void checkResources( void );
+
+ void BSDGetNetInOut (long long * inbytes, long long * outbytes);
protected:
float netBandwidth_;
+ std::string netIface_;
private:
// NetBSD: Use long long, so we won't run into problems after 4 GB
+20
View File
@@ -0,0 +1,20 @@
$NetBSD: patch-ad,v 1.8 2007/04/09 21:22:11 veego Exp $
--- bsd/netmeter.cc.orig 2003-10-10 06:55:37.000000000 +0200
+++ bsd/netmeter.cc
@@ -38,6 +38,7 @@ NetMeter::NetMeter( XOSView *parent, flo
netBandwidth_ = max;
total_ = netBandwidth_;
_lastBytesIn = _lastBytesOut = 0;
+ netIface_ = "False";
BSDGetNetInOut (&_lastBytesIn, &_lastBytesOut);
}
}
@@ -56,6 +57,7 @@ void NetMeter::checkResources( void ){
dodecay_ = parent_->isResourceTrue("netDecay");
useGraph_ = parent_->isResourceTrue("netGraph");
SetUsedFormat (parent_->getResource("netUsedFormat"));
+ netIface_ = parent_->getResource( "netIface" );
}
}
+26
View File
@@ -0,0 +1,26 @@
$NetBSD: patch-ae,v 1.12 2007/04/14 20:32:41 veego Exp $
--- bsd/pagemeter.h.orig 2003-10-09 06:22:32.000000000 +0200
+++ bsd/pagemeter.h 2007-04-14 22:23:47.000000000 +0200
@@ -30,6 +30,9 @@
#include <vm/vm.h>
#endif
#include <uvm/uvm_extern.h>
+#if defined (VM_UVMEXP2)
+#include <sys/sysctl.h> /* Needed for uvmexp_sysctl. */
+#endif
#else
#include <sys/vmmeter.h>
#endif
@@ -48,7 +51,11 @@
void getpageinfo( void );
private:
#if defined(UVM)
+# ifdef VM_UVMEXP2
+ struct uvmexp_sysctl prev_;
+# else
struct uvmexp prev_;
+# endif
#else
struct vmmeter prev_;
#endif
+34
View File
@@ -0,0 +1,34 @@
$NetBSD: patch-af,v 1.4 2007/04/14 20:32:41 veego Exp $
--- bsd/pagemeter.cc.orig 2002-03-22 04:23:41.000000000 +0100
+++ bsd/pagemeter.cc 2007-04-14 22:24:12.000000000 +0200
@@ -28,7 +28,13 @@
total_ = total;
BSDPageInit();
#ifdef UVM
+# ifdef VM_UVMEXP2
+ int params[] = {CTL_VM, VM_UVMEXP2};
+ size_t prev_size = sizeof (prev_);
+ sysctl (params, 2, &prev_, &prev_size, NULL, 0);
+# else
BSDGetUVMPageStats(&prev_);
+# endif
#else
BSDGetPageStats(&prev_);
#endif
@@ -57,8 +63,15 @@
void PageMeter::getpageinfo (void) {
// Begin NetBSD-specific code...
#if defined(UVM)
+# ifdef VM_UVMEXP2
+ int params[] = {CTL_VM, VM_UVMEXP2};
+ struct uvmexp_sysctl uvm;
+ size_t uvm_size = sizeof (uvm);
+ sysctl (params, 2, &uvm, &uvm_size, NULL, 0);
+# else
struct uvmexp uvm;
BSDGetUVMPageStats(&uvm);
+# endif
#else
struct vmmeter vm;
BSDGetPageStats(&vm);
@@ -0,0 +1,13 @@
$NetBSD: patch-linux_lmstemp.cc,v 1.1 2012/09/15 09:03:50 cheusov Exp $
Fix build failure on Linux
--- linux/lmstemp.cc.orig 2006-02-18 05:13:07.000000000 +0000
+++ linux/lmstemp.cc
@@ -29,7 +29,7 @@ LmsTemp::LmsTemp( XOSView *parent, const
<< std::endl;
parent_->done(1);
}
- char *p;
+ const char *p;
if ((p = strrchr(caption,'/')) != 0)
_highest = atoi(p+1);
else
@@ -0,0 +1,13 @@
$NetBSD: patch-sunos5_diskmeter.cc,v 1.1 2012/03/07 16:14:40 hans Exp $
--- sunos5/diskmeter.cc.orig 1999-11-07 00:12:34.000000000 +0100
+++ sunos5/diskmeter.cc 2012-03-07 17:12:17.363721614 +0100
@@ -7,7 +7,7 @@
#include "diskmeter.h"
#include "xosview.h"
-#include <fstream.h>
+#include <fstream>
#include <stdlib.h>