106 lines
3.4 KiB
RPMSpec
106 lines
3.4 KiB
RPMSpec
# Perform optional tests
|
|
%bcond_without perl_XS_Parse_Keyword_enables_optional_test
|
|
|
|
Name: perl-XS-Parse-Keyword
|
|
Version: 0.03
|
|
Release: 2%{?dist}
|
|
Summary: XS functions to assist in parsing keyword syntax
|
|
License: GPL+ or Artistic
|
|
URL: https://metacpan.org/release/XS-Parse-Keyword
|
|
Source0: https://cpan.metacpan.org/authors/id/P/PE/PEVANS/XS-Parse-Keyword-%{version}.tar.gz
|
|
BuildRequires: coreutils
|
|
BuildRequires: perl-devel
|
|
BuildRequires: perl-generators
|
|
BuildRequires: perl-interpreter
|
|
BuildRequires: perl(base)
|
|
BuildRequires: perl(ExtUtils::CBuilder)
|
|
BuildRequires: perl(lib)
|
|
BuildRequires: perl(Module::Build)
|
|
BuildRequires: perl(strict)
|
|
BuildRequires: perl(warnings)
|
|
# Run-time:
|
|
BuildRequires: perl(:VERSION) >= 5.14
|
|
BuildRequires: perl(XSLoader)
|
|
# Tests:
|
|
BuildRequires: perl(Test::More) >= 0.88
|
|
%if %{with perl_XS_Parse_Keyword_enables_optional_test}
|
|
# Optional tests:
|
|
BuildRequires: perl(Test::Pod) >= 1.00
|
|
%endif
|
|
Requires: perl(:MODULE_COMPAT_%(eval "`perl -V:version`"; echo $version))
|
|
|
|
# Remove under-specified dependencies
|
|
%global __requires_exclude %{?__requires_exclude:%{__requires_exclude}|}^perl\\(Test::More\\)$
|
|
# Filter private modules
|
|
%global __requires_exclude %{__requires_exclude}|^perl\\(testcase\\)
|
|
%global __provides_exclude %{?__provides_exclude:%{__provides_exclude}|}^perl\\(testcase\\)
|
|
|
|
%description
|
|
This module provides some XS functions to assist in writing syntax modules
|
|
that provide new perl-visible syntax, primarily for authors of keyword plugins
|
|
using the PL_keyword_plugin hook mechanism.
|
|
|
|
%package tests
|
|
Summary: Tests for %{name}
|
|
Requires: %{name}%{?_isa} = %{?epoch:%{epoch}:}%{version}-%{release}
|
|
Requires: perl-Test-Harness
|
|
Requires: perl(Test::More) >= 0.88
|
|
Requires: perl(XSLoader)
|
|
|
|
%description tests
|
|
Tests from %{name}. Execute them
|
|
with "%{_libexecdir}/%{name}/test".
|
|
|
|
%prep
|
|
%setup -q -n XS-Parse-Keyword-%{version}
|
|
%if !%{with perl_XS_Parse_Keyword_enables_optional_test}
|
|
rm t/99pod.t
|
|
perl -i -ne 'print $_ unless m{\A\Qt/99pod.t\E\b}' MANIFEST
|
|
%endif
|
|
chmod +x t/*.t
|
|
|
|
%build
|
|
perl Build.PL --installdirs=vendor --optimize="$RPM_OPT_FLAGS"
|
|
./Build
|
|
# Build object files for tests now. They are installed into tests subpackage.
|
|
./Build testlib
|
|
|
|
%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}
|
|
find %{buildroot}%{_libexecdir}/%{name} -type f \
|
|
\( -name '*.bs' -o -name '*.c' -o -name '*.o' \) -delete
|
|
%if %{with perl_XS_Parse_Keyword_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
|
|
%{perl_vendorarch}/auto/*
|
|
%{perl_vendorarch}/XS*
|
|
%{_mandir}/man3/*
|
|
|
|
%files tests
|
|
%{_libexecdir}/%{name}
|
|
|
|
%changelog
|
|
* Tue May 04 2021 Petr Pisar <ppisar@redhat.com> - 0.03-2
|
|
- Require XSLoader for the tests
|
|
|
|
* Fri Apr 30 2021 Petr Pisar <ppisar@redhat.com> 0.03-1
|
|
- Specfile autogenerated by cpanspec 1.78.
|