|
|
c9cbae |
Name: perl-constant
|
|
|
c9cbae |
Version: 1.27
|
|
|
df560b |
Release: 2%{?dist}
|
|
|
c9cbae |
Summary: Perl pragma to declare constants
|
|
|
c9cbae |
License: GPL+ or Artistic
|
|
|
c9cbae |
Group: Development/Libraries
|
|
|
c9cbae |
URL: http://search.cpan.org/dist/constant/
|
|
|
c9cbae |
Source0: http://www.cpan.org/authors/id/S/SA/SAPER/constant-%{version}.tar.gz
|
|
|
c9cbae |
BuildArch: noarch
|
|
|
c9cbae |
BuildRequires: perl
|
|
|
c9cbae |
BuildRequires: perl(Module::Build)
|
|
|
c9cbae |
BuildRequires: perl(strict)
|
|
|
c9cbae |
# Run-time:
|
|
|
c9cbae |
BuildRequires: perl(Carp)
|
|
|
c9cbae |
BuildRequires: perl(vars)
|
|
|
c9cbae |
BuildRequires: perl(warnings::register)
|
|
|
c9cbae |
# Tests:
|
|
|
c9cbae |
BuildRequires: perl(Test::More)
|
|
|
c9cbae |
BuildRequires: perl(utf8)
|
|
|
c9cbae |
BuildRequires: perl(warnings)
|
|
|
c9cbae |
# Optional tests:
|
|
|
c9cbae |
BuildRequires: perl(Test::Pod) >= 1.14
|
|
|
c9cbae |
BuildRequires: perl(Test::Pod::Coverage) >= 1.04
|
|
|
c9cbae |
Requires: perl(:MODULE_COMPAT_%(eval "`perl -V:version`"; echo $version))
|
|
|
c9cbae |
Requires: perl(Carp)
|
|
|
c9cbae |
|
|
|
c9cbae |
%description
|
|
|
c9cbae |
This pragma allows you to declare constants at compile-time:
|
|
|
c9cbae |
|
|
|
c9cbae |
use constant PI => 4 * atan2(1, 1);
|
|
|
c9cbae |
|
|
|
c9cbae |
When you declare a constant such as "PI" using the method shown above,
|
|
|
c9cbae |
each machine your script runs upon can have as many digits of accuracy
|
|
|
c9cbae |
as it can use. Also, your program will be easier to read, more likely
|
|
|
c9cbae |
to be maintained (and maintained correctly), and far less likely to
|
|
|
c9cbae |
send a space probe to the wrong planet because nobody noticed the one
|
|
|
c9cbae |
equation in which you wrote 3.14195.
|
|
|
c9cbae |
|
|
|
c9cbae |
When a constant is used in an expression, Perl replaces it with its
|
|
|
c9cbae |
value at compile time, and may then optimize the expression further.
|
|
|
c9cbae |
In particular, any code in an "if (CONSTANT)" block will be optimized
|
|
|
c9cbae |
away if the constant is false.
|
|
|
c9cbae |
|
|
|
c9cbae |
%prep
|
|
|
c9cbae |
%setup -q -n constant-%{version}
|
|
|
c9cbae |
|
|
|
c9cbae |
%build
|
|
|
c9cbae |
perl Build.PL installdirs=vendor
|
|
|
c9cbae |
./Build
|
|
|
c9cbae |
|
|
|
c9cbae |
%install
|
|
|
c9cbae |
./Build install destdir=$RPM_BUILD_ROOT create_packlist=0
|
|
|
c9cbae |
%{_fixperms} $RPM_BUILD_ROOT/*
|
|
|
c9cbae |
|
|
|
c9cbae |
%check
|
|
|
c9cbae |
./Build test
|
|
|
c9cbae |
|
|
|
c9cbae |
%files
|
|
|
c9cbae |
%doc Changes eg README
|
|
|
c9cbae |
%{perl_vendorlib}/*
|
|
|
c9cbae |
%{_mandir}/man3/*
|
|
|
c9cbae |
|
|
|
c9cbae |
%changelog
|
|
|
df560b |
* Fri Dec 27 2013 Daniel Mach <dmach@redhat.com> - 1.27-2
|
|
|
df560b |
- Mass rebuild 2013-12-27
|
|
|
df560b |
|
|
|
c9cbae |
* Thu Mar 21 2013 Petr Pisar <ppisar@redhat.com> 1.27-1
|
|
|
c9cbae |
- Specfile autogenerated by cpanspec 1.78.
|