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