Merged update from upstream sources

This is an automated DistroBaker update from upstream sources.
If you do not know what this is about or would like to opt out,
contact the OSCI team.

Source: https://src.fedoraproject.org/rpms/perl-IO-Compress.git#4b0f0c6d85a90b493e6decd9941699849df7e2ef
This commit is contained in:
DistroBaker 2021-03-11 20:23:52 +00:00
parent 8181a2b29f
commit a661c0498e
6 changed files with 99 additions and 6 deletions

1
.fmf/version Normal file
View File

@ -0,0 +1 @@
1

7
gating.yaml Normal file
View File

@ -0,0 +1,7 @@
--- !Policy
product_versions:
- fedora-*
decision_context: bodhi_update_push_stable
subject_type: koji_build
rules:
- !PassingTestCaseRule {test_case_name: fedora-ci.koji-build.tier0.functional}

View File

@ -7,11 +7,14 @@
%bcond_with perl_IO_Compress_enables_optional_test
%endif
# Dependency version if different to this package version
%global depver 2.101
%{?perl_default_filter}
Name: perl-IO-Compress
Version: 2.101
Release: 1%{?dist}
Version: 2.102
Release: 2%{?dist}
Summary: Read and write compressed data
License: GPL+ or Artistic
URL: https://metacpan.org/release/IO-Compress
@ -30,8 +33,8 @@ BuildRequires: perl(File::Spec::Functions)
# Module Runtime
BuildRequires: perl(bytes)
BuildRequires: perl(Carp)
BuildRequires: perl(Compress::Raw::Bzip2) >= %{version}
BuildRequires: perl(Compress::Raw::Zlib) >= %{version}
BuildRequires: perl(Compress::Raw::Bzip2) >= %{?depver}%{!?depver:%{version}}
BuildRequires: perl(Compress::Raw::Zlib) >= %{?depver}%{!?depver:%{version}}
BuildRequires: perl(constant)
BuildRequires: perl(Encode)
BuildRequires: perl(Exporter)
@ -51,6 +54,9 @@ BuildRequires: perl(warnings)
BuildRequires: perl(File::Path)
BuildRequires: perl(lib)
BuildRequires: perl(threads::shared)
%if !%{defined perl_bootstrap}
BuildRequires: perl(Test::More)
%endif
%if %{with perl_IO_Compress_enables_optional_test}
# Optional Tests
BuildRequires: perl(bytes)
@ -60,7 +66,6 @@ BuildRequires: perl(overload)
# Dual-lived module needs building early in the boot process
%if !%{defined perl_bootstrap}
BuildRequires: perl(Test::NoWarnings)
BuildRequires: perl(Test::Pod) >= 1.00
%endif
%endif
# Runtime
@ -77,6 +82,16 @@ Provides: perl-IO-Compress-Bzip2 = %{version}-%{release}
Obsoletes: perl-IO-Compress-Zlib < %{version}-%{release}
Provides: perl-IO-Compress-Zlib = %{version}-%{release}
# Filter modules bundled for tests
%global __requires_exclude %{?__requires_exclude:%__requires_exclude|}perl\\(CompTestUtils\\)
%global __requires_exclude %{__requires_exclude}|^perl\\(.*\.pl)\s*$
%if %{defined perl_bootstrap}
%global __requires_exclude %{__requires_exclude}|^perl\\(Test::Builder)\s*$
%global __requires_exclude %{__requires_exclude}|^perl\\(Test::More)\s*$
%global __requires_exclude %{__requires_exclude}|^perl\\(Test::Simple)\s*$
%endif
%global __provides_exclude_from %{?__provides_exclude_from:%__provides_exclude_from|}^%{_libexecdir}
%description
This distribution provides a Perl interface to allow reading and writing of
compressed data created with the zlib and bzip2 libraries.
@ -91,6 +106,15 @@ included with the IO-Compress distribution:
* IO-Compress-Bzip2
* IO-Compress-Base
%package tests
Summary: Tests for %{name}
Requires: %{name} = %{?epoch:%{epoch}:}%{version}-%{release}
Requires: perl-Test-Harness
%description tests
Tests from %{name}-%{version}. Execute them
with "%{_libexecdir}/%{name}/test".
%prep
%setup -q -n IO-Compress-%{version}
@ -98,19 +122,62 @@ included with the IO-Compress distribution:
chmod -c -x lib/IO/Uncompress/{Adapter/Identity,RawInflate}.pm
find examples -type f -exec chmod -c -x {} \;
%if ! %{defined perl_bootstrap}
# Remove bundled Test::* modules
rm -rf t/Test
perl -i -ne 'print $_ unless m{^t/Test/}' MANIFEST
%endif
# Fix shellbangs in examples
perl -MConfig -pi -e 's|^#!/usr/local/bin/perl\b|$Config{startperl}|' examples/io/anycat \
examples/io/bzip2/* examples/io/gzip/* examples/compress-zlib/*
# Help file to recognise the Perl scripts and normalize shebangs
for F in `find t -name *.t` `find t -name *.pl`; do
if head -1 "$F" | grep -q -e '^#!.*perl' ; then
perl -MConfig -pi -e 's|^#!.*perl\b|$Config{startperl}|' "$F"
else
perl -i -MConfig -ple 'print $Config{startperl} if $. == 1' "$F"
fi
chmod +x "$F"
done
# Remove release tests
rm t/999pod.t t/999meta-*.t
perl -i -ne 'print $_ unless m{^t/999pod\.t}' MANIFEST
perl -i -ne 'print $_ unless m{^t/999meta-.*\.t}' MANIFEST
%build
perl Makefile.PL NO_PACKLIST=1 NO_PERLLOCAL=1
%{make_build}
%install
%{make_install} INSTALLDIRS=perl
# Install tests
mkdir -p %{buildroot}/%{_libexecdir}/%{name}
cp -a examples t %{buildroot}/%{_libexecdir}/%{name}
perl -i -pe "s{\"./bin/\"}{\"%{_bindir}\"}" %{buildroot}/%{_libexecdir}/%{name}/t/011-streamzip.t
cat > %{buildroot}/%{_libexecdir}/%{name}/test << 'EOF'
#!/bin/sh
set -e
# Lots of tests write into temporary files/directories. The easiest solution
# is to copy the tests into a writable directory and execute them from there.
DIR=$(mktemp -d)
pushd "$DIR"
cp -a %{_libexecdir}/%{name}/* ./
unset PERL_CORE
prove -I . -j "$(getconf _NPROCESSORS_ONLN)"
popd
rm -rf "$DIR"
EOF
chmod +x %{buildroot}/%{_libexecdir}/%{name}/test
%{_fixperms} -c %{buildroot}
%check
unset PERL_CORE
export HARNESS_OPTIONS=j$(perl -e 'if ($ARGV[0] =~ /.*-j([0-9][0-9]*).*/) {print $1} else {print 1}' -- '%{?_smp_mflags}')
# Build using "--without long_tests" to avoid very long tests
# (full suite can take nearly an hour on an i7 920)
make test COMPRESS_ZLIB_RUN_%{?with_long_tests:ALL}%{!?with_long_tests:MOST}=1
@ -143,7 +210,16 @@ make test COMPRESS_ZLIB_RUN_%{?with_long_tests:ALL}%{!?with_long_tests:MOST}=1
%{_mandir}/man3/IO::Compress::*.3*
%{_mandir}/man3/IO::Uncompress::*.3*
%files tests
%{_libexecdir}/%{name}
%changelog
* Mon Mar 01 2021 Jitka Plesnikova <jplesnik@redhat.com> - 2.102-2
- Package tests
* Sun Feb 28 2021 Paul Howarth <paul@city-fan.org> - 2.102-1
- 2.102 bump
* Sat Feb 20 2021 Paul Howarth <paul@city-fan.org> - 2.101-1
- 2.101 bump

5
plans/sanity.fmf Normal file
View File

@ -0,0 +1,5 @@
summary: Sanity tests
discover:
how: fmf
execute:
how: tmt

View File

@ -1 +1 @@
SHA512 (IO-Compress-2.101.tar.gz) = d5787ed6ecd156a0f0899849ad7bdaa5bd53944cd6acb51ed4a6b5efde86b4a80800391ce8f6fc9004d52daa8efa70b213de57f23d3acb6cc64bd3b9c3246b69
SHA512 (IO-Compress-2.102.tar.gz) = 1dde4a9c7274106440d8cef2cba016d283472fa8de83a2f51d0acd3acbf36e2130ab1d72f238854228675abdd3653e7830db1ef59af890c3b9acd1e042cab5ea

4
tests/upstream-tests.fmf Normal file
View File

@ -0,0 +1,4 @@
summary: Upstream tests
component: perl-IO-Compress
require: perl-IO-Compress-tests
test: /usr/libexec/perl-IO-Compress/test