Package init

This commit is contained in:
dogsheng 2019-12-14 21:08:55 +08:00
parent b51d6926e6
commit 488f955370
6 changed files with 141 additions and 75 deletions

View File

@ -1,36 +0,0 @@
# perl-Sys-CPU
#### Description
{**When you're done, you can delete the content in this README and update the file with details for others getting started with your repository**}
#### Software Architecture
Software architecture description
#### Installation
1. xxxx
2. xxxx
3. xxxx
#### Instructions
1. xxxx
2. xxxx
3. xxxx
#### Contribution
1. Fork the repository
2. Create Feat_xxx branch
3. Commit your code
4. Create Pull Request
#### Gitee Feature
1. You can use Readme\_XXX.md to support different languages, such as Readme\_en.md, Readme\_zh.md
2. Gitee blog [blog.gitee.com](https://blog.gitee.com)
3. Explore open source project [https://gitee.com/explore](https://gitee.com/explore)
4. The most valuable open source project [GVP](https://gitee.com/gvp)
5. The manual of Gitee [https://gitee.com/help](https://gitee.com/help)
6. The most popular members [https://gitee.com/gitee-stars/](https://gitee.com/gitee-stars/)

View File

@ -1,39 +0,0 @@
# perl-Sys-CPU
#### 介绍
{**以下是码云平台说明,您可以替换此简介**
码云是 OSCHINA 推出的基于 Git 的代码托管平台(同时支持 SVN。专为开发者提供稳定、高效、安全的云端软件开发协作平台
无论是个人、团队、或是企业,都能够用码云实现代码托管、项目管理、协作开发。企业项目请看 [https://gitee.com/enterprises](https://gitee.com/enterprises)}
#### 软件架构
软件架构说明
#### 安装教程
1. xxxx
2. xxxx
3. xxxx
#### 使用说明
1. xxxx
2. xxxx
3. xxxx
#### 参与贡献
1. Fork 本仓库
2. 新建 Feat_xxx 分支
3. 提交代码
4. 新建 Pull Request
#### 码云特技
1. 使用 Readme\_XXX.md 来支持不同的语言,例如 Readme\_en.md, Readme\_zh.md
2. 码云官方博客 [blog.gitee.com](https://blog.gitee.com)
3. 你可以 [https://gitee.com/explore](https://gitee.com/explore) 这个地址来了解码云上的优秀开源项目
4. [GVP](https://gitee.com/gvp) 全称是码云最有价值开源项目,是码云综合评定出的优秀开源项目
5. 码云官方提供的使用手册 [https://gitee.com/help](https://gitee.com/help)
6. 码云封面人物是一档用来展示码云会员风采的栏目 [https://gitee.com/gitee-stars/](https://gitee.com/gitee-stars/)

View File

@ -0,0 +1,36 @@
From f77b2b0c795f5d2ad7a85ae3bfffcf74232836ec Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Petr=20P=C3=ADsa=C5=99?= <ppisar@redhat.com>
Date: Tue, 6 May 2014 08:47:16 +0200
Subject: [PATCH 1/2] Add support for cpu_type on ARM and AArch64 Linux
platforms
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
The CPU type is listed as Processor (upper-cased P) entry. SMP systems
enumerate cores by processor (lower-cased P) entries in addition.
The Processor is always first, so case-insesitive look-up is not
a problem.
Signed-off-by: Petr Písař <ppisar@redhat.com>
---
CPU.xs | 3 +++
1 file changed, 3 insertions(+)
diff --git a/CPU.xs b/CPU.xs
index 236b14d..067c9cb 100644
--- a/CPU.xs
+++ b/CPU.xs
@@ -395,6 +395,9 @@ CODE:
sysctlbyname("hw.model", value, &len, NULL, 0);
#endif
#ifdef __linux__
+#if defined __arm__ || defined __aarch64__
+ value = proc_cpuinfo_field ("Processor");
+#endif
#if defined __s390__ || defined __s390x__
value = processor_machine_field (proc_cpuinfo_field ("processor") );
#endif
--
1.9.0

View File

@ -0,0 +1,50 @@
From ceaef15d1391e37623aaf18d6614a4bbf35a3607 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Petr=20P=C3=ADsa=C5=99?= <ppisar@redhat.com>
Date: Tue, 6 May 2014 09:12:16 +0200
Subject: [PATCH 2/2] cpu_clock can be undefined on an ARM
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
Some ARM boards do not publish CPU clock.
Signed-off-by: Petr Písař <ppisar@redhat.com>
---
Makefile.PL | 1 +
t/Sys-CPU.t | 3 +++
2 files changed, 4 insertions(+)
diff --git a/Makefile.PL b/Makefile.PL
index 910c77a..4e72025 100644
--- a/Makefile.PL
+++ b/Makefile.PL
@@ -13,4 +13,5 @@ WriteMakefile(
'DEFINE' => '', # e.g., '-DHAVE_SOMETHING'
'INC' => '', # e.g., '-I/usr/include/other'
'dynamic_lib' => {OTHERLDFLAGS => $extra_arg},
+ 'BUILD_REQUIRES' => {'Config' => 0 },
);
diff --git a/t/Sys-CPU.t b/t/Sys-CPU.t
index 9edaaa3..4246b22 100755
--- a/t/Sys-CPU.t
+++ b/t/Sys-CPU.t
@@ -8,6 +8,7 @@
BEGIN { $| = 1; print "1..4\n"; }
END {print "not ok 1\n" unless $loaded;}
+use Config;
use Sys::CPU;
$loaded = 1;
print "ok 1\n";
@@ -24,6 +25,8 @@ if (defined($speed)) {
print "ok 3 (CPU Speed : $speed)\n";
} elsif ( $^O eq 'MSWin32'){
print "ok 3 (CPU Speed: test skipped on MSWin32)\n";
+} elsif ($Config{archname} =~ /^(arm|aarch64)/ ) {
+ print "ok 3 (CPU Speed: test skipped on ARM and AArch64)\n";
} else {
print "not ok 3 (cpu_clock undefined (ok if Win9x))\n";
}
--
1.9.3

BIN
Sys-CPU-0.61.tar.gz Normal file

Binary file not shown.

55
perl-Sys-CPU.spec Normal file
View File

@ -0,0 +1,55 @@
Name: perl-Sys-CPU
Version: 0.61
Release: 18
Summary: Getting CPU information
# Some code was copied from Unix::Processors, which is LGPLv3 or Artistic 2.0
# The rest of the code is under the standard Perl license (GPL+ or Artistic).
# See <https://bugzilla.redhat.com/show_bug.cgi?id=585336>.
License: (GPL+ or Artistic) and (LGPLv3 or Artistic 2.0)
URL: https://metacpan.org/release/Sys-CPU
Source0: https://cpan.metacpan.org/authors/id/M/MZ/MZSANFORD/Sys-CPU-%{version}.tar.gz
# Support cpu_type on ARM and AArch64, bug #1093266, CPAN RT#95400
Patch0: Sys-CPU-0.61-Add-support-for-cpu_type-on-ARM-and-AArch64-Linux-pl.patch
# Accept undefined cpu_clock on ARM and AArch64, bug #1093266, CPAN RT#95400
Patch1: Sys-CPU-0.61-cpu_clock-can-be-undefined-on-an-ARM.patch
BuildRequires: findutils gcc make sed perl-devel perl-generators
BuildRequires: perl(Config) perl(ExtUtils::MakeMaker) perl(DynaLoader) perl(Exporter)
Requires: perl(:MODULE_COMPAT_%(eval "`%{__perl} -V:version`"; echo $version))
%{?perl_default_filter}
%description
Perl extension for getting CPU information.
Currently only number of CPU's supported.
%package_help
%prep
%autosetup -n Sys-CPU-%{version} -Sgit -p1
sed -i 's/\r//' Changes README
%build
%{__perl} Makefile.PL INSTALLDIRS=vendor
%{make_build}
%check
make test TEST_VERBOSE=1
%install
make pure_install DESTDIR=%{buildroot}
find %{buildroot} -type f -name .packlist -exec rm -f {} \;
find %{buildroot} -type f -name CPU.bs -exec rm -f {} \;
%{_fixperms} %{buildroot}/*
%files
%doc Changes README
%{perl_vendorarch}/auto/*
%{perl_vendorarch}/Sys/*
%files help
%{_mandir}/man3/*.3*
%changelog
* Wed Dec 04 2019 openEuler Buildteam <buildteam@openeuler.org> - 0.61-18
- Package init