From acf0b3e307b1f459e394dc771eeaaa324f40d655 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Petr=20P=C3=ADsa=C5=99?= Date: Tue, 4 May 2021 13:16:44 +0200 Subject: [PATCH] Import Reviewed in bug #1955618. --- .gitignore | 1 + perl-XS-Parse-Keyword.spec | 101 +++++++++++++++++++++++++++++++++++++ sources | 1 + 3 files changed, 103 insertions(+) create mode 100644 .gitignore create mode 100644 perl-XS-Parse-Keyword.spec create mode 100644 sources diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..9cd7c47 --- /dev/null +++ b/.gitignore @@ -0,0 +1 @@ +/XS-Parse-Keyword-0.03.tar.gz diff --git a/perl-XS-Parse-Keyword.spec b/perl-XS-Parse-Keyword.spec new file mode 100644 index 0000000..f305337 --- /dev/null +++ b/perl-XS-Parse-Keyword.spec @@ -0,0 +1,101 @@ +# Perform optional tests +%bcond_without perl_XS_Parse_Keyword_enables_optional_test + +Name: perl-XS-Parse-Keyword +Version: 0.03 +Release: 1%{?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 + +%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 +* Fri Apr 30 2021 Petr Pisar 0.03-1 +- Specfile autogenerated by cpanspec 1.78. diff --git a/sources b/sources new file mode 100644 index 0000000..c742a73 --- /dev/null +++ b/sources @@ -0,0 +1 @@ +SHA512 (XS-Parse-Keyword-0.03.tar.gz) = d75b676ce6f146c830768a90c2443a6a2a4932a484dda7de5a15e36976a7debc7402d064c88fd3e919cd7ac598bd321b0053c74a6d113b061f3a2317afa41225