diff options
author | oliver <oliver@FreeBSD.org> | 2003-08-01 22:35:59 +0800 |
---|---|---|
committer | oliver <oliver@FreeBSD.org> | 2003-08-01 22:35:59 +0800 |
commit | 79d38f88e343b835f409e50fa08f5d7bbc7e0d72 (patch) | |
tree | 6cbfc1a9c0b81effb062923b8a6cdcabf1d0a377 /sysutils | |
parent | 338bde0281a87d5c0554e09d5205987e13740ad9 (diff) | |
download | freebsd-ports-gnome-79d38f88e343b835f409e50fa08f5d7bbc7e0d72.tar.gz freebsd-ports-gnome-79d38f88e343b835f409e50fa08f5d7bbc7e0d72.tar.zst freebsd-ports-gnome-79d38f88e343b835f409e50fa08f5d7bbc7e0d72.zip |
Add xfce4-systemload-plugin 0.3.2, system Load plugin for XFce4.
PR: 55133
Submitted by: Thorsten Greiner <thorsten.greiner@web.de>
Diffstat (limited to 'sysutils')
-rw-r--r-- | sysutils/Makefile | 1 | ||||
-rw-r--r-- | sysutils/xfce4-systemload-plugin/Makefile | 29 | ||||
-rw-r--r-- | sysutils/xfce4-systemload-plugin/distinfo | 1 | ||||
-rw-r--r-- | sysutils/xfce4-systemload-plugin/files/patch-configure | 21 | ||||
-rw-r--r-- | sysutils/xfce4-systemload-plugin/files/patch-memswap.c | 118 | ||||
-rw-r--r-- | sysutils/xfce4-systemload-plugin/pkg-descr | 3 | ||||
-rw-r--r-- | sysutils/xfce4-systemload-plugin/pkg-plist | 3 |
7 files changed, 176 insertions, 0 deletions
diff --git a/sysutils/Makefile b/sysutils/Makefile index f43701fb613a..071821866a8a 100644 --- a/sysutils/Makefile +++ b/sysutils/Makefile @@ -337,6 +337,7 @@ SUBDIR += xfce4-battery-plugin SUBDIR += xfce4-mcs-manager SUBDIR += xfce4-mcs-plugins + SUBDIR += xfce4-systemload-plugin SUBDIR += xfce4-utils SUBDIR += xfsm SUBDIR += xin diff --git a/sysutils/xfce4-systemload-plugin/Makefile b/sysutils/xfce4-systemload-plugin/Makefile new file mode 100644 index 000000000000..110ea648d8f2 --- /dev/null +++ b/sysutils/xfce4-systemload-plugin/Makefile @@ -0,0 +1,29 @@ +# New ports collection makefile for: xfce-systemload-plugin +# Date created: 31 June 2003 +# Whom: Thorsten Greiner <thorsten.greiner@web.de> +# +# $FreeBSD$ +# + +PORTNAME= xfce4-systemload-plugin +PORTVERSION= 0.3.2 +CATEGORIES= sysutils +MASTER_SITES= http://download.berlios.de/xfce-goodies/ +DIST_SUBDIR= xfce4 + +MAINTAINER= thorsten.greiner@web.de +COMMENT= System Load plugin for XFce4 + +BUILD_DEPENDS= xfce4-panel:${PORTSDIR}/x11-wm/xfce4-panel +LIB_DEPENDS= xml2.5:${PORTSDIR}/textproc/libxml2 \ + xfce4util.1:${PORTSDIR}/x11/libxfce4util \ + xfcegui4.1:${PORTSDIR}/x11-toolkits/libxfce4gui + +USE_GNOME= gtk20 +USE_X_PREFIX= yes +GNU_CONFIGURE= yes +USE_LIBTOOL= yes +INSTALLS_SHLIB= yes +CONFIGURE_TARGET= --build=${ARCH}-portbld-freebsd${OSREL} + +.include <bsd.port.mk> diff --git a/sysutils/xfce4-systemload-plugin/distinfo b/sysutils/xfce4-systemload-plugin/distinfo new file mode 100644 index 000000000000..515da2df2cf5 --- /dev/null +++ b/sysutils/xfce4-systemload-plugin/distinfo @@ -0,0 +1 @@ +MD5 (xfce4/xfce4-systemload-plugin-0.3.2.tar.gz) = 54f940ea77261bb61ca54dd77253c222 diff --git a/sysutils/xfce4-systemload-plugin/files/patch-configure b/sysutils/xfce4-systemload-plugin/files/patch-configure new file mode 100644 index 000000000000..a1d6a0e2fed0 --- /dev/null +++ b/sysutils/xfce4-systemload-plugin/files/patch-configure @@ -0,0 +1,21 @@ +--- configure.orig Wed Jul 23 22:20:56 2003 ++++ configure Fri Aug 1 12:56:48 2003 +@@ -19273,7 +19273,8 @@ + + + # This can be used to rebuild libtool when needed +-LIBTOOL_DEPS="$ac_aux_dir/ltmain.sh" ++LIBTOOL_DEPS="--disable-ltlibs /usr/local/share/libtool13/ltmain.sh" ++$ac_aux_dir/ltconfig $LIBTOOL_DEPS + + # Always use our own libtool. + LIBTOOL='$(SHELL) $(top_builddir)/libtool' +@@ -19567,7 +19568,7 @@ + + echo "$as_me:$LINENO: checking where to install panel plugins" >&5 + echo $ECHO_N "checking where to install panel plugins... $ECHO_C" >&6 +- XFCE4_PANEL_PLUGINSDIR=`$PKG_CONFIG --variable=pluginsdir xfce4-panel-1.0` ++ XFCE4_PANEL_PLUGINSDIR=${prefix}/lib/xfce4/panel-plugins + + echo "$as_me:$LINENO: result: $XFCE4_PANEL_PLUGINSDIR" >&5 + echo "${ECHO_T}$XFCE4_PANEL_PLUGINSDIR" >&6 diff --git a/sysutils/xfce4-systemload-plugin/files/patch-memswap.c b/sysutils/xfce4-systemload-plugin/files/patch-memswap.c new file mode 100644 index 000000000000..1d58d38bd145 --- /dev/null +++ b/sysutils/xfce4-systemload-plugin/files/patch-memswap.c @@ -0,0 +1,118 @@ +--- panel-plugin/memswap.c.orig Tue Jul 29 21:40:55 2003 ++++ panel-plugin/memswap.c Thu Jul 31 22:43:10 2003 +@@ -193,4 +193,113 @@ + + return 0; + } +-#endif +\ No newline at end of file ++#endif ++ ++#if defined(__FreeBSD__) ++/* ++ * This is inspired by /usr/src/usr.bin/top/machine.c ++ * ++ * Adapted by Thorsten Greiner <thorsten.greiner@web.de> ++ * ++ * Original authors: Christos Zoulas <christos@ee.cornell.edu> ++ * Steven Wallace <swallace@freebsd.org> ++ * Wolfram Schneider <wosch@FreeBSD.org> ++ * Thomas Moestl <tmoestl@gmx.net> ++ */ ++ ++#include <sys/types.h> ++#include <fcntl.h> ++#include <kvm.h> ++ ++#define GETSYSCTL(name, var) getsysctl(name, &(var), sizeof(var)) ++ ++static int getsysctl (char *name, void *ptr, size_t len) ++{ ++ size_t nlen = len; ++ if (sysctlbyname(name, ptr, &nlen, NULL, 0) == -1) { ++ return -1; ++ } ++ if (nlen != len) { ++ return -1; ++ } ++ return 0; ++} ++ ++static kvm_t *kd = NULL; ++ ++static int swapmode(int *retavail, int *retfree) ++{ ++ int n; ++ int pagesize = getpagesize(); ++ struct kvm_swap swapary[1]; ++ static int kd_init = TRUE; ++ ++ if(kd_init) { ++ kd_init = FALSE; ++ if ((kd = kvm_open("/dev/null", "/dev/null", "/dev/null", ++ O_RDONLY, "kvm_open")) == NULL) { ++ g_warning("Cannot read kvm."); ++ return -1; ++ } ++ } ++ if(kd == NULL) { ++ return -1; ++ } ++ ++ *retavail = 0; ++ *retfree = 0; ++ ++#define CONVERT(v) ((quad_t)(v) * pagesize / 1024) ++ ++ n = kvm_getswapinfo(kd, swapary, 1, 0); ++ if (n < 0 || swapary[0].ksw_total == 0) ++ return(0); ++ ++ *retavail = CONVERT(swapary[0].ksw_total); ++ *retfree = CONVERT(swapary[0].ksw_total - swapary[0].ksw_used); ++ ++ n = (int)((double)swapary[0].ksw_used * 100.0 / ++ (double)swapary[0].ksw_total); ++ return(n); ++} ++ ++gint read_memswap(gulong *mem, gulong *swap, gulong *MT, gulong *MU, gulong *ST, gulong *SU) ++{ ++ int total_pages; ++ int free_pages; ++ int inactive_pages; ++ int pagesize = getpagesize(); ++ int swap_avail; ++ int swap_free; ++ ++ if(GETSYSCTL("vm.stats.vm.v_page_count", total_pages)) { ++ g_warning("Cannot read sysctl \"vm.stats.vm.v_page_count\""); ++ return -1; ++ } ++ if(GETSYSCTL("vm.stats.vm.v_free_count", free_pages)) { ++ g_warning("Cannot read sysctl \"vm.stats.vm.v_free_count\""); ++ return -1; ++ } ++ if(GETSYSCTL("vm.stats.vm.v_inactive_count", inactive_pages)) { ++ g_warning("Cannot read sysctl \"vm.stats.vm.v_inactive_count\""); ++ return -1; ++ } ++ ++ *MT = (total_pages*pagesize) >> 10; ++ *MU = ((total_pages-free_pages-inactive_pages) * pagesize) >> 10; ++ *mem = *MU * 100 / *MT; ++ ++ if((*swap = swapmode(&swap_avail, &swap_free)) >= 0) { ++ *ST = swap_avail; ++ *SU = (swap_avail - swap_free); ++ } ++ else { ++ *swap = 0; ++ *ST = 0; ++ *SU = 0; ++ } ++ ++ return 0; ++} ++ ++#endif /* defined(__FREEBSD) */ diff --git a/sysutils/xfce4-systemload-plugin/pkg-descr b/sysutils/xfce4-systemload-plugin/pkg-descr new file mode 100644 index 000000000000..f1b5f306ba78 --- /dev/null +++ b/sysutils/xfce4-systemload-plugin/pkg-descr @@ -0,0 +1,3 @@ +System Load plugin for XFce4. + +WWW: http://www.xfce.org diff --git a/sysutils/xfce4-systemload-plugin/pkg-plist b/sysutils/xfce4-systemload-plugin/pkg-plist new file mode 100644 index 000000000000..4c8355d3cb32 --- /dev/null +++ b/sysutils/xfce4-systemload-plugin/pkg-plist @@ -0,0 +1,3 @@ +lib/xfce4/panel-plugins/libsystemload.so +@unexec rmdir %D/lib/xfce4/panel-plugins 2>/dev/null || true +@unexec rmdir %D/lib/xfce4 2>/dev/null || true |