parent
fb80f0f961
commit
12a2726e48
|
@ -0,0 +1 @@
|
|||
/Syntax-Operator-Equ-0.02.tar.gz
|
|
@ -0,0 +1,119 @@
|
|||
# Perform optional tests
|
||||
%bcond_without perl_Syntax_Operator_Equ_enables_optional_test
|
||||
|
||||
# Bootstrap until perl-Syntax-Keyword-Match is packaged
|
||||
%define perl_bootstrap 1
|
||||
|
||||
# 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.02
|
||||
Release: 1%{?dist}
|
||||
Summary: Equality operators that distinguish undef
|
||||
License: GPL+ or Artistic
|
||||
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.15
|
||||
# Run-time:
|
||||
BuildRequires: perl(Carp)
|
||||
BuildRequires: perl(XSLoader)
|
||||
# Tests:
|
||||
BuildRequires: perl(overload)
|
||||
BuildRequires: perl(Test::More) >= 0.88
|
||||
%if %{optional_tests}
|
||||
# Optional tests:
|
||||
BuildRequires: perl(Syntax::Keyword::Match) >= 0.08
|
||||
BuildRequires: perl(Test::Pod) >= 1.00
|
||||
%endif
|
||||
Requires: perl(:MODULE_COMPAT_%(eval "`perl -V:version`"; echo $version))
|
||||
%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
|
||||
%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/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
|
||||
%{perl_vendorarch}/auto/*
|
||||
%{perl_vendorarch}/Syntax*
|
||||
%{_mandir}/man3/*
|
||||
|
||||
%files tests
|
||||
%{_libexecdir}/%{name}
|
||||
|
||||
%changelog
|
||||
* Wed Oct 27 2021 Petr Pisar <ppisar@redhat.com> 0.02-1
|
||||
- Specfile autogenerated by cpanspec 1.78.
|
Loading…
Reference in New Issue