summaryrefslogtreecommitdiff
path: root/net
diff options
context:
space:
mode:
authorjoerg <joerg>2006-01-25 17:00:25 +0000
committerjoerg <joerg>2006-01-25 17:00:25 +0000
commitb49619b7639df6b777225984643ec9b45a98090c (patch)
tree45effc1a1923cc1ba21062a7db568a478f1ea5a7 /net
parentc2f434b1a692c4f986251744ca267f22ab4a2475 (diff)
downloadpkgsrc-b49619b7639df6b777225984643ec9b45a98090c.tar.gz
Add DragonFly support.
Diffstat (limited to 'net')
-rw-r--r--net/upclient/Makefile7
-rw-r--r--net/upclient/distinfo6
-rw-r--r--net/upclient/patches/patch-ac56
-rw-r--r--net/upclient/patches/patch-ae13
4 files changed, 72 insertions, 10 deletions
diff --git a/net/upclient/Makefile b/net/upclient/Makefile
index 1efdea34872..367e9798232 100644
--- a/net/upclient/Makefile
+++ b/net/upclient/Makefile
@@ -1,4 +1,4 @@
-# $NetBSD: Makefile,v 1.23 2005/12/29 06:22:04 jlam Exp $
+# $NetBSD: Makefile,v 1.24 2006/01/25 17:00:25 joerg Exp $
#
DISTNAME= upclient-4.2.1.23
@@ -10,8 +10,13 @@ MAINTAINER= tech-pkg@NetBSD.org
HOMEPAGE= http://uptimes.hostingwired.com/
COMMENT= Keeps track of your server uptime, and compares it to other hosts
+.include "../../mk/bsd.prefs.mk"
+.if ${OPSYS} == "DragonFly"
+BUILD_TARGET= dragonfly
+.else
BUILD_TARGET= bsd
+.endif
EGDIR= ${PREFIX}/share/examples/upclient
CONF_FILES= ${EGDIR}/upclient.conf ${PKG_SYSCONFDIR}/upclient.conf
diff --git a/net/upclient/distinfo b/net/upclient/distinfo
index bf3e918eeff..62736f7bca1 100644
--- a/net/upclient/distinfo
+++ b/net/upclient/distinfo
@@ -1,10 +1,10 @@
-$NetBSD: distinfo,v 1.11 2005/02/24 12:14:06 agc Exp $
+$NetBSD: distinfo,v 1.12 2006/01/25 17:00:25 joerg Exp $
SHA1 (upclient-4.2.1.23.tar.gz) = c6595959c6a5058b03ab7096a6bf9c0dbfa4285a
RMD160 (upclient-4.2.1.23.tar.gz) = bc5df520a6ab73049ab45bf2d3ed230a80bf561e
Size (upclient-4.2.1.23.tar.gz) = 29386 bytes
SHA1 (patch-aa) = 2e1dacd293b69e0d2338e1a316d7d1d7015447c2
SHA1 (patch-ab) = dd1e318cee6e27fcf433b2123cf8f3f6ed8eb548
-SHA1 (patch-ac) = ffd0c20defee33e94d6ea03d8b319e1e4cb60d23
+SHA1 (patch-ac) = af4554784197dd7c2a15a23cda516bc08bf662c0
SHA1 (patch-ad) = 57aac6d38f7f4fcdc1b4545d2f6df0815a9db496
-SHA1 (patch-ae) = 37bc453a9193635eb9e7062c40674c2308d8fc79
+SHA1 (patch-ae) = c21c66c00e8be45407d462ba0cf0223a5b9a703b
diff --git a/net/upclient/patches/patch-ac b/net/upclient/patches/patch-ac
index 918dc8550eb..a2de2c3e4cc 100644
--- a/net/upclient/patches/patch-ac
+++ b/net/upclient/patches/patch-ac
@@ -1,9 +1,16 @@
-$NetBSD: patch-ac,v 1.6 2002/05/09 13:50:06 enami Exp $
+$NetBSD: patch-ac,v 1.7 2006/01/25 17:00:25 joerg Exp $
---- src/stats-bsd.c.orig Sun Jun 17 04:12:53 2001
+--- src/stats-bsd.c.orig 2001-06-16 19:12:53.000000000 +0000
+++ src/stats-bsd.c
-@@ -21,6 +21,9 @@
+@@ -18,9 +18,16 @@
+ #include <syslog.h>
+ #include <sys/time.h>
+ #include <sys/param.h>
++#if defined(__DragonFly__)
++#include <kinfo.h>
++#else
#include <sys/dkstat.h>
++#endif
#include <sys/sysctl.h>
#include <sys/utsname.h>
+#if defined(__NetBSD__) && __NetBSD_Version__ >= 104000000
@@ -12,3 +19,46 @@ $NetBSD: patch-ac,v 1.6 2002/05/09 13:50:06 enami Exp $
/**
* @desc Get statistics
+@@ -75,6 +82,35 @@ void getstats(unsigned long *puptime, do
+ }
+
+ if(cfg_sendidle) {
++#if defined(__DragonFly__)
++ static int first_time = 1;
++ static struct kinfo_cputime scp;
++ struct kinfo_cputime cp;
++
++ if (first_time) {
++ first_time = 0;
++ if (kinfo_get_sched_cputime(&scp))
++ warn("kinfo_get_sched_cputime");
++ else
++ sleep(1); /* to avoid the initial 0 idle value */
++ }
++ if (kinfo_get_sched_cputime(&cp))
++ warn("kinfo_get_sched_cputime");
++ else {
++ double time = 0.0;
++ time += cp.cp_user - scp.cp_user;
++ time += cp.cp_nice - scp.cp_nice;
++ time += cp.cp_sys - scp.cp_sys;
++ time += cp.cp_intr - scp.cp_intr;
++ time += cp.cp_idle - scp.cp_idle;
++
++ if (time == 0.0)
++ time = 1.0;
++
++ *pidle = (cp.cp_idle - scp.cp_idle) * 100.0 / time;
++ scp = cp;
++ }
++#else
+ static kvm_t *kp;
+ static int initialized = 0;
+ static struct nlist namelist [] = {
+@@ -131,5 +167,6 @@ void getstats(unsigned long *puptime, do
+ } else {
+ cfg_sendidle = 0;
+ }
++#endif
+ }
+ }
diff --git a/net/upclient/patches/patch-ae b/net/upclient/patches/patch-ae
index 66ed3aafaaf..d2153f6d9d5 100644
--- a/net/upclient/patches/patch-ae
+++ b/net/upclient/patches/patch-ae
@@ -1,8 +1,8 @@
-$NetBSD: patch-ae,v 1.1 2003/07/02 18:22:43 jmmv Exp $
+$NetBSD: patch-ae,v 1.2 2006/01/25 17:00:25 joerg Exp $
---- src/Makefile.orig 2001-06-17 00:48:35.000000000 +0200
+--- src/Makefile.orig 2001-06-16 22:48:35.000000000 +0000
+++ src/Makefile
-@@ -36,10 +36,10 @@ nothing-specified:
+@@ -36,10 +36,17 @@ nothing-specified:
@echo ""
bsd:
@@ -13,6 +13,13 @@ $NetBSD: patch-ae,v 1.1 2003/07/02 18:22:43 jmmv Exp $
OBJECTS='stats-bsd.c $(STDOPTS)' \
- CFLAGS='-DPLATFORM_BSD -DCONFIGFILE=\"$(CONFIGFILE)\"' \
+ CFLAGS='$(CFLAGS) -DPLATFORM_BSD -DCONFIGFILE=\"$(CONFIGFILE)\"' \
++ upclient
++
++dragonfly:
++ $(MAKE) \
++ LDFLAGS='$(LDFLAGS) -lkinfo' \
++ OBJECTS='stats-bsd.c $(STDOPTS)' \
++ CFLAGS='$(CFLAGS) -DPLATFORM_BSD -DCONFIGFILE=\"$(CONFIGFILE)\"' \
upclient
darwin: