aboutsummaryrefslogtreecommitdiffstats
path: root/sysutils
diff options
context:
space:
mode:
authorswills <swills@FreeBSD.org>2011-01-30 04:00:32 +0800
committerswills <swills@FreeBSD.org>2011-01-30 04:00:32 +0800
commit9aaf94487bfb6cfd7fa6629e09226f9c2fb8f150 (patch)
tree339c1e353dd8577049ba74e6160837b07faf8db0 /sysutils
parent3293d902b44f72453a44e1fa4ef9b3b9b030b59e (diff)
downloadfreebsd-ports-graphics-9aaf94487bfb6cfd7fa6629e09226f9c2fb8f150.tar.gz
freebsd-ports-graphics-9aaf94487bfb6cfd7fa6629e09226f9c2fb8f150.tar.zst
freebsd-ports-graphics-9aaf94487bfb6cfd7fa6629e09226f9c2fb8f150.zip
Sys::Load - Perl module for getting the current system load and uptime
WWW: http://search.cpan.org/dist/Sys-Load/ PR: ports/154139 Submitted by: Konstantin Menshikov <kostjnspb at yandex.ru> Approved by: pgollucci (mentor) Feature safe: yes
Diffstat (limited to 'sysutils')
-rw-r--r--sysutils/Makefile1
-rw-r--r--sysutils/p5-Sys-Load/Makefile22
-rw-r--r--sysutils/p5-Sys-Load/distinfo2
-rw-r--r--sysutils/p5-Sys-Load/files/patch-Load.pm20
-rw-r--r--sysutils/p5-Sys-Load/files/patch-Load.xs27
-rw-r--r--sysutils/p5-Sys-Load/pkg-descr3
-rw-r--r--sysutils/p5-Sys-Load/pkg-plist7
7 files changed, 82 insertions, 0 deletions
diff --git a/sysutils/Makefile b/sysutils/Makefile
index 6260c4e0f60..9c8fab888ef 100644
--- a/sysutils/Makefile
+++ b/sysutils/Makefile
@@ -598,6 +598,7 @@
SUBDIR += p5-Sys-HostIP
SUBDIR += p5-Sys-Hostname-FQDN
SUBDIR += p5-Sys-Hostname-Long
+ SUBDIR += p5-Sys-Load
SUBDIR += p5-Sys-Syslog
SUBDIR += p5-Sys-User-UIDhelper
SUBDIR += p5-Sys-Utmp
diff --git a/sysutils/p5-Sys-Load/Makefile b/sysutils/p5-Sys-Load/Makefile
new file mode 100644
index 00000000000..41dc839cce5
--- /dev/null
+++ b/sysutils/p5-Sys-Load/Makefile
@@ -0,0 +1,22 @@
+# New ports collection makefile for: p5-Sys-Load
+# Date created: 19 January 2010
+# Whom: Konstantin Menshikov <kostjnspb@yandex.ru>
+#
+# $FreeBSD$
+#
+
+PORTNAME= Sys-Load
+PORTVERSION= 0.2
+CATEGORIES= sysutils perl5
+MASTER_SITES= CPAN \
+ http://kostjn.spb.ru/freebsd/
+PKGNAMEPREFIX= p5-
+
+MAINTAINER= kostjnspb@yandex.ru
+COMMENT= Getting the current system load and uptime
+
+PERL_CONFIGURE= YES
+
+MAN3= Sys::Load.3
+
+.include <bsd.port.mk>
diff --git a/sysutils/p5-Sys-Load/distinfo b/sysutils/p5-Sys-Load/distinfo
new file mode 100644
index 00000000000..34d384674ee
--- /dev/null
+++ b/sysutils/p5-Sys-Load/distinfo
@@ -0,0 +1,2 @@
+SHA256 (Sys-Load-0.2.tar.gz) = 27ef03e0fc455cf51b363b1a10609233de105aa3f3d51086a0a9244b1581275d
+SIZE (Sys-Load-0.2.tar.gz) = 1794
diff --git a/sysutils/p5-Sys-Load/files/patch-Load.pm b/sysutils/p5-Sys-Load/files/patch-Load.pm
new file mode 100644
index 00000000000..6654c8e67e0
--- /dev/null
+++ b/sysutils/p5-Sys-Load/files/patch-Load.pm
@@ -0,0 +1,20 @@
+--- Load.pm 2002-09-01 09:54:44.000000000 +0000
++++ Load.pm 2011-01-19 12:07:33.000000000 +0000
+@@ -17,17 +17,6 @@
+ bootstrap Sys::Load $VERSION;
+
+ # Preloaded methods go here.
+-
+-use constant UPTIME => "/proc/uptime";
+-
+-sub uptime {
+- open(FILE, UPTIME) || return 0;
+- my $line = <FILE>;
+- my($uptime, $idle) = split /\s+/, $line;
+- close FILE;
+- return $uptime;
+-}
+-
+ 1;
+
+ __END__
diff --git a/sysutils/p5-Sys-Load/files/patch-Load.xs b/sysutils/p5-Sys-Load/files/patch-Load.xs
new file mode 100644
index 00000000000..4e92cc0ffd9
--- /dev/null
+++ b/sysutils/p5-Sys-Load/files/patch-Load.xs
@@ -0,0 +1,27 @@
+--- Load.xs 2002-08-31 02:00:32.000000000 +0000
++++ Load.xs 2011-01-19 12:07:14.000000000 +0000
+@@ -2,6 +2,7 @@
+ #include "perl.h"
+ #include "XSUB.h"
+ #include "stdlib.h"
++#include <time.h>
+
+
+ MODULE = Sys::Load PACKAGE = Sys::Load
+@@ -22,3 +23,16 @@
+ XPUSHs(sv_2mortal(newSVnv(load[2])));
+ }
+
++void
++uptime()
++PROTOTYPE:
++PREINIT:
++ struct timespec t;
++ int i;
++PPCODE:
++ i = clock_gettime(CLOCK_MONOTONIC, &t);
++ if(i == -1)
++ XSRETURN_EMPTY;
++ else {
++ XPUSHs(sv_2mortal(newSVnv(t.tv_sec)));
++ }
diff --git a/sysutils/p5-Sys-Load/pkg-descr b/sysutils/p5-Sys-Load/pkg-descr
new file mode 100644
index 00000000000..a221620105c
--- /dev/null
+++ b/sysutils/p5-Sys-Load/pkg-descr
@@ -0,0 +1,3 @@
+Sys::Load - Perl module for getting the current system load and uptime
+
+WWW: http://search.cpan.org/dist/Sys-Load/
diff --git a/sysutils/p5-Sys-Load/pkg-plist b/sysutils/p5-Sys-Load/pkg-plist
new file mode 100644
index 00000000000..ec9eccd6495
--- /dev/null
+++ b/sysutils/p5-Sys-Load/pkg-plist
@@ -0,0 +1,7 @@
+%%SITE_PERL%%/mach/auto/Sys/Load/.packlist
+%%SITE_PERL%%/mach/auto/Sys/Load/Load.so
+%%SITE_PERL%%/mach/auto/Sys/Load/Load.bs
+%%SITE_PERL%%/mach/Sys/Load.pm
+@dirrmtry %%SITE_PERL%%/mach/auto/Sys/Load
+@dirrmtry %%SITE_PERL%%/mach/auto/Sys
+@dirrmtry %%SITE_PERL%%/mach/Sys