| |
@@ -1,20 +1,21 @@
|
| |
Name: perl-Archive-Zip
|
| |
Version: 1.68
|
| |
- Release: 10%{?dist}
|
| |
+ Release: 11%{?dist}
|
| |
Summary: Perl library for accessing Zip archives
|
| |
- # lib/Archive/Zip/Member.pm: (GPL+ or Artistic) and BSD
|
| |
+ # lib/Archive/Zip/Member.pm: (GPL-1.0-or-later OR Artistic-1.0-Perl) and Info-ZIP
|
| |
# (The _mapPermissionsToUnix() comments are
|
| |
- # copied from BSD-licensed unzip)
|
| |
- # other files: GPL+ or Artistic
|
| |
- License: (GPL+ or Artistic) and BSD
|
| |
+ # copied from Info-ZIP licensed unzip)
|
| |
+ # other files: GPL-1.0-or-later OR Artistic-1.0-Perl
|
| |
+ License: ( GPL-1.0-or-later OR Artistic-1.0-Perl ) AND Info-ZIP
|
| |
URL: https://metacpan.org/release/Archive-Zip
|
| |
Source0: https://cpan.metacpan.org/authors/id/P/PH/PHRED/Archive-Zip-%{version}.tar.gz
|
| |
BuildArch: noarch
|
| |
+ BuildRequires: coreutils
|
| |
# For a Git binary patch
|
| |
BuildRequires: git-core
|
| |
BuildRequires: make
|
| |
- BuildRequires: perl-interpreter
|
| |
BuildRequires: perl-generators
|
| |
+ BuildRequires: perl-interpreter
|
| |
BuildRequires: perl(:VERSION) >= 5.4
|
| |
BuildRequires: perl(Config)
|
| |
BuildRequires: perl(ExtUtils::MakeMaker) >= 6.76
|
| |
@@ -53,6 +54,9 @@
|
| |
|
| |
# Remove under-specified dependencies
|
| |
%global __requires_exclude %{?__requires_exclude:%__requires_exclude|}^perl\\(File::Spec\\)$
|
| |
+ # Filter modules bundled for tests
|
| |
+ %global __provides_exclude_from %{?__provides_exclude_from:%__provides_exclude_from|}^%{_libexecdir}
|
| |
+ %global __requires_exclude %{__requires_exclude}|^perl\\(common\\)
|
| |
|
| |
%description
|
| |
The Archive::Zip module allows a Perl program to create, manipulate,
|
| |
@@ -65,6 +69,17 @@
|
| |
or uncompressed as needed. Members can be created from members in
|
| |
existing Zip files, or from existing directories, files, or strings.
|
| |
|
| |
+ %package tests
|
| |
+ Summary: Tests for %{name}
|
| |
+ License: GPL-1.0-or-later OR Artistic-1.0-Perl
|
| |
+ Requires: %{name} = %{?epoch:%{epoch}:}%{version}-%{release}
|
| |
+ Requires: perl-Test-Harness
|
| |
+ Requires: unzip
|
| |
+ Requires: zip
|
| |
+
|
| |
+ %description tests
|
| |
+ Tests from %{name}. Execute them
|
| |
+ with "%{_libexecdir}/%{name}/test".
|
| |
|
| |
%prep
|
| |
%autosetup -S git -n Archive-Zip-%{version}
|
| |
@@ -72,15 +87,38 @@
|
| |
perl -MExtUtils::MakeMaker -e "ExtUtils::MM_Unix->fixin(q{$F})"
|
| |
done
|
| |
|
| |
+ # 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 Makefile.PL INSTALLDIRS=vendor NO_PACKLIST=1 NO_PERLLOCAL=1
|
| |
%{make_build}
|
| |
|
| |
%install
|
| |
%{make_install}
|
| |
- %{_fixperms} $RPM_BUILD_ROOT/*
|
| |
-
|
| |
+ %{_fixperms} %{buildroot}/*
|
| |
+
|
| |
+ # Install tests
|
| |
+ mkdir -p %{buildroot}%{_libexecdir}/%{name}
|
| |
+ cp -a t examples %{buildroot}%{_libexecdir}/%{name}
|
| |
+ cat > %{buildroot}%{_libexecdir}/%{name}/test << 'EOF'
|
| |
+ #!/bin/bash
|
| |
+ set -e
|
| |
+ # Some tests write into temporary files/directories. The solution is to
|
| |
+ # copy the tests into a writable directory and execute them from there.
|
| |
+ DIR=$(mktemp -d)
|
| |
+ pushd "$DIR"
|
| |
+ cp -a %{_libexecdir}/%{name}/* ./
|
| |
+ prove -I . -j "$(getconf _NPROCESSORS_ONLN)"
|
| |
+ popd
|
| |
+ rm -rf "$DIR"
|
| |
+ 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}')
|
| |
make test
|
| |
|
| |
%files
|
| |
@@ -89,8 +127,13 @@
|
| |
%{perl_vendorlib}/Archive/
|
| |
%{_mandir}/man3/Archive*.3*
|
| |
|
| |
+ %files tests
|
| |
+ %{_libexecdir}/%{name}
|
| |
|
| |
%changelog
|
| |
+ * Wed Mar 08 2023 Jitka Plesnikova <jplesnik@redhat.com> - 1.68-11
|
| |
+ - Package tests
|
| |
+
|
| |
* Thu Jan 19 2023 Fedora Release Engineering <releng@fedoraproject.org> - 1.68-10
|
| |
- Rebuilt for https://fedoraproject.org/wiki/Fedora_38_Mass_Rebuild
|
| |
|
| |