Package talk-to-ourself script with the tests

This commit is contained in:
Petr Písař 2021-03-09 13:11:43 +01:00
parent 5b9ee0f16f
commit b9b8a39aea

View File

@ -5,7 +5,7 @@
Name: perl-libwww-perl
Version: 6.53
Release: 1%{?dist}
Release: 2%{?dist}
Summary: A Perl interface to the World-Wide Web
License: GPL+ or Artistic
URL: https://metacpan.org/release/libwww-perl
@ -142,6 +142,7 @@ use and even classes that help you implement simple HTTP servers.
%package tests
Summary: Tests for %{name}
Requires: %{name} = %{?epoch:%{epoch}:}%{version}-%{release}
Requires: coreutils
Requires: perl-Test-Harness
Requires: perl(HTTP::Cookies) >= 6
Requires: perl(HTTP::Daemon) >= 6.01
@ -166,7 +167,7 @@ rm t/base/protocols/nntp.t t/leak/no_leak.t t/redirect.t
perl -i -ne 'print $_ unless m{^(?:t/base/protocols/nntp\.t|t/leak/no_leak\.t|t/redirect\.t)}' MANIFEST
%endif
# Help generators to recognize a Perl code
for F in $(find t -name '*.t'); do
for F in $(find t -name '*.t') talk-to-ourself; do
perl -i -MConfig -ple 'print $Config{startperl} if $. == 1 && !s{\A#!.*\bperl}{$Config{startperl}}' "$F"
chmod +x "$F"
done
@ -181,11 +182,18 @@ perl Makefile.PL INSTALLDIRS=vendor NO_PACKLIST=1 NO_PERLLOCAL=1 --aliases < /de
%{_fixperms} $RPM_BUILD_ROOT/*
# Install tests
mkdir -p %{buildroot}%{_libexecdir}/%{name}
cp -a t %{buildroot}%{_libexecdir}/%{name}
cp -a t talk-to-ourself %{buildroot}%{_libexecdir}/%{name}
cat > %{buildroot}%{_libexecdir}/%{name}/test << 'EOF'
#!/bin/bash
set -e
# t/local/http.t writes to CWD
DIR=$(mktemp -d)
cp -a %{_libexecdir}/%{name}/* "$DIR"
pushd "$DIR"
unset COVERAGE PERL_LWP_ENV_HTTP_TEST_SERVER_TIMEOUT PERL_LWP_ENV_HTTP_TEST_URL
cd %{_libexecdir}/%{name} && exec prove -I . -j "$(getconf _NPROCESSORS_ONLN)" -r
prove -I . -j "$(getconf _NPROCESSORS_ONLN)" -r
popd
rm -r "$DIR"
EOF
chmod +x %{buildroot}%{_libexecdir}/%{name}/test
@ -207,6 +215,9 @@ make test
%{_libexecdir}/%{name}
%changelog
* Tue Mar 09 2021 Petr Pisar <ppisar@redhat.com> - 6.53-2
- Package talk-to-ourself script with the tests
* Mon Mar 08 2021 Petr Pisar <ppisar@redhat.com> - 6.53-1
- 6.53 bump
- Package tests