Skip site navigation (1)Skip section navigation (2)
Date:      Fri, 25 Jul 2008 17:48:15 +1000 (EST)
From:      terry@sucked-in.com
To:        FreeBSD-gnats-submit@FreeBSD.org
Subject:   ports/125947: New Port: devel/p5-Sys-Cpu
Message-ID:  <20080725074815.681E91CD3C@mail.sucked-in.com>
Resent-Message-ID: <200807250750.m6P7o6r8066049@freefall.freebsd.org>

next in thread | raw e-mail | index | archive | help

>Number:         125947
>Category:       ports
>Synopsis:       New Port: devel/p5-Sys-Cpu
>Confidential:   no
>Severity:       non-critical
>Priority:       low
>Responsible:    freebsd-ports-bugs
>State:          open
>Quarter:        
>Keywords:       
>Date-Required:
>Class:          change-request
>Submitter-Id:   current-users
>Arrival-Date:   Fri Jul 25 07:50:05 UTC 2008
>Closed-Date:
>Last-Modified:
>Originator:     Terry Sposato
>Release:        FreeBSD 6.3-RELEASE-p3 i386
>Organization:
Sucked In
>Environment:
System: FreeBSD got.sucked-in.com 6.3-RELEASE-p3 FreeBSD 6.3-RELEASE-p3 #6: Mon Jul 14 12:33:56 EST 2008 root@got.sucked-in.com:/usr/obj/usr/src/sys/SUCKED i386


>Description:
	New Port: devel/p5-Sys-Cpu for obtaining CPU information
>How-To-Repeat:

>Fix:


