155 lines
4.8 KiB
RPMSpec
155 lines
4.8 KiB
RPMSpec
# Perform optional tests
|
|
%bcond_without perl_Syntax_Operator_Equ_enables_optional_test
|
|
|
|
# A build cycle: perl-Syntax-Operator-Equ → perl-Syntax-Keyword-Match.spec
|
|
%if %{with perl_Syntax_Operator_Equ_enables_optional_test} && !%{defined perl_bootstrap}
|
|
%global optional_tests 1
|
|
%else
|
|
%global optional_tests 0
|
|
%endif
|
|
|
|
Name: perl-Syntax-Operator-Equ
|
|
Version: 0.05
|
|
Release: 1%{?dist}
|
|
Summary: Equality operators that distinguish undef
|
|
License: GPL-1.0-or-later OR Artistic-1.0-Perl
|
|
URL: https://metacpan.org/release/Syntax-Operator-Equ
|
|
Source0: https://cpan.metacpan.org/authors/id/P/PE/PEVANS/Syntax-Operator-Equ-%{version}.tar.gz
|
|
BuildRequires: coreutils
|
|
BuildRequires: findutils
|
|
BuildRequires: perl-devel
|
|
BuildRequires: perl-generators
|
|
BuildRequires: perl-interpreter
|
|
BuildRequires: perl(:VERSION) >= 5.14
|
|
BuildRequires: perl(ExtUtils::CBuilder)
|
|
BuildRequires: perl(Module::Build)
|
|
BuildRequires: perl(strict)
|
|
BuildRequires: perl(warnings)
|
|
BuildRequires: perl(XS::Parse::Infix::Builder) >= 0.26
|
|
# Run-time:
|
|
BuildRequires: perl(Carp)
|
|
BuildRequires: perl(XSLoader)
|
|
# Tests:
|
|
BuildRequires: perl(B::Deparse)
|
|
BuildRequires: perl(overload)
|
|
BuildRequires: perl(Test::More) >= 0.88
|
|
%if %{optional_tests}
|
|
# Optional tests:
|
|
BuildRequires: perl(Syntax::Keyword::Match) >= 0.08
|
|
%if 0%{?fedora} >= 39
|
|
# Requires PL_infix_plugin support in Perl (since 5.37.7)
|
|
BuildRequires: perl(Syntax::Operator::Equ)
|
|
BuildRequires: perl(Syntax::Operator::In) >= 0.03
|
|
%endif
|
|
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
|
|
|
|
# Remove under-specified dependencies
|
|
%global __requires_exclude %{?__requires_exclude:%{__requires_exclude}|}^perl\\(Test::More\\)$
|
|
|
|
%description
|
|
This module provides infix operators that implement equality tests of
|
|
strings or numbers similar to Perl's eq and == operators, except that they
|
|
consider undef to be a distinct value, separate from the empty string or
|
|
the number zero.
|
|
|
|
%package tests
|
|
Summary: Tests for %{name}
|
|
BuildArch: noarch
|
|
Requires: %{name} = %{?epoch:%{epoch}:}%{version}-%{release}
|
|
Requires: perl-Test-Harness
|
|
Requires: perl(Test::More) >= 0.88
|
|
%if %{optional_tests}
|
|
Requires: perl(Syntax::Keyword::Match) >= 0.08
|
|
%if 0%{?fedora} >= 39
|
|
# Requires PL_infix_plugin support in Perl (since 5.37.7)
|
|
Requires: perl(Syntax::Operator::Equ)
|
|
Requires: perl(Syntax::Operator::In) >= 0.03
|
|
%endif
|
|
%endif
|
|
|
|
%description tests
|
|
Tests from %{name}. Execute them
|
|
with "%{_libexecdir}/%{name}/test".
|
|
|
|
%prep
|
|
%setup -q -n Syntax-Operator-Equ-%{version}
|
|
%if !%{optional_tests}
|
|
for T in t/80in+equ.t t/80match-equ.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/Equ
|
|
%dir %{perl_vendorarch}/Syntax
|
|
%dir %{perl_vendorarch}/Syntax/Operator
|
|
%{perl_vendorarch}/Syntax/Operator/Equ.pm
|
|
%{_mandir}/man3/Syntax::Operator::Equ.*
|
|
|
|
%files tests
|
|
%{_libexecdir}/%{name}
|
|
|
|
%changelog
|
|
* Thu Jan 05 2023 Petr Pisar <ppisar@redhat.com> - 0.05-1
|
|
- 0.05 bump
|
|
|
|
* Tue Oct 25 2022 Petr Pisar <ppisar@redhat.com> - 0.04-1
|
|
- 0.04 bump
|
|
|
|
* Fri Jul 22 2022 Fedora Release Engineering <releng@fedoraproject.org> - 0.03-2
|
|
- Rebuilt for https://fedoraproject.org/wiki/Fedora_37_Mass_Rebuild
|
|
|
|
* Mon Jun 27 2022 Petr Pisar <ppisar@redhat.com> - 0.03-1
|
|
- 0.03 bump
|
|
|
|
* Fri Jun 03 2022 Jitka Plesnikova <jplesnik@redhat.com> - 0.02-5
|
|
- Perl 5.36 re-rebuild of bootstrapped packages
|
|
|
|
* Tue May 31 2022 Jitka Plesnikova <jplesnik@redhat.com> - 0.02-4
|
|
- Perl 5.36 rebuild
|
|
|
|
* Fri Jan 21 2022 Fedora Release Engineering <releng@fedoraproject.org> - 0.02-3
|
|
- Rebuilt for https://fedoraproject.org/wiki/Fedora_36_Mass_Rebuild
|
|
|
|
* Fri Nov 12 2021 Petr Pisar <ppisar@redhat.com> - 0.02-2
|
|
- Finish bootstrap (bug #2017700)
|
|
|
|
* Wed Oct 27 2021 Petr Pisar <ppisar@redhat.com> 0.02-1
|
|
- Specfile autogenerated by cpanspec 1.78.
|