From 94515849b2ce61edd3c4f4eb347981881e228da0 Mon Sep 17 00:00:00 2001 From: CentOS Sources Date: Jun 04 2015 07:51:14 +0000 Subject: import rh-perl520-perl-constant-1.31-312.el7 --- diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..4767a88 --- /dev/null +++ b/.gitignore @@ -0,0 +1 @@ +SOURCES/constant-1.27.tar.gz diff --git a/.rh-perl520-perl-constant.metadata b/.rh-perl520-perl-constant.metadata new file mode 100644 index 0000000..467d697 --- /dev/null +++ b/.rh-perl520-perl-constant.metadata @@ -0,0 +1 @@ +54223c06f492cd9fff118d8613b973c524df13f6 SOURCES/constant-1.27.tar.gz diff --git a/README.md b/README.md deleted file mode 100644 index 98f42b4..0000000 --- a/README.md +++ /dev/null @@ -1,4 +0,0 @@ -The master branch has no content - -Look at the c7 branch if you are working with CentOS-7, or the c4/c5/c6 branch for CentOS-4, 5 or 6 -If you find this file in a distro specific branch, it means that no content has been checked in yet diff --git a/SOURCES/constant-1.31-update.patch b/SOURCES/constant-1.31-update.patch new file mode 100644 index 0000000..551ddb9 --- /dev/null +++ b/SOURCES/constant-1.31-update.patch @@ -0,0 +1,151 @@ +diff -up constant-1.27/lib/constant.pm.orig constant-1.27/lib/constant.pm +--- constant-1.27/lib/constant.pm.orig 2014-09-09 10:42:02.450977378 +0200 ++++ constant-1.27/lib/constant.pm 2014-09-09 10:42:25.026227379 +0200 +@@ -4,7 +4,7 @@ use strict; + use warnings::register; + + use vars qw($VERSION %declared); +-$VERSION = '1.27'; ++$VERSION = '1.31'; + + #======================================================================= + +@@ -25,12 +25,22 @@ BEGIN { + # We'd like to do use constant _CAN_PCS => $] > 5.009002 + # but that's a bit tricky before we load the constant module :-) + # By doing this, we save 1 run time check for *every* call to import. +- no strict 'refs'; + my $const = $] > 5.009002; +- *_CAN_PCS = sub () {$const}; +- + my $downgrade = $] < 5.015004; # && $] >= 5.008 +- *_DOWNGRADE = sub () { $downgrade }; ++ my $constarray = exists &_make_const; ++ if ($const) { ++ Internals::SvREADONLY($const, 1); ++ Internals::SvREADONLY($downgrade, 1); ++ $constant::{_CAN_PCS} = \$const; ++ $constant::{_DOWNGRADE} = \$downgrade; ++ $constant::{_CAN_PCS_FOR_ARRAY} = \$constarray; ++ } ++ else { ++ no strict 'refs'; ++ *{"_CAN_PCS"} = sub () {$const}; ++ *{"_DOWNGRADE"} = sub () { $downgrade }; ++ *{"_CAN_PCS_FOR_ARRAY"} = sub () { $constarray }; ++ } + } + + #======================================================================= +@@ -128,20 +138,41 @@ sub import { + + # The constant serves to optimise this entire block out on + # 5.8 and earlier. +- if (_CAN_PCS && $symtab && !exists $symtab->{$name}) { +- # No typeglob yet, so we can use a reference as space- +- # efficient proxy for a constant subroutine ++ if (_CAN_PCS) { ++ # Use a reference as a proxy for a constant subroutine. ++ # If this is not a glob yet, it saves space. If it is ++ # a glob, we must still create it this way to get the ++ # right internal flags set, as constants are distinct ++ # from subroutines created with sub(){...}. + # The check in Perl_ck_rvconst knows that inlinable + # constants from cv_const_sv are read only. So we have to: + Internals::SvREADONLY($scalar, 1); +- $symtab->{$name} = \$scalar; +- ++$flush_mro; ++ if ($symtab && !exists $symtab->{$name}) { ++ $symtab->{$name} = \$scalar; ++ ++$flush_mro; ++ } ++ else { ++ local $constant::{_dummy} = \$scalar; ++ *$full_name = \&{"_dummy"}; ++ } + } else { + *$full_name = sub () { $scalar }; + } + } elsif (@_) { + my @list = @_; +- *$full_name = sub () { @list }; ++ if (_CAN_PCS_FOR_ARRAY) { ++ _make_const($list[$_]) for 0..$#list; ++ _make_const(@list); ++ if ($symtab && !exists $symtab->{$name}) { ++ $symtab->{$name} = \@list; ++ $flush_mro++; ++ } ++ else { ++ local $constant::{_dummy} = \@list; ++ *$full_name = \&{"_dummy"}; ++ } ++ } ++ else { *$full_name = sub () { @list }; } + } else { + *$full_name = sub () { }; + } +@@ -190,7 +221,7 @@ This pragma allows you to declare consta + + When you declare a constant such as C using the method shown + above, each machine your script runs upon can have as many digits +-of accuracy as it can use. Also, your program will be easier to ++of accuracy as it can use. Also, your program will be easier to + read, more likely to be maintained (and maintained correctly), and + far less likely to send a space probe to the wrong planet because + nobody noticed the one equation in which you wrote C<3.14195>. +@@ -203,7 +234,7 @@ away if the constant is false. + =head1 NOTES + + As with all C directives, defining a constant happens at +-compile time. Thus, it's probably not correct to put a constant ++compile time. Thus, it's probably not correct to put a constant + declaration inside of a conditional statement (like C). + +@@ -236,8 +267,8 @@ their own constants to override those in + The use of all caps for constant names is merely a convention, + although it is recommended in order to make constants stand out + and to help avoid collisions with other barewords, keywords, and +-subroutine names. Constant names must begin with a letter or +-underscore. Names beginning with a double underscore are reserved. Some ++subroutine names. Constant names must begin with a letter or ++underscore. Names beginning with a double underscore are reserved. Some + poor choices for names will generate warnings, if warnings are enabled at + compile time. + +@@ -312,15 +343,15 @@ constants without any problems. + =head1 TECHNICAL NOTES + + In the current implementation, scalar constants are actually +-inlinable subroutines. As of version 5.004 of Perl, the appropriate ++inlinable subroutines. As of version 5.004 of Perl, the appropriate + scalar constant is inserted directly in place of some subroutine +-calls, thereby saving the overhead of a subroutine call. See ++calls, thereby saving the overhead of a subroutine call. See + L for details about how and when this + happens. + + In the rare case in which you need to discover at run time whether a + particular constant has been declared via this module, you may use +-this function to examine the hash C<%constant::declared>. If the given ++this function to examine the hash C<%constant::declared>. If the given + constant name does not include a package name, the current package is + used. + +@@ -335,11 +366,12 @@ used. + + =head1 CAVEATS + +-In the current version of Perl, list constants are not inlined +-and some symbols may be redefined without generating a warning. ++List constants are not inlined unless you are using Perl v5.20 or higher. ++In v5.20 or higher, they are still not read-only, but that may change in ++future versions. + + It is not possible to have a subroutine or a keyword with the same +-name as a constant in the same package. This is probably a Good Thing. ++name as a constant in the same package. This is probably a Good Thing. + + A constant with a name in the list C is not allowed anywhere but in package C, for diff --git a/SPECS/perl-constant.spec b/SPECS/perl-constant.spec new file mode 100644 index 0000000..46647a5 --- /dev/null +++ b/SPECS/perl-constant.spec @@ -0,0 +1,108 @@ +%{?scl:%scl_package perl-constant} + +%global cpan_version 1.27 + +Name: %{?scl_prefix}perl-constant +Version: 1.31 +Release: 312%{?dist} +Summary: Perl pragma to declare constants +License: GPL+ or Artistic +Group: Development/Libraries +URL: http://search.cpan.org/dist/constant/ +Source0: http://www.cpan.org/authors/id/S/SA/SAPER/constant-%{cpan_version}.tar.gz +# Update to 1.31 +Patch0: constant-1.31-update.patch +BuildArch: noarch +BuildRequires: %{?scl_prefix}perl +BuildRequires: %{?scl_prefix}perl(ExtUtils::MakeMaker) +BuildRequires: %{?scl_prefix}perl(strict) +# Run-time: +BuildRequires: %{?scl_prefix}perl(Carp) +BuildRequires: %{?scl_prefix}perl(vars) +BuildRequires: %{?scl_prefix}perl(warnings::register) +# Tests: +BuildRequires: %{?scl_prefix}perl(Test::More) +BuildRequires: %{?scl_prefix}perl(utf8) +BuildRequires: %{?scl_prefix}perl(warnings) +%if !%{defined perl_bootstrap} && !%{defined perl_small} +# Optional tests: +BuildRequires: %{?scl_prefix}perl(Test::Pod) >= 1.14 +BuildRequires: %{?scl_prefix}perl(Test::Pod::Coverage) >= 1.04 +%endif +Requires: %{?scl_prefix}perl(:MODULE_COMPAT_%(%{?scl:scl enable %{scl} '}eval "$(perl -V:version)";echo $version%{?scl:'})) +Requires: %{?scl_prefix}perl(Carp) + +%description +This pragma allows you to declare constants at compile-time: + +use constant PI => 4 * atan2(1, 1); + +When you declare a constant such as "PI" using the method shown above, +each machine your script runs upon can have as many digits of accuracy +as it can use. Also, your program will be easier to read, more likely +to be maintained (and maintained correctly), and far less likely to +send a space probe to the wrong planet because nobody noticed the one +equation in which you wrote 3.14195. + +When a constant is used in an expression, Perl replaces it with its +value at compile time, and may then optimize the expression further. +In particular, any code in an "if (CONSTANT)" block will be optimized +away if the constant is false. + +%prep +%setup -q -n constant-%{cpan_version} +%patch0 -p1 + +%build +%{?scl:scl enable %{scl} '}perl Makefile.PL INSTALLDIRS=vendor && make %{?_smp_mflags}%{?scl:'} + +%install +%{?scl:scl enable %{scl} '}make pure_install DESTDIR=$RPM_BUILD_ROOT%{?scl:'} +find $RPM_BUILD_ROOT -type f -name .packlist -exec rm -f {} \; +%{_fixperms} $RPM_BUILD_ROOT/* + +%check +%{?scl:scl enable %{scl} '}make test%{?scl:'} + +%files +%doc Changes eg README +%{perl_vendorlib}/* +%{_mandir}/man3/* + +%changelog +* Sun Jan 25 2015 Jitka Plesnikova - 1.31-312 +- Rebuild of bootstrapped package + +* Thu Jan 22 2015 Petr Pisar - 1.31-311 +- Disable optional tests for small build root + +* Tue Sep 09 2014 Jitka Plesnikova - 1.31-310 +- Patched to provide the version 1.31 which is bundled in Perl 5.20 + +* Mon Sep 08 2014 Jitka Plesnikova - 1.27-295 +- Perl 5.20 re-rebuild of bootstrapped packages + +* Wed Aug 27 2014 Jitka Plesnikova - 1.27-294 +- Perl 5.20 rebuild + +* Sat Jun 07 2014 Fedora Release Engineering - 1.27-293 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_21_Mass_Rebuild + +* Wed Aug 14 2013 Jitka Plesnikova - 1.27-292 +- Perl 5.18 re-rebuild of bootstrapped packages + +* Sun Aug 04 2013 Fedora Release Engineering - 1.27-291 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_20_Mass_Rebuild + +* Mon Jul 15 2013 Petr Pisar - 1.27-290 +- Increase release to favour standalone package + +* Fri Jul 12 2013 Petr Pisar - 1.27-3 +- Link minimal build-root packages against libperl.so explicitly + +* Fri Jul 12 2013 Petr Pisar - 1.27-2 +- Migrate to ExtUtils::MakeMaker +- Do not run optional tests at boot-strap + +* Thu Mar 21 2013 Petr Pisar - 1.27-1 +- Specfile autogenerated by cpanspec 1.78.