diff options
author | wiz <wiz@pkgsrc.org> | 2002-03-24 18:04:57 +0000 |
---|---|---|
committer | wiz <wiz@pkgsrc.org> | 2002-03-24 18:04:57 +0000 |
commit | 159572ad3aba6d14c148d3c5ca97e0218c4161bf (patch) | |
tree | f30c1cc6cd15b6e26d4323954b9f4ff1a8191fcc /sysutils/wmcpuload | |
parent | 7335c5397fa57f4c16419b2676ebaedc194f2349 (diff) | |
download | pkgsrc-159572ad3aba6d14c148d3c5ca97e0218c4161bf.tar.gz |
Add wmcpuload, a windowmaker dockapp for showing CPU usage, provided
by Thomas Runge in pkg/16036, buildlinked by me.
Diffstat (limited to 'sysutils/wmcpuload')
-rw-r--r-- | sysutils/wmcpuload/DESCR | 1 | ||||
-rw-r--r-- | sysutils/wmcpuload/Makefile | 17 | ||||
-rw-r--r-- | sysutils/wmcpuload/PLIST | 3 | ||||
-rw-r--r-- | sysutils/wmcpuload/distinfo | 7 | ||||
-rw-r--r-- | sysutils/wmcpuload/patches/patch-aa | 26 | ||||
-rw-r--r-- | sysutils/wmcpuload/patches/patch-ab | 12 | ||||
-rw-r--r-- | sysutils/wmcpuload/patches/patch-ac | 67 |
7 files changed, 133 insertions, 0 deletions
diff --git a/sysutils/wmcpuload/DESCR b/sysutils/wmcpuload/DESCR new file mode 100644 index 00000000000..b6f240efb39 --- /dev/null +++ b/sysutils/wmcpuload/DESCR @@ -0,0 +1 @@ +A windowmaker dock app to monitor CPU usage. diff --git a/sysutils/wmcpuload/Makefile b/sysutils/wmcpuload/Makefile new file mode 100644 index 00000000000..081aeb20aad --- /dev/null +++ b/sysutils/wmcpuload/Makefile @@ -0,0 +1,17 @@ +# $NetBSD: Makefile,v 1.1.1.1 2002/03/24 18:04:57 wiz Exp $ +# + +DISTNAME= wmcpuload-0.9.0 +CATEGORIES= sysutils +MASTER_SITES= http://www.sh.rim.or.jp/~ssato/src/ + +MAINTAINER= coto@core.de +HOMEPAGE= http://www.sh.rim.or.jp/~ssato/dockapp/index.shtml +COMMENT= dockable CPU monitor + +GNU_CONFIGURE= YES +USE_BUILDLINK_ONLY= YES + +.include "../../graphics/xpm/buildlink.mk" +.include "../../mk/x11.buildlink.mk" +.include "../../mk/bsd.pkg.mk" diff --git a/sysutils/wmcpuload/PLIST b/sysutils/wmcpuload/PLIST new file mode 100644 index 00000000000..e5633f74218 --- /dev/null +++ b/sysutils/wmcpuload/PLIST @@ -0,0 +1,3 @@ +@comment $NetBSD: PLIST,v 1.1.1.1 2002/03/24 18:04:57 wiz Exp $ +bin/wmcpuload +man/man1/wmcpuload.1 diff --git a/sysutils/wmcpuload/distinfo b/sysutils/wmcpuload/distinfo new file mode 100644 index 00000000000..63dcf1edd7b --- /dev/null +++ b/sysutils/wmcpuload/distinfo @@ -0,0 +1,7 @@ +$NetBSD: distinfo,v 1.1.1.1 2002/03/24 18:04:57 wiz Exp $ + +SHA1 (wmcpuload-0.9.0.tar.gz) = 5883ebcc2f3c11f1ef498a6740a1edb3c52ea816 +Size (wmcpuload-0.9.0.tar.gz) = 99481 bytes +SHA1 (patch-aa) = 4844c1927eb72d5f0599d6a26a040023d2845feb +SHA1 (patch-ab) = 42e9fabebfe23120d70ddff8b3e1b5bfd322fbbb +SHA1 (patch-ac) = cbedd3d888a1fdf70fdd03621f917949cf5c037c diff --git a/sysutils/wmcpuload/patches/patch-aa b/sysutils/wmcpuload/patches/patch-aa new file mode 100644 index 00000000000..281a666ec7c --- /dev/null +++ b/sysutils/wmcpuload/patches/patch-aa @@ -0,0 +1,26 @@ +$NetBSD: patch-aa,v 1.1.1.1 2002/03/24 18:04:58 wiz Exp $ + +--- configure.orig Sat Mar 23 18:10:00 2002 ++++ configure +@@ -3880,8 +3880,8 @@ + + XLIBS="-lX11 $X_EXTRA_LIBS" + +-lib_search_path="$lib_search_path $XLFLAGS -L/usr/local/lib" +-inc_search_path="$inc_search_path $XCFLAGS -I/usr/local/include" ++lib_search_path="$lib_search_path $XLFLAGS" ++inc_search_path="$inc_search_path $XCFLAGS" + + + +@@ -4359,6 +4359,10 @@ + ;; + openbsd*) + OS=openbsd ++ ignore_nice=yes ++ ;; ++netbsd*) ++ OS=netbsd + ignore_nice=yes + ;; + solaris*) diff --git a/sysutils/wmcpuload/patches/patch-ab b/sysutils/wmcpuload/patches/patch-ab new file mode 100644 index 00000000000..401bb94d672 --- /dev/null +++ b/sysutils/wmcpuload/patches/patch-ab @@ -0,0 +1,12 @@ +$NetBSD: patch-ab,v 1.1.1.1 2002/03/24 18:04:57 wiz Exp $ + +--- src/Makefile.am.orig Sat Mar 23 10:19:34 2002 ++++ src/Makefile.am +@@ -14,6 +14,7 @@ + cpu_linux.c \ + cpu_freebsd.c \ + cpu_openbsd.c \ ++ cpu_netbsd.c \ + cpu_solaris.c \ + cpu_cygwin.c + diff --git a/sysutils/wmcpuload/patches/patch-ac b/sysutils/wmcpuload/patches/patch-ac new file mode 100644 index 00000000000..f018cbfb0ab --- /dev/null +++ b/sysutils/wmcpuload/patches/patch-ac @@ -0,0 +1,67 @@ +$NetBSD: patch-ac,v 1.1.1.1 2002/03/24 18:04:57 wiz Exp $ + +--- src/cpu_netbsd.c.orig Sun Mar 24 18:18:37 2002 ++++ src/cpu_netbsd.c +@@ -0,0 +1,62 @@ ++/* ++ * cpu_netbsd - module to get cpu usage, for NetBSD ++ * ++ * Copyright (C) 2001, 2002 Seiichi SATO <ssato@sh.rim.or.jp> ++ * ++ * Licensed under the GPL ++ */ ++ ++#ifdef HAVE_CONFIG_H ++#include "config.h" ++#endif ++ ++#include <stdio.h> ++#include <unistd.h> ++#include <stdlib.h> ++#include <string.h> ++#include "cpu.h" ++ ++#include <sys/types.h> ++#include <sys/param.h> ++#include <sys/sysctl.h> ++#include <sys/sched.h> ++ ++void cpu_init(void) ++{ ++ /* You don't need initialization under NetBSD */ ++ return; ++} ++ ++/* Returns the current CPU usage in percent */ ++int cpu_get_usage(struct cpu_options *opts) ++{ ++ int total, used, result; ++ static int pre_total, pre_used; ++ ++ int mib[] = { CTL_KERN, KERN_CP_TIME }; ++ u_int64_t cpu_time[CPUSTATES]; ++ size_t size = sizeof(cpu_time); ++ ++ /* get cpu time*/ ++ if (sysctl(mib, 2, &cpu_time, &size, NULL, 0) < 0) ++ return 0; ++ ++ /* calc usage */ ++ used = cpu_time[CP_USER] + cpu_time[CP_SYS]; ++ if (!opts->ignore_nice) ++ used += cpu_time[CP_NICE]; ++ total = used + cpu_time[CP_IDLE]; ++ ++ if (pre_total == 0) ++ result = 0; ++ else if ((total - pre_total) > 0) ++ result = 100 * (double)(used - pre_used) / (double)(total - pre_total); ++ else ++ result = 0; ++ ++ /* save used/total for next calculation */ ++ pre_used = used; ++ pre_total = total; ++ ++ return result; ++} |