# Perform optional tests %bcond_without perl_Syntax_Keyword_MultiSub_enables_optional_test Name: perl-Syntax-Keyword-MultiSub Version: 0.04 Release: 8%{?dist} Summary: Multiple dispatch on subroutines License: GPL-1.0-or-later OR Artistic-1.0-Perl URL: https://metacpan.org/release/Syntax-Keyword-MultiSub Source0: https://cpan.metacpan.org/authors/id/P/PE/PEVANS/Syntax-Keyword-MultiSub-%{version}.tar.gz # Fix formatting a string, CPAN RT#140687 Patch0: Syntax-Keyword-MultiSub-0.02-Fix-formatting-an-IV-variable.patch BuildRequires: coreutils BuildRequires: findutils # glibc-common for iconv tool BuildRequires: glibc-common BuildRequires: perl-devel BuildRequires: perl-generators BuildRequires: perl-interpreter BuildRequires: perl(ExtUtils::CBuilder) BuildRequires: perl(Module::Build) BuildRequires: perl(strict) BuildRequires: perl(warnings) %define xs_parse_sublike_min_ver 0.15 BuildRequires: perl(XS::Parse::Sublike::Builder) >= %{xs_parse_sublike_min_ver} # Run-time: BuildRequires: perl(Carp) BuildRequires: perl(XSLoader) # Tests: BuildRequires: perl(:VERSION) >= 5.26 BuildRequires: perl(experimental) BuildRequires: perl(Test2::V0) BuildRequires: perl(XS::Parse::Sublike) >= %{xs_parse_sublike_min_ver} %if %{with perl_Syntax_Keyword_MultiSub_enables_optional_test} # Optional tests: BuildRequires: perl(feature) BuildRequires: perl(Future) BuildRequires: perl(Future::AsyncAwait) >= 0.55 BuildRequires: perl(Test::Pod) >= 1.00 %endif # lib/Syntax/Keyword/MultiSub.xs includes XSParseSublike.h generated by # XS::Parse::Sublike::Builder which loads XS::Parse::Sublike of version # specified by boot_xs_parse_sublike() argument in MultiSub.xs. Requires: perl(XS::Parse::Sublike) >= %{xs_parse_sublike_min_ver} %if %{defined perl_XS_Parse_Sublike_ABI} # XS::Parse::Sublike maintains multiple ABIs whose compatibility is checked at # run-time by S_boot_xs_parse_sublike() compiled into this package. # The ABI is defined in XSPARSESUBLIKE_ABI_VERSION of XSParseSublike.h Requires: %{perl_XS_Parse_Sublike_ABI} %endif %description This module provides a new keyword, multi, to put before subroutine declarations, which permits multiple distinct function bodies to be provided, which take different parameters. A call to a multi sub will invoke whichever function body best fits the arguments passed. %package tests Summary: Tests for %{name} BuildArch: noarch Requires: %{name} = %{?epoch:%{epoch}:}%{version}-%{release} Requires: perl-Test-Harness %if %{with perl_Syntax_Keyword_MultiSub_enables_optional_test} # Optional tests: Requires: perl(feature) Requires: perl(Future) Requires: perl(Future::AsyncAwait) >= 0.55 %endif %description tests Tests from %{name}. Execute them with "%{_libexecdir}/%{name}/test". %prep %autosetup -p1 -n Syntax-Keyword-MultiSub-%{version} %if !%{with perl_Syntax_Keyword_MultiSub_enables_optional_test} rm t/80async-multi-sub.t perl -i -ne 'print $_ unless m{^t/80async-multi-sub\.t}' MANIFEST %endif chmod +x t/*.t # Normalize an encoding iconv -f ISO-8859-1 -t UTF-8 README.new touch -r README README.new mv README.new README %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 %{with perl_Syntax_Keyword_MultiSub_enables_optional_test} 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/Keyword %{perl_vendorarch}/auto/Syntax/Keyword/MultiSub %dir %{perl_vendorarch}/Syntax %dir %{perl_vendorarch}/Syntax/Keyword %{perl_vendorarch}/Syntax/Keyword/MultiSub.pm %{_mandir}/man3/Syntax::Keyword::MultiSub.* %files tests %{_libexecdir}/%{name} %changelog * Sat Jan 18 2025 Fedora Release Engineering - 0.04-8 - Rebuilt for https://fedoraproject.org/wiki/Fedora_42_Mass_Rebuild * Fri Jul 19 2024 Fedora Release Engineering - 0.04-7 - Rebuilt for https://fedoraproject.org/wiki/Fedora_41_Mass_Rebuild * Tue Jun 11 2024 Jitka Plesnikova - 0.04-6 - Perl 5.40 rebuild * Thu Jan 25 2024 Fedora Release Engineering - 0.04-5 - Rebuilt for https://fedoraproject.org/wiki/Fedora_40_Mass_Rebuild * Sun Jan 21 2024 Fedora Release Engineering - 0.04-4 - Rebuilt for https://fedoraproject.org/wiki/Fedora_40_Mass_Rebuild * Mon Sep 11 2023 Petr Pisar - 0.04-3 - Rebuild with perl-XS-Parse-Sublike-0.20 * Fri Jul 21 2023 Fedora Release Engineering - 0.04-2 - Rebuilt for https://fedoraproject.org/wiki/Fedora_39_Mass_Rebuild * Thu Jul 13 2023 Petr Pisar - 0.04-1 - 0.04 bump * Tue Jul 11 2023 Jitka Plesnikova - 0.03-2 - Perl 5.38 rebuild * Tue Jun 06 2023 Petr Pisar - 0.03-1 - 0.03 bump * Fri Jan 20 2023 Fedora Release Engineering - 0.02-5 - Rebuilt for https://fedoraproject.org/wiki/Fedora_38_Mass_Rebuild * Fri Jul 22 2022 Fedora Release Engineering - 0.02-4 - Rebuilt for https://fedoraproject.org/wiki/Fedora_37_Mass_Rebuild * Tue May 31 2022 Jitka Plesnikova - 0.02-3 - Perl 5.36 rebuild * Fri Jan 21 2022 Fedora Release Engineering - 0.02-2 - Rebuilt for https://fedoraproject.org/wiki/Fedora_36_Mass_Rebuild * Tue Jan 11 2022 Petr Pisar 0.02-1 - Specfile autogenerated by cpanspec 1.78.