--- p5-Sys-Cpu.shar begins here ---
# This is a shell archive.  Save it in a file, remove anything before
# this line, and then unpack it by entering "sh file".  Note, it may
# create directories; files and directories will be owned by you and
# have default permissions.
#
# This archive contains:
#
#	devel/p5-Sys-Cpu/
#	devel/p5-Sys-Cpu/Makefile
#	devel/p5-Sys-Cpu/distinfo
#	devel/p5-Sys-Cpu/pkg-descr
#	devel/p5-Sys-Cpu/pkg-plist
#	devel/p5-Sys-Cpu/files
#	devel/p5-Sys-Cpu/files/patch-CPU.xs
#
echo c - devel/p5-Sys-Cpu/
mkdir -p devel/p5-Sys-Cpu/ > /dev/null 2>&1
echo x - devel/p5-Sys-Cpu/Makefile
sed 's/^X//' >devel/p5-Sys-Cpu/Makefile << 'END-of-devel/p5-Sys-Cpu/Makefile'
X# New ports collection makefile for:	Sys-Cpu
X# Date created:	   25 July 2008
X# Whom:		   Terry Sposato <terry@sucked-in.com>
X#
X
XPORTNAME=	Sys-CPU
XPORTVERSION=	0.40
XCATEGORIES=	devel perl5
XMASTER_SITES=	CPAN
XPKGNAMEPREFIX=	p5-
X
XMAINTAINER=	terry@sucked-in.com
XCOMMENT=	Sys::CPU - Perl extension for getting CPU information.
X
XPERL_CONFIGURE=	yes
X
XMAN3=		Sys::CPU.3
X
X.include <bsd.port.mk>
END-of-devel/p5-Sys-Cpu/Makefile
echo x - devel/p5-Sys-Cpu/distinfo
sed 's/^X//' >devel/p5-Sys-Cpu/distinfo << 'END-of-devel/p5-Sys-Cpu/distinfo'
XMD5 (Sys-CPU-0.40.tar.gz) = c2731716e5c1eaa4e88860ccc09791e2
XSHA256 (Sys-CPU-0.40.tar.gz) = 48efce686727f6529a555c3a6f7c57f91285e364675370007bb462174e773558
XSIZE (Sys-CPU-0.40.tar.gz) = 4696
END-of-devel/p5-Sys-Cpu/distinfo
echo x - devel/p5-Sys-Cpu/pkg-descr
sed 's/^X//' >devel/p5-Sys-Cpu/pkg-descr << 'END-of-devel/p5-Sys-Cpu/pkg-descr'
XSys::CPU - Perl extension for getting CPU information.
XIn responce to a post on perlmonks.org, a module for counting 
Xthe number of CPU's on a system. Support has now also been 
Xadded for type of CPU and clock speed. While much of the code 
Xis from UNIX::Processors, win32 support has been added 
X(but not tested).
X
XWWW: http://search.cpan.org/dist/Sys-Cpu/
END-of-devel/p5-Sys-Cpu/pkg-descr
echo x - devel/p5-Sys-Cpu/pkg-plist
sed 's/^X//' >devel/p5-Sys-Cpu/pkg-plist << 'END-of-devel/p5-Sys-Cpu/pkg-plist'
X%%SITE_PERL%%/%%PERL_ARCH%%/Sys/CPU.pm
X%%SITE_PERL%%/%%PERL_ARCH%%/auto/Sys/CPU/CPU.so
X%%SITE_PERL%%/%%PERL_ARCH%%/auto/Sys/CPU/CPU.bs
X%%SITE_PERL%%/%%PERL_ARCH%%/auto/Sys/CPU/.packlist
X@dirrm %%SITE_PERL%%/%%PERL_ARCH%%/auto/Sys/CPU
X@dirrmtry %%SITE_PERL%%/%%PERL_ARCH%%/Sys
X@dirrmtry %%SITE_PERL%%/%%PERL_ARCH%%/auto/Sys
END-of-devel/p5-Sys-Cpu/pkg-plist
echo c - devel/p5-Sys-Cpu/files
mkdir -p devel/p5-Sys-Cpu/files > /dev/null 2>&1
echo x - devel/p5-Sys-Cpu/files/patch-CPU.xs
sed 's/^X//' >devel/p5-Sys-Cpu/files/patch-CPU.xs << 'END-of-devel/p5-Sys-Cpu/files/patch-CPU.xs'
X--- CPU.xs.orig	2008-07-25 09:06:35.000000000 +0200
X+++ CPU.xs	2008-07-25 09:24:13.000000000 +0200
X@@ -35,6 +35,9 @@
X  #define _have_cpu_clock
X  #define _have_cpu_type
X #endif
X+#ifdef __FreeBSD__
X+ #include <sys/sysctl.h>
X+#endif
X 
X #ifdef WINDOWS
X /* Registry Functions */
X@@ -237,6 +240,10 @@
X {
X     int clock = 0;
X     int retcode = 0;
X+#ifdef __FreeBSD__
X+    size_t len = sizeof(clock);
X+    sysctlbyname("hw.clockrate", &clock, &len, NULL, 0);
X+#else
X #ifdef __linux__
X     int value = proc_cpuinfo_clock();
X     if (value) clock = value;
X@@ -263,12 +270,13 @@
X         }
X     }
X #endif
X+#endif
X     if (clock) {
X 	    ST(0) = sv_newmortal();
X 	    sv_setiv (ST(0), clock);
X     } else {
X 	    ST(0) = &PL_sv_undef;
X-    }   
X+    }
X }
X 
X SV *
X@@ -277,6 +285,10 @@
X {
X     char *value = malloc(MAX_IDENT_SIZE);
X     int retcode = 0;
X+#ifdef __FreeBSD__
X+   size_t len = MAX_IDENT_SIZE;
X+   sysctlbyname("hw.model", value, &len, NULL, 0);
X+#else
X #ifdef __linux__
X     value = proc_cpuinfo_field ("model name");
X     if (!value) value = proc_cpuinfo_field ("machine");
X@@ -296,6 +308,7 @@
X 	value = infop->pi_processor_type;
X     }
X #endif
X+#endif
X     if (value) {
X 	    ST(0) = sv_newmortal();
X 	    sv_setpv (ST(0), value);
END-of-devel/p5-Sys-Cpu/files/patch-CPU.xs
exit
--- p5-Sys-Cpu.shar ends here ---


>Release-Note:
>Audit-Trail:
>Unformatted:



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?20080725074815.681E91CD3C>