diff --git a/IO-Compress-2.103.tar.gz b/IO-Compress-2.103.tar.gz new file mode 100644 index 0000000000000000000000000000000000000000..4813e3c0461b2dc13db8de8408c48634abde350b Binary files /dev/null and b/IO-Compress-2.103.tar.gz differ diff --git a/perl-IO-Compress.spec b/perl-IO-Compress.spec new file mode 100644 index 0000000000000000000000000000000000000000..91f6c3dad47646bdd4a3c7a7d31ce8f674d14c7d --- /dev/null +++ b/perl-IO-Compress.spec @@ -0,0 +1,216 @@ +%define anolis_release 1 + +# Run time expensive tests +%bcond_without long_tests +# Run optional test +%bcond_without perl_IO_Compress_enables_optional_test + +# Dependency version if different to this package version +%global depver 2.103 + +%{?perl_default_filter} + +Name: perl-IO-Compress +Version: 2.103 +Release: %{anolis_release}%{?dist} +Summary: Read and write compressed data +License: GPL+ or Artistic +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) +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(POSIX) +BuildRequires: perl(Scalar::Util) +BuildRequires: perl(strict) +BuildRequires: perl(Symbol) +BuildRequires: perl(utf8) +BuildRequires: perl(warnings) +# Test Suite +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) +BuildRequires: perl(Data::Dumper) +BuildRequires: perl(File::Temp) +BuildRequires: perl(overload) +# Dual-lived module needs building early in the boot process +%if !%{defined perl_bootstrap} +BuildRequires: perl(Test::NoWarnings) +%endif +%endif +# Runtime +Requires: perl(:MODULE_COMPAT_%(eval "`perl -V:version`"; echo $version)) +Requires: perl(File::Glob) + +# This is wrapper for different Compress modules +Obsoletes: perl-Compress-Zlib < %{version} +Provides: perl-Compress-Zlib = %{version}-%{release} +Obsoletes: perl-IO-Compress-Base < %{version} +Provides: perl-IO-Compress-Base = %{version}-%{release} +Obsoletes: perl-IO-Compress-Bzip2 < %{version} +Provides: perl-IO-Compress-Bzip2 = %{version}-%{release} +Obsoletes: perl-IO-Compress-Zlib < %{version} +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. + +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". + +%prep +%setup -q -n IO-Compress-%{version} + +# Remove spurious exec permissions +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 + +%files +%doc Changes README examples/* +%{_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}/IO/Compress/Adapter/ +%{perl_privlib}/IO/Compress/Base/ +%{perl_privlib}/IO/Compress/Base.pm +%{perl_privlib}/IO/Compress/Bzip2.pm +%{perl_privlib}/IO/Compress/Deflate.pm +%{perl_privlib}/IO/Compress/Gzip/ +%{perl_privlib}/IO/Compress/Gzip.pm +%{perl_privlib}/IO/Compress/RawDeflate.pm +%{perl_privlib}/IO/Compress/Zip/ +%{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} + +%changelog +* Thu Apr 21 2022 zhang xianting - 2.103-1 +- Initial build for Anolis V23