aboutsummaryrefslogtreecommitdiff
path: root/sysutils/p5-Sys-Load
diff options
context:
space:
mode:
authorSteve Wills <swills@FreeBSD.org>2011-01-29 20:00:32 +0000
committerSteve Wills <swills@FreeBSD.org>2011-01-29 20:00:32 +0000
commitf03648e2d817af6fcc0133a35b9bb35d39f579c6 (patch)
tree3eddcb4aff02038a75f82ab1e1947552c81278c6 /sysutils/p5-Sys-Load
parentc00a7b4e8321f8f941d513daa4ea6cf1c5d930d2 (diff)
Notes
Diffstat (limited to 'sysutils/p5-Sys-Load')
-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
6 files changed, 81 insertions, 0 deletions
diff --git a/sysutils/p5-Sys-Load/Makefile b/sysutils/p5-Sys-Load/Makefile
new file mode 100644
index 000000000000..41dc839cce5c
--- /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 000000000000..34d384674ee0
--- /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 000000000000..6654c8e67e08
--- /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 000000000000..4e92cc0ffd9a
--- /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 000000000000..a221620105c3
--- /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 000000000000..ec9eccd64955
--- /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