summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorahze <ahze@df743ca5-7f9a-e211-a948-0013205c9059>2006-07-19 03:36:59 +0800
committerahze <ahze@df743ca5-7f9a-e211-a948-0013205c9059>2006-07-19 03:36:59 +0800
commitea3af7d353625786afd0f650501ee2099f97a307 (patch)
treee2f78fdf48e8cda9822a6cf2f2f2fabbc6714ab6
parentdf85bcdc417b40672b4ad703e2f6664c6a1a2732 (diff)
downloadmarcuscom-ports-ea3af7d353625786afd0f650501ee2099f97a307.tar
marcuscom-ports-ea3af7d353625786afd0f650501ee2099f97a307.tar.gz
marcuscom-ports-ea3af7d353625786afd0f650501ee2099f97a307.tar.bz2
marcuscom-ports-ea3af7d353625786afd0f650501ee2099f97a307.tar.lz
marcuscom-ports-ea3af7d353625786afd0f650501ee2099f97a307.tar.xz
marcuscom-ports-ea3af7d353625786afd0f650501ee2099f97a307.tar.zst
marcuscom-ports-ea3af7d353625786afd0f650501ee2099f97a307.zip
- Move to LOCALBASE
git-svn-id: svn://creme-brulee.marcuscom.com/ports/trunk@6648 df743ca5-7f9a-e211-a948-0013205c9059
-rw-r--r--devel/libgtop/Makefile53
-rw-r--r--devel/libgtop/distinfo3
-rw-r--r--devel/libgtop/files/extra-67-patch-sysdeps_freebsd_Makefile.in20
-rw-r--r--devel/libgtop/files/patch-configure19
-rw-r--r--devel/libgtop/files/patch-lib::read.c30
-rw-r--r--devel/libgtop/files/patch-lib::write.c32
-rw-r--r--devel/libgtop/files/patch-src::daemon::io.c57
-rw-r--r--devel/libgtop/files/patch-src_daemon_server.c17
-rw-r--r--devel/libgtop/files/patch-sysdeps_freebsd_fsusage.c134
-rw-r--r--devel/libgtop/files/patch-sysdeps_freebsd_glibtop_server.h13
-rw-r--r--devel/libgtop/files/patch-sysdeps_freebsd_netload.c102
-rw-r--r--devel/libgtop/files/patch-sysdeps_freebsd_siglist.c41
-rw-r--r--devel/libgtop/files/patch-systeps::freebsd::prockernel.c15
-rw-r--r--devel/libgtop/files/patch-systeps::freebsd::procmap.c155
-rw-r--r--devel/libgtop/files/patch-systeps::freebsd::proctime.c31
-rw-r--r--devel/libgtop/files/pkg-message13
-rw-r--r--devel/libgtop/pkg-descr3
-rw-r--r--devel/libgtop/pkg-plist129
18 files changed, 867 insertions, 0 deletions
diff --git a/devel/libgtop/Makefile b/devel/libgtop/Makefile
new file mode 100644
index 000000000..4036401ec
--- /dev/null
+++ b/devel/libgtop/Makefile
@@ -0,0 +1,53 @@
+# New ports collection makefile for: libgtop2
+# Date Created: 29 April 2002
+# Whom: Joe Marcus Clarke <marcus@FreeBSD.org>
+#
+# $FreeBSD$
+# $MCom: ports/devel/libgtop2/Makefile,v 1.70 2006/04/15 05:49:08 marcus Exp $
+
+PORTNAME= libgtop
+PORTVERSION= 2.14.1
+PORTREVISION= 2
+CATEGORIES= devel gnome
+MASTER_SITES= ${MASTER_SITE_GNOME}
+MASTER_SITE_SUBDIR= sources/${PORTNAME}/${PORTVERSION:C/^([0-9]+\.[0-9]+).*/\1/}
+DIST_SUBDIR= gnome2
+
+MAINTAINER= gnome@FreeBSD.org
+COMMENT= GNOME 2 top library
+
+LIB_DEPENDS= popt.0:${PORTSDIR}/devel/popt
+
+USE_BZIP2= yes
+USE_PERL5_BUILD=yes
+USE_GETTEXT= yes
+USE_GMAKE= yes
+USE_GNOME= gnomehack glib20 ltverhack
+INSTALLS_SHLIB= yes
+USE_AUTOTOOLS= libtool:15
+CONFIGURE_ENV= CPPFLAGS="-I${LOCALBASE}/include" \
+ LDFLAGS="-L${LOCALBASE}/lib"
+
+INFO= libgtop2
+
+.include <bsd.port.pre.mk>
+
+.if ${OSVERSION} >= 600000
+PKGMESSAGE= ${FILESDIR}/pkg-message
+EXTRA_PATCHES+= ${FILESDIR}/extra-67-patch-sysdeps_freebsd_Makefile.in
+.endif
+
+post-patch:
+ @${REINPLACE_CMD} -e 's|int64_t|gint64|g' \
+ ${WRKSRC}/include/glibtop/command.h \
+ ${WRKSRC}/include/glibtop/proclist.h \
+ ${WRKSRC}/lib/lib.pl
+
+post-install:
+ @${CHGRP} kmem ${PREFIX}/bin/libgtop_server2
+ @${CHMOD} 2555 ${PREFIX}/bin/libgtop_server2
+.if ${OSVERSION} >= 600000
+ @${CAT} ${PKGMESSAGE}
+.endif
+
+.include <bsd.port.post.mk>
diff --git a/devel/libgtop/distinfo b/devel/libgtop/distinfo
new file mode 100644
index 000000000..dd81ddab3
--- /dev/null
+++ b/devel/libgtop/distinfo
@@ -0,0 +1,3 @@
+MD5 (gnome2/libgtop-2.14.1.tar.bz2) = 59cc661ae518fcae158517cc029b2add
+SHA256 (gnome2/libgtop-2.14.1.tar.bz2) = b0658ab0327bf833295bb8d2467ab16747c017c8cd26ff6936a927def6818fb2
+SIZE (gnome2/libgtop-2.14.1.tar.bz2) = 661846
diff --git a/devel/libgtop/files/extra-67-patch-sysdeps_freebsd_Makefile.in b/devel/libgtop/files/extra-67-patch-sysdeps_freebsd_Makefile.in
new file mode 100644
index 000000000..1258d576f
--- /dev/null
+++ b/devel/libgtop/files/extra-67-patch-sysdeps_freebsd_Makefile.in
@@ -0,0 +1,20 @@
+--- sysdeps/freebsd/Makefile.in.orig Mon Apr 10 14:08:39 2006
++++ sysdeps/freebsd/Makefile.in Mon Apr 10 14:11:50 2006
+@@ -50,7 +50,7 @@ mkinstalldirs = $(SHELL) $(top_srcdir)/m
+ CONFIG_HEADER = $(top_builddir)/config.h
+ CONFIG_CLEAN_FILES =
+ LTLIBRARIES = $(noinst_LTLIBRARIES)
+-libgtop_sysdeps_2_0_la_LIBADD =
++libgtop_sysdeps_2_0_la_LIBADD = -lgeom -ldevstat
+ am_libgtop_sysdeps_2_0_la_OBJECTS = nosuid.lo siglist.lo sysinfo.lo
+ libgtop_sysdeps_2_0_la_OBJECTS = $(am_libgtop_sysdeps_2_0_la_OBJECTS)
+ am__DEPENDENCIES_1 =
+@@ -260,7 +260,7 @@ target_vendor = @target_vendor@
+ noinst_LTLIBRARIES = libgtop_sysdeps-2.0.la libgtop_sysdeps_suid-2.0.la
+ libgtop_sysdeps_2_0_la_SOURCES = nosuid.c siglist.c sysinfo.c
+ libgtop_sysdeps_2_0_la_LDFLAGS = $(LT_VERSION_INFO)
+-libgtop_sysdeps_suid_2_0_la_LIBADD = $(KVM_LIBS)
++libgtop_sysdeps_suid_2_0_la_LIBADD = $(KVM_LIBS) -lgeom -ldevstat
+ libgtop_sysdeps_suid_2_0_la_SOURCES = open.c close.c cpu.c mem.c swap.c \
+ uptime.c loadavg.c shm_limits.c msg_limits.c \
+ sem_limits.c proclist.c procstate.c procuid.c \
diff --git a/devel/libgtop/files/patch-configure b/devel/libgtop/files/patch-configure
new file mode 100644
index 000000000..934f89e79
--- /dev/null
+++ b/devel/libgtop/files/patch-configure
@@ -0,0 +1,19 @@
+--- configure.orig Mon Apr 10 15:28:24 2006
++++ configure Mon Apr 10 15:30:40 2006
+@@ -20568,6 +20568,7 @@ else
+ for def in nothing KERNEL _KERNEL; do
+ cat >conftest.$ac_ext <<_ACEOF
+ #define $def
++#include <sys/types.h>
+ #include <sys/ipc.h>
+ #include <sys/msg.h>
+ #include <stdio.h>
+@@ -23458,7 +23459,7 @@ fi
+
+
+ case "$host_os" in
+- solaris*)
++ solaris*|freebsd*)
+
+ echo "$as_me:$LINENO: checking for kstat_open in -lkstat" >&5
+ echo $ECHO_N "checking for kstat_open in -lkstat... $ECHO_C" >&6
diff --git a/devel/libgtop/files/patch-lib::read.c b/devel/libgtop/files/patch-lib::read.c
new file mode 100644
index 000000000..18c837d37
--- /dev/null
+++ b/devel/libgtop/files/patch-lib::read.c
@@ -0,0 +1,30 @@
+--- lib/read.c.orig Mon Apr 10 04:41:46 2006
++++ lib/read.c Mon Apr 10 15:12:31 2006
+@@ -22,6 +22,7 @@
+ */
+
+ #include <config.h>
++#include <errno.h>
+ #include <glibtop/read.h>
+ #include <glibtop/error.h>
+ #include <glib/gi18n-lib.h>
+@@ -56,14 +57,18 @@ glibtop_read_l (glibtop *server, size_t
+ fprintf (stderr, "LIBRARY: really reading %d bytes.\n", (int)size);
+ #endif
+
++retry:
+ if (server->socket) {
+ do_read (server->socket, buf, size);
+ } else {
+- if(read (server->input [0], buf, size) < 0)
++ if(read (server->input [0], buf, size) < 0) {
++ if (errno == EINTR)
++ goto retry;
+ glibtop_error_io_r (
+ server,
+ ngettext ("read %d byte",
+ "read %d bytes", size),
+ (int)size);
++ }
+ }
+ }
diff --git a/devel/libgtop/files/patch-lib::write.c b/devel/libgtop/files/patch-lib::write.c
new file mode 100644
index 000000000..acb63c489
--- /dev/null
+++ b/devel/libgtop/files/patch-lib::write.c
@@ -0,0 +1,32 @@
+--- lib/write.c.orig Mon Apr 10 04:41:46 2006
++++ lib/write.c Mon Apr 10 15:37:00 2006
+@@ -22,7 +22,7 @@
+ */
+
+ #include <config.h>
+-
++#include <errno.h>
+ #include <glibtop/write.h>
+ #include <glibtop/error.h>
+ #include <glib/gi18n-lib.h>
+@@ -42,15 +42,19 @@ glibtop_write_l (glibtop *server, size_t
+ fprintf (stderr, "LIBRARY: really writing %d bytes.\n", (int)size);
+ #endif
+
++retry:
+ if (server->socket) {
+ ret = send (server->socket, buf, size, 0);
+ } else {
+ ret = write (server->output [1], buf, size);
+ }
+
+- if (ret < 0)
++ if (ret < 0) {
++ if (errno == EINTR)
++ goto retry;
+ glibtop_error_io_r (server,
+ ngettext("wrote %d byte",
+ "wrote %d bytes", size),
+ (int) size);
++ }
+ }
diff --git a/devel/libgtop/files/patch-src::daemon::io.c b/devel/libgtop/files/patch-src::daemon::io.c
new file mode 100644
index 000000000..f8fb71b03
--- /dev/null
+++ b/devel/libgtop/files/patch-src::daemon::io.c
@@ -0,0 +1,57 @@
+--- src/daemon/io.c.orig Mon Dec 12 05:09:38 2005
++++ src/daemon/io.c Wed Dec 14 18:58:01 2005
+@@ -21,6 +21,7 @@
+ Boston, MA 02111-1307, USA.
+ */
+
++#include <errno.h>
+ #include <config.h>
+ #include "daemon.h"
+ #include <glibtop/error.h>
+@@ -37,9 +38,13 @@ do_output (int s, glibtop_response *resp
+ resp->offset = offset;
+ resp->data_size = data_size;
+
++retry1:
+ if (s == 0) {
+- if (write (1, (const void *) resp, sizeof (glibtop_response)) < 0)
++ if (write (1, (const void *) resp, sizeof (glibtop_response)) < 0) {
++ if (errno == EINTR)
++ goto retry1;
+ glibtop_warn_io ("write");
++ }
+ } else {
+ if (send (s, (const void *) resp, sizeof (glibtop_response), 0) < 0)
+ glibtop_warn_io ("send");
+@@ -50,9 +55,13 @@ do_output (int s, glibtop_response *resp
+ fprintf (stderr, "Writing %d bytes of data.\n", resp->data_size);
+ #endif
+
++retry2:
+ if (s == 0) {
+- if (write (1, data, resp->data_size) < 0)
++ if (write (1, data, resp->data_size) < 0) {
++ if (errno == EINTR)
++ goto retry2;
+ glibtop_warn_io ("write");
++ }
+ } else {
+ if (send (s, data, resp->data_size, 0) , 0)
+ glibtop_warn_io ("send");
+@@ -68,6 +77,7 @@ do_read (int s, void *ptr, size_t total_
+ size_t already_read = 0, remaining = total_size;
+
+ while (already_read < total_size) {
++retry:
+ if (s)
+ nread = recv (s, ptr, remaining, 0);
+ else
+@@ -79,6 +89,8 @@ do_read (int s, void *ptr, size_t total_
+ }
+
+ if (nread <= 0) {
++ if (errno == EINTR)
++ goto retry;
+ glibtop_warn_io ("recv");
+ return 0;
+ }
diff --git a/devel/libgtop/files/patch-src_daemon_server.c b/devel/libgtop/files/patch-src_daemon_server.c
new file mode 100644
index 000000000..bf0bba5c7
--- /dev/null
+++ b/devel/libgtop/files/patch-src_daemon_server.c
@@ -0,0 +1,17 @@
+--- src/daemon/server.c.orig Mon Feb 17 15:22:19 2003
++++ src/daemon/server.c Mon Feb 17 15:23:31 2003
+@@ -88,11 +88,12 @@
+ if (strcmp (uts.sysname, LIBGTOP_COMPILE_SYSTEM) ||
+ strcmp (uts.release, LIBGTOP_COMPILE_RELEASE) ||
+ strcmp (uts.machine, LIBGTOP_COMPILE_MACHINE)) {
+- fprintf (stderr, "Can only run on %s %s %s\n",
++ fprintf (stderr, "This libgtop was compiled on %s %s %s\n",
+ LIBGTOP_COMPILE_SYSTEM,
+ LIBGTOP_COMPILE_RELEASE,
+ LIBGTOP_COMPILE_MACHINE);
+- _exit (1);
++ fprintf (stderr, "If you see strange problems caused by it,\n");
++ fprintf (stderr, "you should recompile libgtop and dependent applications\n");
+ }
+ #endif
+
diff --git a/devel/libgtop/files/patch-sysdeps_freebsd_fsusage.c b/devel/libgtop/files/patch-sysdeps_freebsd_fsusage.c
new file mode 100644
index 000000000..85c9822f8
--- /dev/null
+++ b/devel/libgtop/files/patch-sysdeps_freebsd_fsusage.c
@@ -0,0 +1,134 @@
+--- sysdeps/freebsd/jfsusage.c.orig Sun Apr 9 12:52:45 2006
++++ sysdeps/freebsd/fsusage.c Mon Apr 10 15:34:42 2006
+@@ -9,10 +9,12 @@
+
+ #include <unistd.h>
+ #include <sys/param.h>
+-#if defined (HAVE_SYS_STATVFS_H)
+-#include <sys/statvfs.h>
+-#else
+ #include <sys/mount.h>
++#if __FreeBSD_version >= 600000
++#include <libgeom.h>
++#include <sys/resource.h>
++#include <devstat.h>
++#include <sys/devicestat.h>
+ #endif
+
+ #include <stdio.h>
+@@ -31,24 +33,108 @@ _glibtop_freebsd_get_fsusage_read_write(
+ const char *path)
+ {
+ int result;
+-#if defined (STAT_STATVFS)
+- struct statvfs sfs;
+-#else
+ struct statfs sfs;
++#if __FreeBSD_version >= 600000
++ struct devstat *ds;
++ void *sc;
++ struct timespec ts;
++ struct gprovider *gp;
++ struct gident *gid;
++ struct gmesh gmp;
++ double etime;
++ uint64_t ld[2];
+ #endif
+
+-#if defined (STAT_STATVFS)
+- result = statvfs (path, &sfs);
+-#else
+ result = statfs (path, &sfs);
+-#endif
+
+ if (result == -1) {
++ glibtop_warn_io_r (server, "statfs");
++ return;
++ }
++#if __FreeBSD_version >= 600000
++ ld[0] = 0;
++ ld[1] = 0;
++ result = geom_gettree (&gmp);
++ if (result != 0) {
++ glibtop_warn_io_r (server, "geom_gettree = %d", result);
++ return;
++ }
++
++ result = geom_stats_open ();
++ if (result) {
++ glibtop_warn_io_r (server, "geom_stats_open()");
++ geom_deletetree (&gmp);
++ return;
++ }
++
++ sc = geom_stats_snapshot_get ();
++ if (sc == NULL) {
++ glibtop_warn_io_r (server, "geom_stats_snapshot_get()");
++ geom_stats_close ();
++ geom_deletetree (&gmp);
+ return;
+ }
+
++ geom_stats_snapshot_timestamp (sc, &ts);
++ etime = ts.tv_sec + (ts.tv_nsec * 1e-9);
++ geom_stats_snapshot_reset (sc);
++
++ for (;;) {
++ ds = geom_stats_snapshot_next (sc);
++ if (ds == NULL) {
++ break;
++ }
++ if (ds->id == NULL) {
++ continue;
++ }
++
++ gid = geom_lookupid (&gmp, ds->id);
++ if (gid == NULL) {
++ geom_deletetree (&gmp);
++ result = geom_gettree (&gmp);
++ gid = geom_lookupid (&gmp, ds->id);
++ }
++
++ if (gid == NULL) {
++ continue;
++ }
++ if (gid->lg_what == ISCONSUMER) {
++ continue;
++ }
++
++ gp = gid->lg_ptr;
++
++ if (!g_str_has_suffix (sfs.f_mntfromname, gp->lg_name)) {
++ continue;
++ }
++ else {
++ result = devstat_compute_statistics (ds, NULL, etime,
++ DSM_TOTAL_TRANSFERS_READ,
++ &ld[0],
++ DSM_TOTAL_TRANSFERS_WRITE,
++ &ld[1], DSM_NONE);
++ if (result != 0) {
++ glibtop_warn_io_r (server,
++ "devstat_compute_statistics()");
++ geom_stats_snapshot_free (sc);
++ geom_stats_close ();
++ geom_deletetree (&gmp);
++ return;
++ }
++ break;
++ }
++ }
++
++ geom_stats_snapshot_free (sc);
++ geom_stats_close ();
++ geom_deletetree (&gmp);
++
++ buf->read = ld[0];
++ buf->write = ld[1];
++#else
+ buf->read = sfs.f_syncreads + sfs.f_asyncreads;
+ buf->write = sfs.f_syncwrites + sfs.f_asyncwrites;
++#endif
+
+ buf->flags |= (1 << GLIBTOP_FSUSAGE_READ) | (1 << GLIBTOP_FSUSAGE_WRITE);
+ }
diff --git a/devel/libgtop/files/patch-sysdeps_freebsd_glibtop_server.h b/devel/libgtop/files/patch-sysdeps_freebsd_glibtop_server.h
new file mode 100644
index 000000000..4955aed65
--- /dev/null
+++ b/devel/libgtop/files/patch-sysdeps_freebsd_glibtop_server.h
@@ -0,0 +1,13 @@
+--- sysdeps/freebsd/glibtop_server.h.orig Tue Apr 4 16:06:13 2006
++++ sysdeps/freebsd/glibtop_server.h Mon Apr 10 15:27:11 2006
+@@ -21,8 +21,8 @@
+ Boston, MA 02111-1307, USA.
+ */
+
+-#ifndef __GLIBTOP_SERVER_H__
+-#define __GLIBTOP_SERVER_H__
++#ifndef __FREEBSD__GLIBTOP_SERVER_H__
++#define __FREEBSD__GLIBTOP_SERVER_H__
+
+ G_BEGIN_DECLS
+
diff --git a/devel/libgtop/files/patch-sysdeps_freebsd_netload.c b/devel/libgtop/files/patch-sysdeps_freebsd_netload.c
new file mode 100644
index 000000000..bb6d286e0
--- /dev/null
+++ b/devel/libgtop/files/patch-sysdeps_freebsd_netload.c
@@ -0,0 +1,102 @@
+--- sysdeps/freebsd/netload.c.orig Mon Dec 12 05:09:39 2005
++++ sysdeps/freebsd/netload.c Wed May 3 13:46:08 2006
+@@ -28,6 +28,8 @@
+
+ #include <glibtop_suid.h>
+
++#include <string.h>
++
+ #include <net/if.h>
+ #include <net/if_dl.h>
+ #include <net/if_types.h>
+@@ -83,9 +85,11 @@ glibtop_get_netload_p (glibtop *server,
+ const char *interface)
+ {
+ struct ifnet ifnet;
+- u_long ifnetaddr, ifnetfound, ifaddraddr;
++ u_long ifnetaddr, ifnetfound;
+ struct sockaddr *sa = NULL;
++#if (defined(__FreeBSD__) && (__FreeBSD_version < 501113)) || defined(__bsdi__)
+ char tname [16];
++#endif
+ char name [32];
+
+ union {
+@@ -101,12 +105,12 @@ glibtop_get_netload_p (glibtop *server,
+ &ifnetaddr, sizeof (ifnetaddr)) != sizeof (ifnetaddr))
+ glibtop_error_io_r (server, "kvm_read (ifnet)");
+
+- ifaddraddr = 0;
+- while (ifnetaddr || ifaddraddr) {
++ while (ifnetaddr) {
+ struct sockaddr_in *sin;
+ register char *cp;
++ u_long ifaddraddr;
+
+- if (ifaddraddr == 0) {
++ {
+ ifnetfound = ifnetaddr;
+
+ if (kvm_read (server->machine.kd, ifnetaddr, &ifnet,
+@@ -151,7 +155,11 @@ glibtop_get_netload_p (glibtop *server,
+ buf->if_flags |= (1L << GLIBTOP_IF_FLAGS_LOOPBACK);
+ if (ifnet.if_flags & IFF_POINTOPOINT)
+ buf->if_flags |= (1L << GLIBTOP_IF_FLAGS_POINTOPOINT);
++#ifdef IFF_DRV_RUNNING
++ if (ifnet.if_drv_flags & IFF_DRV_RUNNING)
++#else
+ if (ifnet.if_flags & IFF_RUNNING)
++#endif
+ buf->if_flags |= (1L << GLIBTOP_IF_FLAGS_RUNNING);
+ if (ifnet.if_flags & IFF_NOARP)
+ buf->if_flags |= (1L << GLIBTOP_IF_FLAGS_NOARP);
+@@ -159,7 +167,11 @@ glibtop_get_netload_p (glibtop *server,
+ buf->if_flags |= (1L << GLIBTOP_IF_FLAGS_PROMISC);
+ if (ifnet.if_flags & IFF_ALLMULTI)
+ buf->if_flags |= (1L << GLIBTOP_IF_FLAGS_ALLMULTI);
++#ifdef IFF_DRV_OACTIVE
++ if (ifnet.if_drv_flags & IFF_DRV_OACTIVE)
++#else
+ if (ifnet.if_flags & IFF_OACTIVE)
++#endif
+ buf->if_flags |= (1L << GLIBTOP_IF_FLAGS_OACTIVE);
+ if (ifnet.if_flags & IFF_SIMPLEX)
+ buf->if_flags |= (1L << GLIBTOP_IF_FLAGS_SIMPLEX);
+@@ -191,7 +203,7 @@ glibtop_get_netload_p (glibtop *server,
+ buf->collisions = ifnet.if_collisions;
+ buf->flags = _glibtop_sysdeps_netload;
+
+- if (ifaddraddr) {
++ while (ifaddraddr) {
+ if ((kvm_read (server->machine.kd, ifaddraddr, &ifaddr,
+ sizeof (ifaddr)) != sizeof (ifaddr)))
+ glibtop_error_io_r (server, "kvm_read (ifaddraddr)");
+@@ -201,7 +213,12 @@ glibtop_get_netload_p (glibtop *server,
+ CP(&ifaddr);
+ sa = (struct sockaddr *)cp;
+
+- if (sa->sa_family == AF_INET) {
++ if (sa->sa_family == AF_LINK) {
++ struct sockaddr_dl *dl = (struct sockaddr_dl *) sa;
++
++ memcpy (buf->hwaddress, LLADDR (dl), sizeof (buf->hwaddress));
++ buf->flags |= GLIBTOP_NETLOAD_HWADDRESS;
++ } else if (sa->sa_family == AF_INET) {
+ sin = (struct sockaddr_in *)sa;
+ #if !defined(__bsdi__)
+ /* Commenting out to "fix" #13345. */
+@@ -211,8 +228,14 @@ glibtop_get_netload_p (glibtop *server,
+ buf->mtu = ifnet.if_mtu;
+
+ buf->flags |= _glibtop_sysdeps_netload_data;
++ } else if (sa->sa_family == AF_INET6) {
++ struct sockaddr_in6 *sin6 = (struct sockaddr_in6 *) sa;
+
++ memcpy (buf->address6, &sin6->sin6_addr, sizeof (buf->address6));
++ buf->flags |= GLIBTOP_NETLOAD_ADDRESS6;
+ }
++ /* FIXME prefix6, scope6 */
++ ifaddraddr = (u_long) ifaddr.ifa.ifa_link.tqe_next;
+ }
+ return;
+ }
diff --git a/devel/libgtop/files/patch-sysdeps_freebsd_siglist.c b/devel/libgtop/files/patch-sysdeps_freebsd_siglist.c
new file mode 100644
index 000000000..6881723bd
--- /dev/null
+++ b/devel/libgtop/files/patch-sysdeps_freebsd_siglist.c
@@ -0,0 +1,41 @@
+--- sysdeps/freebsd/siglist.c.orig Fri Jan 20 02:56:40 2006
++++ sysdeps/freebsd/siglist.c Fri Jan 20 02:56:44 2006
+@@ -26,4 +26,37 @@
+ #include <glibtop/signal.h>
+
+ const glibtop_signame glibtop_sys_siglist [] =
+-{ { 0, NULL, NULL } };
++{ { 1, "SIGHUP", "Hangup" },
++ { 2, "SIGINT", "Interrupt" },
++ { 3, "SIGQUIT", "Quit" },
++ { 4, "SIGILL", "Illegal Instruction" },
++ { 5, "SIGTRAP", "Trace/Breakpoint Trap" },
++ { 6, "SIGABRT", "Abort" },
++ { 7, "SIGEMT", "Emulation Trap" },
++ { 8, "SIGFPE", "Arithmetic Exception" },
++ { 9, "SIGKILL", "Killed" },
++ { 10, "SIGBUS", "Bus Error" },
++ { 11, "SIGSEGV", "Segmentation Fault" },
++ { 12, "SIGSYS", "Bad System Call" },
++ { 13, "SIGPIPE", "Broken Pipe" },
++ { 14, "SIGALRM", "Alarm Clock" },
++ { 15, "SIGTERM", "Terminated" },
++ { 16, "SIGURG", "Urgent Condition Present On Socket" },
++ { 17, "SIGSTOP", "Stop (cannot be caught or ignored)" },
++ { 18, "SIGTSTP", "Stop Signal Generated From Keyboard" },
++ { 19, "SIGCONT", "Continue After Stop" },
++ { 20, "SIGCHLD", "Child Status Has Changed" },
++ { 21, "SIGTTIN", "Background Read Attempted From Control Terminal" },
++ { 22, "SIGTTOU", "Background Write Attempted To Control Terminal" },
++ { 23, "SIGIO", "I/O Is Possible On A Descriptor" },
++ { 24, "SIGXCPU", "CPU Time Limit Exceeded" },
++ { 25, "SIGXFSZ", "File Size Limit Exceeded" },
++ { 26, "SIGVTALRM","Virtual Time Alarm" },
++ { 27, "SIGPROF", "Profiling Timer Alarm" },
++ { 28, "SIGWINCH","Window Size Change" },
++ { 29, "SIGINFO", "Status Request From Keyboard" },
++ { 30, "SIGUSR1", "User Defined Signal 1" },
++ { 31, "SIGUSR2", "User Defined Signal 2" },
++ { 32, "SIGTHR", "Thread Interrupt" },
++ { 0, NULL, NULL }
++};
diff --git a/devel/libgtop/files/patch-systeps::freebsd::prockernel.c b/devel/libgtop/files/patch-systeps::freebsd::prockernel.c
new file mode 100644
index 000000000..f23b1cdae
--- /dev/null
+++ b/devel/libgtop/files/patch-systeps::freebsd::prockernel.c
@@ -0,0 +1,15 @@
+--- sysdeps/freebsd/prockernel.c Mon Jul 19 05:33:56 2004
++++ sysdeps/freebsd/prockernel.c.orig Sat Mar 19 02:39:47 2005
+@@ -115,8 +115,10 @@
+
+ /* Get the process information */
+ pinfo = kvm_getprocs (server->machine.kd, KERN_PROC_PID, pid, &count);
+- if ((pinfo == NULL) || (count != 1))
+- glibtop_error_io_r (server, "kvm_getprocs (%d)", pid);
++ if ((pinfo == NULL) || (count != 1)) {
++ glibtop_warn_io_r (server, "kvm_getprocs (%d)", pid);
++ return;
++ }
+
+ #if defined(__FreeBSD__) && (__FreeBSD_version >= 500013)
+
diff --git a/devel/libgtop/files/patch-systeps::freebsd::procmap.c b/devel/libgtop/files/patch-systeps::freebsd::procmap.c
new file mode 100644
index 000000000..43923f3ba
--- /dev/null
+++ b/devel/libgtop/files/patch-systeps::freebsd::procmap.c
@@ -0,0 +1,155 @@
+--- sysdeps/freebsd/procmap.c.orig Mon Dec 12 19:09:39 2005
++++ sysdeps/freebsd/procmap.c Tue May 2 12:46:49 2006
+@@ -108,14 +108,16 @@
+ #else
+ struct vm_object object;
+ #endif
+- glibtop_map_entry *maps;
++ GArray *maps = g_array_sized_new(FALSE, FALSE,
++ sizeof(glibtop_map_entry),
++ 100);
+ #if defined __FreeBSD__
+ struct vnode vnode;
+ #if __FreeBSD_version < 500039
+ struct inode inode;
+ #endif
+ #endif
+- int count, i = 0;
++ int count;
+ int update = 0;
+
+ glibtop_init_p (server, (1L << GLIBTOP_SYSDEPS_PROC_MAP), 0);
+@@ -123,15 +125,15 @@
+ memset (buf, 0, sizeof (glibtop_proc_map));
+
+ /* It does not work for the swapper task. */
+- if (pid == 0) return NULL;
++ if (pid == 0) return (glibtop_map_entry*) g_array_free(maps, TRUE);
+
+ glibtop_suid_enter (server);
+
+ /* Get the process data */
+ pinfo = kvm_getprocs (server->machine.kd, KERN_PROC_PID, pid, &count);
+ if ((pinfo == NULL) || (count < 1)) {
+- glibtop_error_io_r (server, "kvm_getprocs (%d)", pid);
+- return NULL;
++ glibtop_warn_io_r (server, "kvm_getprocs (%d)", pid);
++ return (glibtop_map_entry*) g_array_free(maps, TRUE);
+ }
+
+ /* Now we get the memory maps. */
+@@ -159,8 +161,6 @@
+
+ buf->total = buf->number * buf->size;
+
+- maps = g_malloc0(buf->total);
+-
+ buf->flags = _glibtop_sysdeps_proc_map;
+
+ /* Walk through the `vm_map_entry' list ... */
+@@ -170,6 +170,10 @@
+ * to OBJT_DEFAULT so if seems this really works. */
+
+ do {
++ glibtop_map_entry *mentry;
++ unsigned long inum, dev;
++ guint len;
++
+ if (update) {
+ if (kvm_read (server->machine.kd,
+ (unsigned long) entry.next,
+@@ -197,22 +201,6 @@
+ #endif
+ #endif
+
+- maps [i].flags = _glibtop_sysdeps_map_entry;
+-
+- maps [i].start = entry.start;
+- maps [i].end = entry.end;
+- maps [i].offset = entry.offset;
+-
+- maps [i].perm = 0;
+-
+- if (entry.protection & VM_PROT_READ)
+- maps [i].perm |= GLIBTOP_MAP_PERM_READ;
+- if (entry.protection & VM_PROT_WRITE)
+- maps [i].perm |= GLIBTOP_MAP_PERM_WRITE;
+- if (entry.protection & VM_PROT_EXECUTE)
+- maps [i].perm |= GLIBTOP_MAP_PERM_EXECUTE;
+-
+- i++;
+
+ #if defined(__NetBSD__) && (__NetBSD_Version__ >= 104000000)
+ if (!entry.object.uvm_obj)
+@@ -224,7 +212,7 @@
+ (unsigned long) entry.object.uvm_obj,
+ &vnode, sizeof (vnode)) != sizeof (vnode)) {
+ glibtop_warn_io_r (server, "kvm_read (vnode)");
+- return NULL;
++ return (glibtop_map_entry*) g_array_free(maps, TRUE);
+ }
+ #else
+ if (!entry.object.vm_object)
+@@ -251,8 +239,8 @@
+ &inode, sizeof (inode)) != sizeof (inode))
+ glibtop_error_io_r (server, "kvm_read (inode)");
+
+- maps [i-1].inode = inode.i_number;
+- maps [i-1].device = inode.i_dev;
++ inum = inode.i_number;
++ dev = inode.i_dev;
+ #endif
+
+
+@@ -274,8 +262,8 @@
+ switch (vnode.v_type) {
+ case VREG:
+ #if __FreeBSD_version < 600006
+- maps [i-1].inode = vnode.v_cachedid;
+- maps [i-1].device = vnode.v_cachedfs;
++ inum = vnode.v_cachedid;
++ dev = vnode.v_cachedfs;
+ #endif
+ default:
+ continue;
+@@ -289,11 +277,37 @@
+ &inode, sizeof (inode)) != sizeof (inode))
+ glibtop_error_io_r (server, "kvm_read (inode)");
+
+- maps [i-1].inode = inode.i_number;
+- maps [i-1].device = inode.i_dev;
++ inum = inode.i_number;
++ dev = inode.i_dev;
+ #endif
+ #endif
++ len = maps->len;
++ g_array_set_size(maps, len + 1);
++ mentry = &g_array_index(maps, glibtop_map_entry, len);
++
++ mentry->flags = _glibtop_sysdeps_map_entry;
++
++ mentry->start = (guint64) entry.start;
++ mentry->end = (guint64) entry.end;
++ mentry->offset = (guint64) entry.offset;
++ mentry->device = (guint64) dev;
++ mentry->inode = (guint64) inum;
++
++ mentry->perm = (guint64) 0;
++
++ if (entry.protection & VM_PROT_READ)
++ mentry->perm |= GLIBTOP_MAP_PERM_READ;
++ if (entry.protection & VM_PROT_WRITE)
++ mentry->perm |= GLIBTOP_MAP_PERM_WRITE;
++ if (entry.protection & VM_PROT_EXECUTE)
++ mentry->perm |= GLIBTOP_MAP_PERM_EXECUTE;
+ } while (entry.next != first);
+
+- return maps;
++ buf->flags = _glibtop_sysdeps_proc_map;
++
++ buf->number = maps->len;
++ buf->size = sizeof (glibtop_map_entry);
++ buf->total = buf->number * buf->size;
++
++ return (glibtop_map_entry*) g_array_free(maps, FALSE);
+ }
diff --git a/devel/libgtop/files/patch-systeps::freebsd::proctime.c b/devel/libgtop/files/patch-systeps::freebsd::proctime.c
new file mode 100644
index 000000000..9857d6cb8
--- /dev/null
+++ b/devel/libgtop/files/patch-systeps::freebsd::proctime.c
@@ -0,0 +1,31 @@
+--- sysdeps/freebsd/proctime.c.orig Wed Feb 23 03:20:45 2005
++++ sysdeps/freebsd/proctime.c Tue Aug 2 12:49:38 2005
+@@ -146,8 +146,10 @@ glibtop_get_proc_time_p (glibtop *server
+
+ /* Get the process information */
+ pinfo = kvm_getprocs (server->machine.kd, KERN_PROC_PID, pid, &count);
+- if ((pinfo == NULL) || (count != 1))
+- glibtop_error_io_r (server, "kvm_getprocs (%d)", pid);
++ if ((pinfo == NULL) || (count != 1)) {
++ glibtop_warn_io_r (server, "kvm_getprocs (%d)", pid);
++ return;
++ }
+
+ #if defined(__FreeBSD__) && (__FreeBSD_version >= 500013)
+ buf->rtime = pinfo [0].ki_runtime;
+@@ -193,9 +195,13 @@ glibtop_get_proc_time_p (glibtop *server
+ if ((pinfo [0].ki_flag & P_INMEM)) {
+ #endif
+ buf->utime = pinfo [0].ki_runtime;
+- buf->stime = 0; /* XXX */
++ buf->stime = tv2sec (pinfo [0].ki_rusage.ru_stime);
+ buf->cutime = tv2sec (pinfo [0].ki_childtime);
+- buf->cstime = 0; /* XXX */
++#if __FreeBSD_version >= 600000
++ buf->cstime = tv2sec (pinfo [0].ki_rusage_ch.ru_stime);
++#else
++ buf->cstime = 0;
++#endif
+ buf->start_time = tv2sec (pinfo [0].ki_start);
+ buf->flags = _glibtop_sysdeps_proc_time_user;
+ }
diff --git a/devel/libgtop/files/pkg-message b/devel/libgtop/files/pkg-message
new file mode 100644
index 000000000..dacaf62a9
--- /dev/null
+++ b/devel/libgtop/files/pkg-message
@@ -0,0 +1,13 @@
+===============================================================================
+
+In order to use the File System read/write monitor, you must chmod
+/dev/devstat so that all users can open it read-only. For example:
+
+# chmod 0444 /dev/devstat
+
+In order for this to persist across reboots, add the following to
+/etc/devfs.conf:
+
+perm devstat 0444
+
+===============================================================================
diff --git a/devel/libgtop/pkg-descr b/devel/libgtop/pkg-descr
new file mode 100644
index 000000000..f263f1127
--- /dev/null
+++ b/devel/libgtop/pkg-descr
@@ -0,0 +1,3 @@
+This library provides the backend for gtop2, a GNOME 2.0 version
+of top(1) that allows display and manipulation of running
+processes.
diff --git a/devel/libgtop/pkg-plist b/devel/libgtop/pkg-plist
new file mode 100644
index 000000000..020a91183
--- /dev/null
+++ b/devel/libgtop/pkg-plist
@@ -0,0 +1,129 @@
+bin/libgtop_daemon2
+bin/libgtop_server2
+include/libgtop-2.0/glibtop.h
+include/libgtop-2.0/glibtop/close.h
+include/libgtop-2.0/glibtop/command.h
+include/libgtop-2.0/glibtop/cpu.h
+include/libgtop-2.0/glibtop/fsusage.h
+include/libgtop-2.0/glibtop/global.h
+include/libgtop-2.0/glibtop/gnuserv.h
+include/libgtop-2.0/glibtop/inodedb.h
+include/libgtop-2.0/glibtop/loadavg.h
+include/libgtop-2.0/glibtop/mem.h
+include/libgtop-2.0/glibtop/mountlist.h
+include/libgtop-2.0/glibtop/msg_limits.h
+include/libgtop-2.0/glibtop/netlist.h
+include/libgtop-2.0/glibtop/netload.h
+include/libgtop-2.0/glibtop/open.h
+include/libgtop-2.0/glibtop/parameter.h
+include/libgtop-2.0/glibtop/ppp.h
+include/libgtop-2.0/glibtop/procargs.h
+include/libgtop-2.0/glibtop/prockernel.h
+include/libgtop-2.0/glibtop/proclist.h
+include/libgtop-2.0/glibtop/procmap.h
+include/libgtop-2.0/glibtop/procmem.h
+include/libgtop-2.0/glibtop/procopenfiles.h
+include/libgtop-2.0/glibtop/procsegment.h
+include/libgtop-2.0/glibtop/procsignal.h
+include/libgtop-2.0/glibtop/procstate.h
+include/libgtop-2.0/glibtop/proctime.h
+include/libgtop-2.0/glibtop/procuid.h
+include/libgtop-2.0/glibtop/sem_limits.h
+include/libgtop-2.0/glibtop/shm_limits.h
+include/libgtop-2.0/glibtop/signal.h
+include/libgtop-2.0/glibtop/swap.h
+include/libgtop-2.0/glibtop/sysdeps.h
+include/libgtop-2.0/glibtop/sysinfo.h
+include/libgtop-2.0/glibtop/union.h
+include/libgtop-2.0/glibtop/uptime.h
+include/libgtop-2.0/glibtop/version.h
+include/libgtop-2.0/glibtop_machine.h
+include/libgtop-2.0/glibtop_server.h
+include/libgtop-2.0/glibtop_suid.h
+include/libgtop-2.0/libgtopconfig.h
+lib/libgtop-2.0.a
+lib/libgtop-2.0.la
+lib/libgtop-2.0.so
+lib/libgtop-2.0.so.7
+libdata/pkgconfig/libgtop-2.0.pc
+share/locale/am/LC_MESSAGES/libgtop-2.0.mo
+share/locale/ar/LC_MESSAGES/libgtop-2.0.mo
+share/locale/az/LC_MESSAGES/libgtop-2.0.mo
+share/locale/be/LC_MESSAGES/libgtop-2.0.mo
+share/locale/bg/LC_MESSAGES/libgtop-2.0.mo
+share/locale/bn/LC_MESSAGES/libgtop-2.0.mo
+share/locale/bs/LC_MESSAGES/libgtop-2.0.mo
+share/locale/ca/LC_MESSAGES/libgtop-2.0.mo
+share/locale/cs/LC_MESSAGES/libgtop-2.0.mo
+share/locale/cy/LC_MESSAGES/libgtop-2.0.mo
+share/locale/da/LC_MESSAGES/libgtop-2.0.mo
+share/locale/de/LC_MESSAGES/libgtop-2.0.mo
+share/locale/el/LC_MESSAGES/libgtop-2.0.mo
+share/locale/en_CA/LC_MESSAGES/libgtop-2.0.mo
+share/locale/en_GB/LC_MESSAGES/libgtop-2.0.mo
+share/locale/es/LC_MESSAGES/libgtop-2.0.mo
+share/locale/et/LC_MESSAGES/libgtop-2.0.mo
+share/locale/eu/LC_MESSAGES/libgtop-2.0.mo
+share/locale/fa/LC_MESSAGES/libgtop-2.0.mo
+share/locale/fi/LC_MESSAGES/libgtop-2.0.mo
+share/locale/fr/LC_MESSAGES/libgtop-2.0.mo
+share/locale/ga/LC_MESSAGES/libgtop-2.0.mo
+share/locale/gl/LC_MESSAGES/libgtop-2.0.mo
+share/locale/gu/LC_MESSAGES/libgtop-2.0.mo
+share/locale/he/LC_MESSAGES/libgtop-2.0.mo
+share/locale/hi/LC_MESSAGES/libgtop-2.0.mo
+share/locale/hr/LC_MESSAGES/libgtop-2.0.mo
+share/locale/hu/LC_MESSAGES/libgtop-2.0.mo
+share/locale/id/LC_MESSAGES/libgtop-2.0.mo
+share/locale/it/LC_MESSAGES/libgtop-2.0.mo
+share/locale/ja/LC_MESSAGES/libgtop-2.0.mo
+share/locale/ka/LC_MESSAGES/libgtop-2.0.mo
+share/locale/ko/LC_MESSAGES/libgtop-2.0.mo
+share/locale/ku/LC_MESSAGES/libgtop-2.0.mo
+share/locale/ky/LC_MESSAGES/libgtop-2.0.mo
+share/locale/lt/LC_MESSAGES/libgtop-2.0.mo
+share/locale/lv/LC_MESSAGES/libgtop-2.0.mo
+share/locale/mi/LC_MESSAGES/libgtop-2.0.mo
+share/locale/mk/LC_MESSAGES/libgtop-2.0.mo
+share/locale/ml/LC_MESSAGES/libgtop-2.0.mo
+share/locale/mn/LC_MESSAGES/libgtop-2.0.mo
+share/locale/ms/LC_MESSAGES/libgtop-2.0.mo
+share/locale/nb/LC_MESSAGES/libgtop-2.0.mo
+share/locale/ne/LC_MESSAGES/libgtop-2.0.mo
+share/locale/nl/LC_MESSAGES/libgtop-2.0.mo
+share/locale/nn/LC_MESSAGES/libgtop-2.0.mo
+share/locale/no/LC_MESSAGES/libgtop-2.0.mo
+share/locale/or/LC_MESSAGES/libgtop-2.0.mo
+share/locale/pa/LC_MESSAGES/libgtop-2.0.mo
+share/locale/pl/LC_MESSAGES/libgtop-2.0.mo
+share/locale/pt/LC_MESSAGES/libgtop-2.0.mo
+share/locale/pt_BR/LC_MESSAGES/libgtop-2.0.mo
+share/locale/ro/LC_MESSAGES/libgtop-2.0.mo
+share/locale/ru/LC_MESSAGES/libgtop-2.0.mo
+share/locale/rw/LC_MESSAGES/libgtop-2.0.mo
+share/locale/sk/LC_MESSAGES/libgtop-2.0.mo
+share/locale/sl/LC_MESSAGES/libgtop-2.0.mo
+share/locale/sq/LC_MESSAGES/libgtop-2.0.mo
+share/locale/sr/LC_MESSAGES/libgtop-2.0.mo
+share/locale/sr@Latn/LC_MESSAGES/libgtop-2.0.mo
+share/locale/sv/LC_MESSAGES/libgtop-2.0.mo
+share/locale/ta/LC_MESSAGES/libgtop-2.0.mo
+share/locale/th/LC_MESSAGES/libgtop-2.0.mo
+share/locale/tr/LC_MESSAGES/libgtop-2.0.mo
+share/locale/uk/LC_MESSAGES/libgtop-2.0.mo
+share/locale/vi/LC_MESSAGES/libgtop-2.0.mo
+share/locale/xh/LC_MESSAGES/libgtop-2.0.mo
+share/locale/zh_CN/LC_MESSAGES/libgtop-2.0.mo
+share/locale/zh_TW/LC_MESSAGES/libgtop-2.0.mo
+@dirrm include/libgtop-2.0/glibtop
+@dirrm include/libgtop-2.0
+@dirrmtry share/locale/xh/LC_MESSAGES
+@dirrmtry share/locale/xh
+@dirrmtry share/locale/rw/LC_MESSAGES
+@dirrmtry share/locale/rw
+@dirrmtry share/locale/mi/LC_MESSAGES
+@dirrmtry share/locale/mi
+@dirrmtry share/locale/ky/LC_MESSAGES
+@dirrmtry share/locale/ky
+@dirrmtry share/locale/ku/LC_MESSAGES
+@dirrmtry share/locale/ku