f707a9
# Run optional test
f707a9
%if ! (0%{?rhel})
f707a9
%bcond_without perl_constant_enables_optional_test
f707a9
%else
f707a9
%bcond_with perl_constant_enables_optional_test
f707a9
%endif
f707a9
f707a9
%global cpan_version 1.27
f707a9
f707a9
Name:           perl-constant
f707a9
Version:        1.33
f707a9
Release:        1001%{?dist}
f707a9
Summary:        Perl pragma to declare constants
f707a9
License:        GPL+ or Artistic
f707a9
Group:          Development/Libraries
f707a9
URL:            http://search.cpan.org/dist/constant/
f707a9
Source0:        http://www.cpan.org/authors/id/S/SA/SAPER/constant-%{cpan_version}.tar.gz
f707a9
# Update to 1.33
f707a9
Patch0:         constant-1.33-update.patch
f707a9
BuildArch:      noarch
f707a9
BuildRequires:  perl-interpreter
f707a9
BuildRequires:  perl-generators
f707a9
BuildRequires:  perl(ExtUtils::MakeMaker)
f707a9
BuildRequires:  perl(strict)
f707a9
# Run-time:
f707a9
BuildRequires:  perl(Carp)
f707a9
BuildRequires:  perl(vars)
f707a9
BuildRequires:  perl(warnings::register)
f707a9
# Tests:
f707a9
BuildRequires:  perl(Test::More)
f707a9
BuildRequires:  perl(utf8)
f707a9
BuildRequires:  perl(warnings)
f707a9
%if %{with perl_constant_enables_optional_test} && !%{defined perl_bootstrap}
f707a9
# Optional tests:
f707a9
BuildRequires:  perl(Test::Pod) >= 1.14
f707a9
BuildRequires:  perl(Test::Pod::Coverage) >= 1.04
f707a9
%endif
f707a9
Requires:       perl(:MODULE_COMPAT_%(eval "`perl -V:version`"; echo $version))
f707a9
Requires:       perl(Carp)
f707a9
f707a9
%description
f707a9
This pragma allows you to declare constants at compile-time:
f707a9
f707a9
use constant PI => 4 * atan2(1, 1);
f707a9
f707a9
When you declare a constant such as "PI" using the method shown above,
f707a9
each machine your script runs upon can have as many digits of accuracy
f707a9
as it can use. Also, your program will be easier to read, more likely
f707a9
to be maintained (and maintained correctly), and far less likely to
f707a9
send a space probe to the wrong planet because nobody noticed the one
f707a9
equation in which you wrote 3.14195.
f707a9
f707a9
When a constant is used in an expression, Perl replaces it with its
f707a9
value at compile time, and may then optimize the expression further.
f707a9
In particular, any code in an "if (CONSTANT)" block will be optimized
f707a9
away if the constant is false.
f707a9
f707a9
%prep
f707a9
%setup -q -n constant-%{cpan_version}
f707a9
%patch0 -p1
f707a9
f707a9
%build
f707a9
perl Makefile.PL INSTALLDIRS=vendor
f707a9
make %{?_smp_mflags}
f707a9
f707a9
%install
f707a9
make pure_install DESTDIR=$RPM_BUILD_ROOT
f707a9
find $RPM_BUILD_ROOT -type f -name .packlist -exec rm -f {} \;
f707a9
%{_fixperms} $RPM_BUILD_ROOT/*
f707a9
f707a9
%check
f707a9
make test
f707a9
f707a9
%files
f707a9
%doc Changes eg README
f707a9
%{perl_vendorlib}/*
f707a9
%{_mandir}/man3/*
f707a9
f707a9
%changelog
f707a9
* Fri Mar 29 2019 Jitka Plesnikova <jplesnik@redhat.com> - 1.33-1001
f707a9
- Rebuild with enable hardening (bug #1636329)
f707a9
f707a9
* Thu Aug 23 2018 Petr Pisar <ppisar@redhat.com> - 1.33-1000
f707a9
- Increase release not to clash with perl-bootstrap:5.24 subpackages
f707a9
  (bug #1620196)
f707a9
f707a9
* Fri Apr 27 2018 Petr Pisar <ppisar@redhat.com> - 1.33-398
f707a9
- Increase release not to clash with perl-bootstrap:5.24 subpackages
f707a9
f707a9
* Wed Mar 28 2018 Petr Pisar <ppisar@redhat.com> - 1.33-397
f707a9
- Increase release not to clash with perl-bootstrap:5.24 subpackages
f707a9
f707a9
* Fri Feb 09 2018 Fedora Release Engineering <releng@fedoraproject.org> - 1.33-396
f707a9
- Rebuilt for https://fedoraproject.org/wiki/Fedora_28_Mass_Rebuild
f707a9
f707a9
* Thu Jul 27 2017 Fedora Release Engineering <releng@fedoraproject.org> - 1.33-395
f707a9
- Rebuilt for https://fedoraproject.org/wiki/Fedora_27_Mass_Rebuild
f707a9
f707a9
* Wed Jun 07 2017 Jitka Plesnikova <jplesnik@redhat.com> - 1.33-394
f707a9
- Perl 5.26 re-rebuild of bootstrapped packages
f707a9
f707a9
* Sat Jun 03 2017 Jitka Plesnikova <jplesnik@redhat.com> - 1.33-393
f707a9
- Perl 5.26 rebuild
f707a9
f707a9
* Sat Feb 11 2017 Fedora Release Engineering <releng@fedoraproject.org> - 1.33-368
f707a9
- Rebuilt for https://fedoraproject.org/wiki/Fedora_26_Mass_Rebuild
f707a9
f707a9
* Wed May 18 2016 Jitka Plesnikova <jplesnik@redhat.com> - 1.33-367
f707a9
- Perl 5.24 re-rebuild of bootstrapped packages
f707a9
f707a9
* Sat May 14 2016 Jitka Plesnikova <jplesnik@redhat.com> - 1.33-365
f707a9
- Increase release to favour standalone package
f707a9
f707a9
* Thu Feb 04 2016 Fedora Release Engineering <releng@fedoraproject.org> - 1.33-348
f707a9
- Rebuilt for https://fedoraproject.org/wiki/Fedora_24_Mass_Rebuild
f707a9
f707a9
* Thu Jun 18 2015 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 1.33-347
f707a9
- Rebuilt for https://fedoraproject.org/wiki/Fedora_23_Mass_Rebuild
f707a9
f707a9
* Wed Jun 10 2015 Jitka Plesnikova <jplesnik@redhat.com> - 1.33-346
f707a9
- Perl 5.22 re-rebuild of bootstrapped packages
f707a9
f707a9
* Thu Jun 04 2015 Jitka Plesnikova <jplesnik@redhat.com> - 1.33-345
f707a9
- Increase release to favour standalone package
f707a9
f707a9
* Wed Jun 03 2015 Jitka Plesnikova <jplesnik@redhat.com> - 1.33-336
f707a9
- Perl 5.22 rebuild
f707a9
f707a9
* Mon May 04 2015 Jitka Plesnikova <jplesnik@redhat.com> - 1.33-335
f707a9
- Patched to provide the version 1.33 which is bundled in Perl 5.22
f707a9
f707a9
* Tue Sep 09 2014 Jitka Plesnikova <jplesnik@redhat.com> - 1.31-310
f707a9
- Patched to provide the version 1.31 which is bundled in Perl 5.20
f707a9
f707a9
* Mon Sep 08 2014 Jitka Plesnikova <jplesnik@redhat.com> - 1.27-295
f707a9
- Perl 5.20 re-rebuild of bootstrapped packages
f707a9
f707a9
* Wed Aug 27 2014 Jitka Plesnikova <jplesnik@redhat.com> - 1.27-294
f707a9
- Perl 5.20 rebuild
f707a9
f707a9
* Sat Jun 07 2014 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 1.27-293
f707a9
- Rebuilt for https://fedoraproject.org/wiki/Fedora_21_Mass_Rebuild
f707a9
f707a9
* Wed Aug 14 2013 Jitka Plesnikova <jplesnik@redhat.com> - 1.27-292
f707a9
- Perl 5.18 re-rebuild of bootstrapped packages
f707a9
f707a9
* Sun Aug 04 2013 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 1.27-291
f707a9
- Rebuilt for https://fedoraproject.org/wiki/Fedora_20_Mass_Rebuild
f707a9
f707a9
* Mon Jul 15 2013 Petr Pisar <ppisar@redhat.com> - 1.27-290
f707a9
- Increase release to favour standalone package
f707a9
f707a9
* Fri Jul 12 2013 Petr Pisar <ppisar@redhat.com> - 1.27-3
f707a9
- Link minimal build-root packages against libperl.so explicitly
f707a9
f707a9
* Fri Jul 12 2013 Petr Pisar <ppisar@redhat.com> - 1.27-2
f707a9
- Migrate to ExtUtils::MakeMaker
f707a9
- Do not run optional tests at boot-strap
f707a9
f707a9
* Thu Mar 21 2013 Petr Pisar <ppisar@redhat.com> - 1.27-1
f707a9
- Specfile autogenerated by cpanspec 1.78.