diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..d970c8a --- /dev/null +++ b/.gitignore @@ -0,0 +1 @@ +SOURCES/Sys-CPU-0.54.tar.gz diff --git a/.perl-Sys-CPU.metadata b/.perl-Sys-CPU.metadata new file mode 100644 index 0000000..bb201f4 --- /dev/null +++ b/.perl-Sys-CPU.metadata @@ -0,0 +1 @@ +95a6985353c73f6399dbbdd4cb8d5cae28ed47e6 SOURCES/Sys-CPU-0.54.tar.gz diff --git a/SOURCES/Sys-CPU-0.54-Add-support-for-cpu_type-on-ARM-and-AArch64-Linux-pl.patch b/SOURCES/Sys-CPU-0.54-Add-support-for-cpu_type-on-ARM-and-AArch64-Linux-pl.patch new file mode 100644 index 0000000..9a079e6 --- /dev/null +++ b/SOURCES/Sys-CPU-0.54-Add-support-for-cpu_type-on-ARM-and-AArch64-Linux-pl.patch @@ -0,0 +1,36 @@ +From 166429a1c12405b2470d1504a7210257ebd0f6bb Mon Sep 17 00:00:00 2001 +From: =?UTF-8?q?Petr=20P=C3=ADsa=C5=99?= +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ř +--- + CPU.xs | 3 +++ + 1 file changed, 3 insertions(+) + +diff --git a/CPU.xs b/CPU.xs +index 9fb9963..9dd18ff 100644 +--- a/CPU.xs ++++ b/CPU.xs +@@ -367,6 +367,9 @@ CODE: + { + char *value = NULL; + #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 + diff --git a/SOURCES/Sys-CPU-0.61-cpu_clock-can-be-undefined-on-an-ARM.patch b/SOURCES/Sys-CPU-0.61-cpu_clock-can-be-undefined-on-an-ARM.patch new file mode 100644 index 0000000..678a095 --- /dev/null +++ b/SOURCES/Sys-CPU-0.61-cpu_clock-can-be-undefined-on-an-ARM.patch @@ -0,0 +1,50 @@ +From 32c01db384d8ee22ed1a365378f431a3b7241ef0 Mon Sep 17 00:00:00 2001 +From: =?UTF-8?q?Petr=20P=C3=ADsa=C5=99?= +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ř +--- + 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..e6dce80 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} =~ /^(armv|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.0 + diff --git a/SPECS/perl-Sys-CPU.spec b/SPECS/perl-Sys-CPU.spec new file mode 100644 index 0000000..5b0e784 --- /dev/null +++ b/SPECS/perl-Sys-CPU.spec @@ -0,0 +1,103 @@ +Name: perl-Sys-CPU +Version: 0.54 +Release: 4%{?dist} +Summary: Getting CPU information +Group: Development/Libraries +# 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 . +License: (GPL+ or Artistic) and (LGPLv3 or Artistic 2.0) +URL: http://search.cpan.org/~mkoderer/Sys-CPU/ +Source0: http://search.cpan.org/CPAN/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.54-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: perl(Config) +BuildRequires: perl(ExtUtils::MakeMaker) +# Run-time: +BuildRequires: perl(DynaLoader) +BuildRequires: 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. + +%prep +%setup -q -n Sys-CPU-%{version} +%patch0 -p1 +%patch1 -p1 +sed -i 's/\r//' Changes README + +%build +%{__perl} Makefile.PL INSTALLDIRS=vendor +make %{?_smp_mflags} + +%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/* +%{_mandir}/man3/*.3* + + +%changelog +* Tue May 06 2014 Petr Pisar - 0.54-4 +- Support cpu_type on ARM and AArch64 (bug #1093266) +- Accept undefined cpu_clock on ARM and AArch64 (bug #1093266) + +* Fri Jan 24 2014 Daniel Mach - 0.54-3 +- Mass rebuild 2014-01-24 + +* Fri Dec 27 2013 Daniel Mach - 0.54-2 +- Mass rebuild 2013-12-27 + +* Tue Nov 13 2012 Petr Pisar - 0.54-1 +- 0.54 bump + +* Mon Nov 05 2012 Petr Pisar - 0.52-2 +- Add support for s390 (CPAN RT #80633) + +* Fri Nov 02 2012 Petr Pisar - 0.52-1 +- 0.52 bump + +* Fri Jul 20 2012 Fedora Release Engineering - 0.51-10 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_18_Mass_Rebuild + +* Mon Jun 11 2012 Petr Pisar - 0.51-9 +- Perl 5.16 rebuild + +* Fri Jan 13 2012 Fedora Release Engineering - 0.51-8 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_17_Mass_Rebuild + +* Tue Oct 05 2011 Shakthi Kannan - 0.51-7 +- Used perl_vendorarch/auto, perl_vendorarch/Sys in files section. + +* Fri Jun 17 2011 Marcela Mašláňová - 0.51-6 +- Perl mass rebuild + +* Wed Feb 09 2011 Fedora Release Engineering - 0.51-5 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_15_Mass_Rebuild + +* Wed Dec 22 2010 Marcela Maslanova - 0.51-4 +- 661697 rebuild for fixing problems with vendorach/lib + +* Sun Jun 27 2010 Ralf Corsépius 0.51-3 +- Rebuild for perl-5.12.1. + +* Mon May 03 2010 Shakthi Kannan 0.51-2 +- Updated license to (GPL+ or Artistic) and (LGPLv3 or Artistic 2.0) + +* Fri Apr 23 2010 Shakthi Kannan 0.51-1 +- Initial Fedora RPM version