# Perform optional tests %bcond_without perl_Syntax_Operator_Divides_enables_optional_test # A build cycle: perl-Syntax-Operator-Divides → perl-Syntax-Keyword-Match.spec %if %{with perl_Syntax_Operator_Divides_enables_optional_test} && !%{defined perl_bootstrap} %global optional_tests 1 %else %global optional_tests 0 %endif Name: perl-Syntax-Operator-Divides Version: 0.04 Release: 1%{?dist} Summary: Infix operator for division test License: GPL-1.0-or-later OR Artistic-1.0-Perl URL: https://metacpan.org/release/Syntax-Operator-Divides Source0: https://cpan.metacpan.org/authors/id/P/PE/PEVANS/Syntax-Operator-Divides-%{version}.tar.gz BuildRequires: coreutils BuildRequires: findutils BuildRequires: perl-devel BuildRequires: perl-generators BuildRequires: perl-interpreter # Version from Build.PL for pad_alloc() used in Divides.xs BuildRequires: perl(:VERSION) >= 5.16 BuildRequires: perl(ExtUtils::CBuilder) BuildRequires: perl(Module::Build) BuildRequires: perl(strict) BuildRequires: perl(warnings) BuildRequires: perl(XS::Parse::Infix::Builder) >= 0.27 # Run-time: BuildRequires: perl(Carp) BuildRequires: perl(XSLoader) # Tests: BuildRequires: perl(Test2::V0) %if %{optional_tests} # Optional tests: BuildRequires: perl(Syntax::Keyword::Match) >= 0.08 BuildRequires: perl(Test::Pod) >= 1.00 %endif %if %{defined perl_XS_Parse_Infix_ABI} # XS::Parse::Infix ABI checked in XSParseInfix.h generated by # XS::Parse::Infix::Builder. Requires: %{perl_XS_Parse_Infix_ABI} %endif %description This module provides an infix operator that implements an integer divides test which returns true if the lefthand operand is a whole multiple of the righthand. %package tests Summary: Tests for %{name} BuildArch: noarch Requires: %{name} = %{?epoch:%{epoch}:}%{version}-%{release} Requires: perl-Test-Harness %if %{optional_tests} Requires: perl(Syntax::Keyword::Match) >= 0.08 %endif %description tests Tests from %{name}. Execute them with "%{_libexecdir}/%{name}/test". %prep %setup -q -n Syntax-Operator-Divides-%{version} %if !%{optional_tests} for T in t/80match-divides.t t/99pod.t; do rm "$T" perl -i -ne 'print $_ unless m{^\Q'"$T"'\E}' MANIFEST done %endif chmod +x t/*.t %build perl Build.PL --installdirs=vendor --optimize="$RPM_OPT_FLAGS" ./Build %install ./Build install --destdir=%{buildroot} --create_packlist=0 find %{buildroot} -type f -name '*.bs' -size 0 -delete %{_fixperms} %{buildroot}/* # Install tests mkdir -p %{buildroot}%{_libexecdir}/%{name} cp -a t %{buildroot}%{_libexecdir}/%{name} %if %{optional_tests} rm %{buildroot}%{_libexecdir}/%{name}/t/99pod.t %endif 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}') ./Build test %files %license LICENSE %doc Changes README %dir %{perl_vendorarch}/auto/Syntax %dir %{perl_vendorarch}/auto/Syntax/Operator %{perl_vendorarch}/auto/Syntax/Operator/Divides %dir %{perl_vendorarch}/Syntax %dir %{perl_vendorarch}/Syntax/Operator %{perl_vendorarch}/Syntax/Operator/Divides.pm %{_mandir}/man3/Syntax::Operator::Divides.* %files tests %{_libexecdir}/%{name} %changelog * Wed Jul 26 2023 Petr Pisar - 0.04-1 - 0.04 bump * Fri Jul 21 2023 Fedora Release Engineering - 0.03-5 - Rebuilt for https://fedoraproject.org/wiki/Fedora_39_Mass_Rebuild * Wed Jul 12 2023 Jitka Plesnikova - 0.03-4 - Perl 5.38 re-rebuild of bootstrapped packages * Tue Jul 11 2023 Jitka Plesnikova - 0.03-3 - Perl 5.38 rebuild * Fri Jan 20 2023 Fedora Release Engineering - 0.03-2 - Rebuilt for https://fedoraproject.org/wiki/Fedora_38_Mass_Rebuild * Thu Jan 05 2023 Petr Pisar - 0.03-1 - 0.03 bump * Tue Oct 25 2022 Petr Pisar - 0.02-1 - 0.02 bump * Fri Jul 22 2022 Fedora Release Engineering - 0.01-6 - Rebuilt for https://fedoraproject.org/wiki/Fedora_37_Mass_Rebuild * Fri Jun 03 2022 Jitka Plesnikova - 0.01-5 - Perl 5.36 re-rebuild of bootstrapped packages * Tue May 31 2022 Jitka Plesnikova - 0.01-4 - Perl 5.36 rebuild * Fri Jan 21 2022 Fedora Release Engineering - 0.01-3 - Rebuilt for https://fedoraproject.org/wiki/Fedora_36_Mass_Rebuild * Fri Nov 12 2021 Petr Pisar - 0.01-2 - Finish bootstrap (bug #2017689) * Wed Oct 27 2021 Petr Pisar 0.01-1 - Specfile autogenerated by cpanspec 1.78.