# Perform optional tests %bcond_without perl_Bytes_Random_Secure_enables_optional_test Name: perl-Bytes-Random-Secure Version: 0.29 Release: 29%{?dist} Summary: Perl extension to generate cryptographically-secure random bytes License: GPL-1.0-or-later OR Artistic-1.0-Perl URL: https://metacpan.org/release/Bytes-Random-Secure Source0: https://cpan.metacpan.org/modules/by-module/Bytes/Bytes-Random-Secure-%{version}.tar.gz BuildArch: noarch BuildRequires: coreutils BuildRequires: make BuildRequires: perl-generators BuildRequires: perl-interpreter BuildRequires: perl(:VERSION) >= 5.6 BuildRequires: perl(Config) BuildRequires: perl(ExtUtils::MakeMaker) >= 6.76 BuildRequires: perl(strict) BuildRequires: perl(warnings) # Run-time: BuildRequires: perl(Carp) BuildRequires: perl(constant) BuildRequires: perl(Crypt::Random::Seed) BuildRequires: perl(Exporter) BuildRequires: perl(Math::Random::ISAAC) BuildRequires: perl(MIME::Base64) BuildRequires: perl(MIME::QuotedPrint) >= 3.03 BuildRequires: perl(Scalar::Util) >= 1.21 # Tests: BuildRequires: perl(Data::Dumper) BuildRequires: perl(List::Util) BuildRequires: perl(Test::More) >= 0.98 BuildRequires: perl(Time::HiRes) %if %{with perl_Bytes_Random_Secure_enables_optional_test} # Optional tests: BuildRequires: perl(Statistics::Basic) BuildRequires: perl(Test::Warn) %endif Requires: perl(Scalar::Util) >= 1.21 Requires: perl(MIME::QuotedPrint) >= 3.03 %global __requires_exclude %{?__requires_exclude:%{__requires_exclude}|}^perl\\((MIME::QuotedPrint|Scalar::Util)\\)$ %description Bytes::Random::Secure provides two interfaces for obtaining crypto-quality random bytes. The simple interface is built around plain functions. For greater control over the random number generator's seeding, there is an object-oriented interface that provides much more flexibility. %package tests Summary: Tests for %{name} BuildArch: noarch Requires: %{name} = %{?epoch:%{epoch}:}%{version}-%{release} Requires: perl-Test-Harness Requires: perl(Crypt::Random::Seed) Requires: perl(Math::Random::ISAAC) Requires: perl(MIME::QuotedPrint) >= 3.03 %if %{with perl_Bytes_Random_Secure_enables_optional_test} Requires: perl(Statistics::Basic) Requires: perl(Test::Warn) %endif %description tests Tests from %{name}. Execute them with "%{_libexecdir}/%{name}/test". %prep %setup -q -n Bytes-Random-Secure-%{version} # Remove always skipped tests for F in t/01-manifest.t t/02-pod.t t/03-pod-coverage.t t/04-perlcritic.t \ t/05-kwalitee.t t/06-meta-yaml.t t/07-meta-json.t t/09-changes.t \ %if !%{with perl_Bytes_Random_Secure_enables_optional_test} t/21-bytes_random_tests.t \ %endif ; do rm "$F" perl -i -ne 'print $_ unless m{^\Q'"$F"'\E}' MANIFEST done # Help generators to recognize Perl scripts for F in t/*.t; do perl -i -MConfig -ple 'print $Config{startperl} if $. == 1 && !s{\A#!\s*perl}{$Config{startperl}}' "$F" chmod +x "$F" done %build perl Makefile.PL INSTALLDIRS=vendor NO_PACKLIST=1 NO_PERLLOCAL=1 %{make_build} %install %{make_install} %{_fixperms} %{buildroot}/* # Install tests mkdir -p %{buildroot}%{_libexecdir}/%{name} cp -a t %{buildroot}%{_libexecdir}/%{name} # Inspects unrelated files rm %{buildroot}%{_libexecdir}/%{name}/t/00-boilerplate.t cat > %{buildroot}%{_libexecdir}/%{name}/test << 'EOF' #!/bin/sh cd %{_libexecdir}/%{name} && exec prove -I . -j "$(getconf _NPROCESSORS_ONLN)" EOF chmod +x %{buildroot}%{_libexecdir}/%{name}/test %check export HARNESS_OPTIONS=j$(perl -e 'if ($ARGV[0] =~ /.*-j([0-9][0-9]*).*/) {print $1} else {print 1}' -- '%{?_smp_mflags}') make test %files %doc Changes README examples %dir %{perl_vendorlib}/Bytes %dir %{perl_vendorlib}/Bytes/Random %{perl_vendorlib}/Bytes/Random/Secure.pm %{_mandir}/man3/Bytes::Random::Secure.* %files tests %{_libexecdir}/%{name} %changelog * Wed Oct 16 2024 Petr Pisar - 0.29-29 - Require optional modules from perl-Bytes-Random-Secure-tests * Wed Oct 16 2024 Petr Pisar - 0.29-28 - Improve running the tests - Package the tests * Thu Jul 18 2024 Fedora Release Engineering - 0.29-27 - Rebuilt for https://fedoraproject.org/wiki/Fedora_41_Mass_Rebuild * Thu Jan 25 2024 Fedora Release Engineering - 0.29-26 - Rebuilt for https://fedoraproject.org/wiki/Fedora_40_Mass_Rebuild * Sun Jan 21 2024 Fedora Release Engineering - 0.29-25 - Rebuilt for https://fedoraproject.org/wiki/Fedora_40_Mass_Rebuild * Thu Jul 20 2023 Fedora Release Engineering - 0.29-24 - Rebuilt for https://fedoraproject.org/wiki/Fedora_39_Mass_Rebuild * Fri Jan 20 2023 Fedora Release Engineering - 0.29-23 - Rebuilt for https://fedoraproject.org/wiki/Fedora_38_Mass_Rebuild * Fri Jul 22 2022 Fedora Release Engineering - 0.29-22 - Rebuilt for https://fedoraproject.org/wiki/Fedora_37_Mass_Rebuild * Tue May 31 2022 Jitka Plesnikova - 0.29-21 - Perl 5.36 rebuild * Thu Jan 20 2022 Fedora Release Engineering - 0.29-20 - Rebuilt for https://fedoraproject.org/wiki/Fedora_36_Mass_Rebuild * Thu Jul 22 2021 Fedora Release Engineering - 0.29-19 - Rebuilt for https://fedoraproject.org/wiki/Fedora_35_Mass_Rebuild * Fri May 21 2021 Jitka Plesnikova - 0.29-18 - Perl 5.34 rebuild * Tue Jan 26 2021 Fedora Release Engineering - 0.29-17 - Rebuilt for https://fedoraproject.org/wiki/Fedora_34_Mass_Rebuild * Tue Jul 28 2020 Fedora Release Engineering - 0.29-16 - Rebuilt for https://fedoraproject.org/wiki/Fedora_33_Mass_Rebuild * Tue Jun 23 2020 Jitka Plesnikova - 0.29-15 - Perl 5.32 rebuild * Tue Mar 10 2020 Petr Pisar - 0.29-14 - Modernize a spec file * Wed Jan 29 2020 Fedora Release Engineering - 0.29-13 - Rebuilt for https://fedoraproject.org/wiki/Fedora_32_Mass_Rebuild * Fri Jul 26 2019 Fedora Release Engineering - 0.29-12 - Rebuilt for https://fedoraproject.org/wiki/Fedora_31_Mass_Rebuild * Fri May 31 2019 Jitka Plesnikova - 0.29-11 - Perl 5.30 rebuild * Fri Feb 01 2019 Fedora Release Engineering - 0.29-10 - Rebuilt for https://fedoraproject.org/wiki/Fedora_30_Mass_Rebuild * Fri Jul 13 2018 Fedora Release Engineering - 0.29-9 - Rebuilt for https://fedoraproject.org/wiki/Fedora_29_Mass_Rebuild * Fri Jun 29 2018 Jitka Plesnikova - 0.29-8 - Perl 5.28 rebuild * Thu Feb 08 2018 Fedora Release Engineering - 0.29-7 - Rebuilt for https://fedoraproject.org/wiki/Fedora_28_Mass_Rebuild * Thu Jul 27 2017 Fedora Release Engineering - 0.29-6 - Rebuilt for https://fedoraproject.org/wiki/Fedora_27_Mass_Rebuild * Mon Jun 05 2017 Jitka Plesnikova - 0.29-5 - Perl 5.26 rebuild * Sat Feb 11 2017 Fedora Release Engineering - 0.29-4 - Rebuilt for https://fedoraproject.org/wiki/Fedora_26_Mass_Rebuild * Sun May 15 2016 Jitka Plesnikova - 0.29-3 - Perl 5.24 rebuild * Thu Feb 04 2016 Fedora Release Engineering - 0.29-2 - Rebuilt for https://fedoraproject.org/wiki/Fedora_24_Mass_Rebuild * Mon Oct 26 2015 Jitka Plesnikova - 0.29-1 - 0.29 bump * Thu Jun 18 2015 Fedora Release Engineering - 0.28-3 - Rebuilt for https://fedoraproject.org/wiki/Fedora_23_Mass_Rebuild * Sat Jun 06 2015 Jitka Plesnikova - 0.28-2 - Perl 5.22 rebuild * Sun Jan 18 2015 David Dick - 0.28-1 - Initial release