pkgsrc-Changes-HG archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

[pkgsrc/trunk]: pkgsrc/net/upclient Add DragonFly support.



details:   https://anonhg.NetBSD.org/pkgsrc/rev/24001986bc30
branches:  trunk
changeset: 507051:24001986bc30
user:      joerg <joerg%pkgsrc.org@localhost>
date:      Wed Jan 25 17:00:25 2006 +0000

description:
Add DragonFly support.

diffstat:

 net/upclient/Makefile         |   7 ++++-
 net/upclient/distinfo         |   6 ++--
 net/upclient/patches/patch-ac |  56 ++++++++++++++++++++++++++++++++++++++++--
 net/upclient/patches/patch-ae |  13 +++++++--
 4 files changed, 72 insertions(+), 10 deletions(-)

diffs (139 lines):

diff -r 21a58d22b581 -r 24001986bc30 net/upclient/Makefile
--- a/net/upclient/Makefile     Wed Jan 25 16:39:13 2006 +0000
+++ b/net/upclient/Makefile     Wed Jan 25 17:00:25 2006 +0000
@@ -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 @@
 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 -r 21a58d22b581 -r 24001986bc30 net/upclient/distinfo
--- a/net/upclient/distinfo     Wed Jan 25 16:39:13 2006 +0000
+++ b/net/upclient/distinfo     Wed Jan 25 17:00:25 2006 +0000
@@ -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 -r 21a58d22b581 -r 24001986bc30 net/upclient/patches/patch-ac
--- a/net/upclient/patches/patch-ac     Wed Jan 25 16:39:13 2006 +0000
+++ b/net/upclient/patches/patch-ac     Wed Jan 25 17:00:25 2006 +0000
@@ -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 @@
  
  /**
   * @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 -r 21a58d22b581 -r 24001986bc30 net/upclient/patches/patch-ae
--- a/net/upclient/patches/patch-ae     Wed Jan 25 16:39:13 2006 +0000
+++ b/net/upclient/patches/patch-ae     Wed Jan 25 17:00:25 2006 +0000
@@ -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 @@
                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:



Home | Main Index | Thread Index | Old Index