diff --git a/Command-Runner-0.100-Dont-load-Win32-ShellQuote.patch b/Command-Runner-0.100-Dont-load-Win32-ShellQuote.patch new file mode 100644 index 0000000000000000000000000000000000000000..dba7817185c6e8a8e24af29e1a6068486e8c53a8 --- /dev/null +++ b/Command-Runner-0.100-Dont-load-Win32-ShellQuote.patch @@ -0,0 +1,24 @@ +diff -up Command-Runner-0.100/lib/Command/Runner/Quote.pm.orig Command-Runner-0.100/lib/Command/Runner/Quote.pm +--- Command-Runner-0.100/lib/Command/Runner/Quote.pm.orig 2018-05-02 09:49:44.535395473 +0200 ++++ Command-Runner-0.100/lib/Command/Runner/Quote.pm 2018-05-02 09:51:05.873903588 +0200 +@@ -2,18 +2,17 @@ package Command::Runner::Quote; + use strict; + use warnings; + +-use Win32::ShellQuote (); +-use String::ShellQuote (); +- + use Exporter 'import'; + our @EXPORT_OK = qw(quote quote_win32 quote_unix); + + sub quote_win32 { ++ require Win32::ShellQuote; + my $str = shift; + Win32::ShellQuote::quote_literal($str, 1); + } + + sub quote_unix { ++ require String::ShellQuote; + my $str = shift; + String::ShellQuote::shell_quote_best_effort($str); + } diff --git a/Command-Runner-0.200.tar.gz b/Command-Runner-0.200.tar.gz new file mode 100644 index 0000000000000000000000000000000000000000..65b2a301e404b99552894907e6596c2014b3f33c Binary files /dev/null and b/Command-Runner-0.200.tar.gz differ diff --git a/perl-Command-Runner.spec b/perl-Command-Runner.spec new file mode 100644 index 0000000000000000000000000000000000000000..8160559a08118b5226d7429fb8facac022f19ea5 --- /dev/null +++ b/perl-Command-Runner.spec @@ -0,0 +1,82 @@ +Name: perl-Command-Runner +Version: 0.200 +Release: 1 +Summary: Run external commands and Perl code references +License: GPL-1.0-or-later OR Artistic-1.0-Perl +URL: https://metacpan.org/release/Command-Runner +Source0: https://cpan.metacpan.org/authors/id/S/SK/SKAJI/Command-Runner-%{version}.tar.gz + +# Update Command::Runner::Quote to not load Win32::ShellQuote on +# non-MSWin32 systems +Patch0: Command-Runner-0.100-Dont-load-Win32-ShellQuote.patch + +BuildArch: noarch + +BuildRequires: coreutils +BuildRequires: perl-generators +BuildRequires: perl-interpreter +BuildRequires: perl(:VERSION) >= 5.8.1 +BuildRequires: perl(Module::Build::Tiny) >= 0.034 +BuildRequires: perl(strict) +BuildRequires: perl(warnings) +# Run-time +BuildRequires: perl(Capture::Tiny) +BuildRequires: perl(Config) +BuildRequires: perl(constant) +BuildRequires: perl(Exporter) +BuildRequires: perl(File::pushd) +BuildRequires: perl(IO::Select) +BuildRequires: perl(POSIX) +BuildRequires: perl(String::ShellQuote) +BuildRequires: perl(Time::HiRes) +# Tests +BuildRequires: perl(File::Temp) +BuildRequires: perl(Test::More) >= 0.98 +Requires: perl(String::ShellQuote) +Requires: %{name} = %{?epoch:%{epoch}:}%{version}-%{release} +Requires: perl-Test-Harness + +%description +This module runs external commands and Perl code references. + + +%prep +%setup -q -n Command-Runner-%{version} +%patch0 -p1 +# Help generators to recognize Perl scripts +for F in t/*.t; do + perl -i -MConfig -ple 'print $Config{startperl} if $. == 1 && !s{\A#!.*perl\b}{$Config{startperl}}' "$F" + chmod +x "$F" +done + +%build +perl Build.PL --installdirs=vendor +./Build + +%install +./Build install --destdir=%{buildroot} --create_packlist=0 +%{_fixperms} %{buildroot}/* + +# Install tests +mkdir -p %{buildroot}%{_libexecdir}/%{name} +cp -a t %{buildroot}%{_libexecdir}/%{name} +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 +%{perl_vendorlib}/* +%{_mandir}/man3/* +%{_libexecdir}/%{name} + +%changelog +* Wed Jul 12 2023 leeffo - 0.200-1 +- init package diff --git a/perl-Command-Runner.yaml b/perl-Command-Runner.yaml new file mode 100644 index 0000000000000000000000000000000000000000..1d5076f6b211c0306b31d95cd9f7644ad241b63d --- /dev/null +++ b/perl-Command-Runner.yaml @@ -0,0 +1,4 @@ +version_control: metacpan +src_repo: Command-Runner +tag_prefix: ^v +separator: .