diff --git a/perl-IO-Compress.spec b/perl-IO-Compress.spec index b9e9157d97b2531001c4f4934cb3816d7ffa03be..1f6afe5a3f49be574f37232195e0d6b089ede88e 100644 --- a/perl-IO-Compress.spec +++ b/perl-IO-Compress.spec @@ -1,81 +1,50 @@ -%define anolis_release 2 -# Run time expensive tests +%define anolis_release 3 %bcond_without long_tests -%bcond_with perl_IO_Compress_enables_optional_test - -# Dependency version if different to this package version -#global depver 2.201 +%bcond_with optional_test +%global modname IO-Compress %{?perl_default_filter} -Name: perl-IO-Compress +Name: perl-%{modname} Version: 2.201 Release: %{anolis_release}%{?dist} Summary: Read and write compressed data License: GPL-1.0-or-later OR Artistic-1.0-Perl -URL: https://metacpan.org/release/IO-Compress -Source0: https://cpan.metacpan.org/modules/by-module/IO/IO-Compress-%{version}.tar.gz -BuildArch: noarch -# Module Build -BuildRequires: coreutils -BuildRequires: findutils -BuildRequires: make -BuildRequires: perl-generators -BuildRequires: perl-interpreter -BuildRequires: perl(Config) +URL: https://metacpan.org/release/%{modname} +Source0: https://cpan.metacpan.org/modules/by-module/IO/%{modname}-%{version}.tar.gz + +BuildRequires: make coreutils findutils perl-generators perl-interpreter +BuildRequires: perl(Config) perl(lib) perl(bytes) perl(Carp) perl(constant) +BuildRequires: perl(File::Copy) perl(File::Spec::Functions) perl(File::Glob) +BuildRequires: perl(Compress::Raw::Bzip2) >= %{version} +BuildRequires: perl(Compress::Raw::Zlib) >= %{version} BuildRequires: perl(ExtUtils::MakeMaker) >= 6.76 -BuildRequires: perl(File::Copy) -BuildRequires: perl(File::Spec::Functions) -# Module Runtime -BuildRequires: perl(bytes) -BuildRequires: perl(Carp) -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) -BuildRequires: perl(Fcntl) -BuildRequires: perl(File::Glob) -BuildRequires: perl(File::Spec) -BuildRequires: perl(IO::File) -BuildRequires: perl(IO::Handle) -BuildRequires: perl(List::Util) -BuildRequires: perl(Scalar::Util) -BuildRequires: perl(strict) -BuildRequires: perl(Symbol) -BuildRequires: perl(Time::Local) -BuildRequires: perl(utf8) -BuildRequires: perl(warnings) -# Test Suite -BuildRequires: perl(File::Path) -BuildRequires: perl(lib) -BuildRequires: perl(threads::shared) +BuildRequires: perl(Fcntl) perl(Encode) perl(Exporter) +BuildRequires: perl(File::Spec) perl(IO::File) perl(File::Path) perl(List::Util) +BuildRequires: perl(Symbol) perl(strict) perl(Scalar::Util) perl(threads::shared) +BuildRequires: perl(Time::Local) perl(utf8) perl(warnings) perl(IO::Handle) + %if !%{defined perl_bootstrap} BuildRequires: perl(Test::More) %endif -%if %{with perl_IO_Compress_enables_optional_test} -# Optional Tests -BuildRequires: perl(bytes) -BuildRequires: perl(Data::Dumper) -BuildRequires: perl(File::Temp) -BuildRequires: perl(overload) -# Dual-lived module needs building early in the boot process +%if %{with optional_test} +BuildRequires: perl(bytes) perl(Data::Dumper) perl(File::Temp) perl(overload) %if !%{defined perl_bootstrap} BuildRequires: perl(Test::NoWarnings) %endif %endif -# Runtime + Requires: perl(File::Glob) -# This is wrapper for different Compress modules -Obsoletes: perl-Compress-Zlib < %{version}-%{release} -Provides: perl-Compress-Zlib = %{version}-%{release} -Obsoletes: perl-IO-Compress-Base < %{version}-%{release} -Provides: perl-IO-Compress-Base = %{version}-%{release} -Obsoletes: perl-IO-Compress-Bzip2 < %{version}-%{release} -Provides: perl-IO-Compress-Bzip2 = %{version}-%{release} -Obsoletes: perl-IO-Compress-Zlib < %{version}-%{release} -Provides: perl-IO-Compress-Zlib = %{version}-%{release} +Provides: perl-Compress-Zlib = %{EVR} +Provides: perl-%{modname}-Base = %{EVR} +Provides: perl-%{modname}-Bzip2 = %{EVR} +Provides: perl-%{modname}-Zlib = %{EVR} +Obsoletes: perl-Compress-Zlib < %{EVR} +Obsoletes: perl-%{modname}-Base < %{EVR} +Obsoletes: perl-%{modname}-Bzip2 < %{EVR} +Obsoletes: perl-%{modname}-Zlib < %{EVR} +Obsoletes: perl-%{modname}-tests < %{EVR} # Filter modules bundled for tests %global __requires_exclude %{?__requires_exclude:%__requires_exclude|}perl\\(CompTestUtils\\) @@ -87,28 +56,38 @@ Provides: perl-IO-Compress-Zlib = %{version}-%{release} %endif %global __provides_exclude_from %{?__provides_exclude_from:%__provides_exclude_from|}^%{_libexecdir} +BuildArch: noarch + %description This distribution provides a Perl interface to allow reading and writing of -compressed data created with the zlib and bzip2 libraries. - -IO-Compress supports reading and writing of bzip2, RFC 1950, RFC 1951, -RFC 1952 (i.e. gzip) and zip files/buffers. - -The following modules used to be distributed separately, but are now -included with the IO-Compress distribution: -* Compress-Zlib -* IO-Compress-Zlib -* 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". +compressed data created with the zlib and bzip2. + +IO-Compress supports reading and writing of the following compressed data formats + * bzip2 + * RFC 1950 + * RFC 1951 + * RFC 1952 (i.e. gzip) + * zip + +There are a number of companion modules for IO-Compress that extend +the suite of compression formats available. + + * IO-Compress-Zstd + Adds support for zstd (Zstandard). + * IO-Compress-Lzma + Adds support for lzma, xz and lzip. + * IO-Compress-Lzf + Adds support for lzf. + * IO-Compress-Lzop + Adds support for lzop. + +Note that the following modules used to be distributed separately, but are now +included with the IO-Compress distribution. + + Compress-Zlib + IO-Compress-Zlib + IO-Compress-Bzip2 + IO-Compress-Base %package doc Summary: Documentation files for %{name} @@ -119,23 +98,22 @@ BuildArch: noarch The %{name}-doc package contains documentation files for %{name}. %prep -%setup -q -n IO-Compress-%{version} +%autosetup -n %{modname}-%{version} -# Remove spurious exec permissions -chmod -c -x lib/IO/Uncompress/{Adapter/Identity,RawInflate}.pm -find examples -type f -exec chmod -c -x {} \; +chmod -x lib/IO/Uncompress/{Adapter/Identity,RawInflate}.pm +find examples -type f -exec chmod -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/* +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 perl -i -MConfig -ple 'print $Config{startperl} if $. == 1 && !s{\A#!.*perl\b}{$Config{startperl}}' "$F" chmod +x "$F" @@ -143,52 +121,24 @@ done %build perl Makefile.PL NO_PACKLIST=1 NO_PERLLOCAL=1 -%{make_build} +%make_build %install -%{make_install} INSTALLDIRS=perl - -# Install tests -mkdir -p %{buildroot}/%{_libexecdir}/%{name} -cp -a examples t %{buildroot}/%{_libexecdir}/%{name} -# Remove release tests -rm %{buildroot}/%{_libexecdir}/%{name}/t/999pod.t -rm %{buildroot}/%{_libexecdir}/%{name}/t/999meta-*.t -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 -export TEST_SKIP_VERSION_CHECK=1 -prove -I . -j "$(getconf _NPROCESSORS_ONLN)" -popd -rm -rf "$DIR" -EOF -chmod +x %{buildroot}/%{_libexecdir}/%{name}/test - +%make_install INSTALLDIRS=perl %{_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}') -export TEST_SKIP_VERSION_CHECK=1 -# 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 +TEST_SKIP_VERSION_CHECK=1 \ + make test COMPRESS_ZLIB_RUN_%{?with_long_tests:ALL}%{!?with_long_tests:MOST}=1 %files %{_bindir}/streamzip %{_bindir}/zipdetails -%{perl_privlib}/Compress/ -%{perl_privlib}/File/ + %dir %{perl_privlib}/IO/ %dir %{perl_privlib}/IO/Compress/ -%doc %{perl_privlib}/IO/Compress/FAQ.pod +%{perl_privlib}/Compress/ +%{perl_privlib}/File/ %{perl_privlib}/IO/Compress/Adapter/ %{perl_privlib}/IO/Compress/Base/ %{perl_privlib}/IO/Compress/Base.pm @@ -201,20 +151,22 @@ make test COMPRESS_ZLIB_RUN_%{?with_long_tests:ALL}%{!?with_long_tests:MOST}=1 %{perl_privlib}/IO/Compress/Zip.pm %{perl_privlib}/IO/Compress/Zlib/ %{perl_privlib}/IO/Uncompress/ + %{_mandir}/man1/streamzip.1* %{_mandir}/man1/zipdetails.1* %{_mandir}/man3/Compress::Zlib.3* %{_mandir}/man3/File::GlobMapper.3* %{_mandir}/man3/IO::Compress::*.3* %{_mandir}/man3/IO::Uncompress::*.3* - -%files tests -%{_libexecdir}/%{name} +%doc %{perl_privlib}/IO/Compress/FAQ.pod %files doc -%doc Changes README examples/* +%doc README Changes examples/* %changelog +* Thu Apr 13 2023 Yuanhong Peng - 2.201-3 +- Refactor the specfile and remove tests sub-package + * Tue Feb 07 2023 mgb01105731 - 2.201-2 - add doc