diff --git a/constant-1.33.tar.gz b/constant-1.33.tar.gz new file mode 100644 index 0000000000000000000000000000000000000000..6283facfacc39e6e770852ec2d7283c441a86cad Binary files /dev/null and b/constant-1.33.tar.gz differ diff --git a/perl-constant.spec b/perl-constant.spec new file mode 100644 index 0000000000000000000000000000000000000000..fb9acf1fe1538e5ee342d58eb5003fd30d2af54d --- /dev/null +++ b/perl-constant.spec @@ -0,0 +1,71 @@ +%define anolis_release 1 + +Name: perl-constant +Version: 1.33 +Release: %{anolis_release}%{?dist} +Summary: Perl pragma to declare constants +License: GPL+ or Artistic +Group: Development/Libraries +URL: http://search.cpan.org/dist/constant/ +Source0: https://cpan.metacpan.org/authors/id/R/RJ/RJBS/constant-1.33.tar.gz + +BuildArch: noarch +BuildRequires: perl +BuildRequires: perl(ExtUtils::MakeMaker) +BuildRequires: perl(strict) +# Run-time: +BuildRequires: perl(Carp) +BuildRequires: perl(vars) +BuildRequires: perl(warnings::register) +# Tests: +BuildRequires: perl(Test::More) +BuildRequires: perl(utf8) +BuildRequires: perl(warnings) +%if !%{defined perl_bootstrap} +# Optional tests: +BuildRequires: perl(Test::Pod) >= 1.14 +BuildRequires: perl(Test::Pod::Coverage) >= 1.04 +%endif +Requires: perl(:MODULE_COMPAT_%(eval "`perl -V:version`"; echo $version)) +Requires: 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-%{version} + +%build +perl Makefile.PL INSTALLDIRS=vendor +make %{?_smp_mflags} + +%install +make pure_install DESTDIR=$RPM_BUILD_ROOT +find $RPM_BUILD_ROOT -type f -name .packlist -exec rm -f {} \; +%{_fixperms} $RPM_BUILD_ROOT/* + +%check +make test + +%files +%doc Changes README +%{perl_vendorlib}/* +%{_mandir}/man3/* + +%changelog +* Tue Mar 8 2022 Liwei Ge - 1.33-1 +- Init version from upstream v1.33