Blame perl-Tie-RefHash.spec

eb6f8b5
# Perform optional tests
eb6f8b5
%bcond_without perl_Tie_RefHash_enables_optional_test
eb6f8b5
eb6f8b5
Name:           perl-Tie-RefHash
eb6f8b5
Version:        1.40
8cec013
Release:        503%{?dist}
eb6f8b5
Summary:        Use references as hash keys
fc41d9b
License:        GPL-1.0-or-later OR Artistic-1.0-Perl
eb6f8b5
URL:            https://metacpan.org/release/Tie-RefHash
eb6f8b5
Source0:        https://cpan.metacpan.org/authors/id/E/ET/ETHER/Tie-RefHash-%{version}.tar.gz
eb6f8b5
BuildArch:      noarch
eb6f8b5
BuildRequires:  coreutils
eb6f8b5
BuildRequires:  make
eb6f8b5
BuildRequires:  perl-generators
eb6f8b5
BuildRequires:  perl-interpreter
eb6f8b5
BuildRequires:  perl(:VERSION) >= 5.6
eb6f8b5
BuildRequires:  perl(Config)
eb6f8b5
BuildRequires:  perl(ExtUtils::MakeMaker) >= 6.76
eb6f8b5
BuildRequires:  perl(strict)
eb6f8b5
BuildRequires:  perl(warnings)
eb6f8b5
# Run-time:
eb6f8b5
BuildRequires:  perl(Carp)
eb6f8b5
# Scalar::Util || overload
eb6f8b5
BuildRequires:  perl(overload)
eb6f8b5
# Scalar::Util skipped to exhibit overload fallback
eb6f8b5
BuildRequires:  perl(Tie::Hash)
eb6f8b5
# Tests:
eb6f8b5
BuildRequires:  perl(File::Spec)
eb6f8b5
BuildRequires:  perl(Storable)
eb6f8b5
BuildRequires:  perl(Test::More)
eb6f8b5
%if %{with perl_Tie_RefHash_enables_optional_test}
eb6f8b5
# Optional tests:
eb6f8b5
BuildRequires:  perl(Data::Dumper)
eb6f8b5
BuildRequires:  perl(threads)
eb6f8b5
%endif
eb6f8b5
Requires:       perl(overload)
eb6f8b5
Suggests:       perl(Scalar::Util) >= 1.01
eb6f8b5
Conflicts:      perl-interpreter < 4:5.30.1-451
eb6f8b5
eb6f8b5
%description
eb6f8b5
This module provides the ability to use references as hash keys if you first
eb6f8b5
"tie" the hash variable to this module. Normally, only the keys of the tied
eb6f8b5
hash itself are preserved as references; to use references as keys in
eb6f8b5
hashes-of-hashes, use Tie::RefHash::Nestable, included as part of
eb6f8b5
Tie::RefHash.
eb6f8b5
8cec013
%package tests
8cec013
Summary:        Tests for %{name}
8cec013
Requires:       %{name} = %{?epoch:%{epoch}:}%{version}-%{release}
8cec013
Requires:       perl-Test-Harness
8cec013
Requires:       perl(threads)
8cec013
8cec013
%description tests
8cec013
Tests from %{name}. Execute them
8cec013
with "%{_libexecdir}/%{name}/test".
8cec013
eb6f8b5
%prep
eb6f8b5
%setup -q -n Tie-RefHash-%{version}
eb6f8b5
%if !%{with perl_Tie_RefHash_enables_optional_test}
eb6f8b5
rm t/refhash.t
eb6f8b5
perl -i -ne 'print $_ unless m{^t/refhash\.t}' MANIFEST
eb6f8b5
%endif
eb6f8b5
8cec013
# Help generators to recognize Perl scripts
8cec013
for F in t/*.t; do
8cec013
    perl -i -MConfig -ple 'print $Config{startperl} if $. == 1 && !s{\A#!.*perl\b}{$Config{startperl}}' "$F"
8cec013
    chmod +x "$F"
8cec013
done
8cec013
eb6f8b5
%build
eb6f8b5
perl Makefile.PL INSTALLDIRS=vendor NO_PACKLIST=1 NO_PERLLOCAL=1
eb6f8b5
%{make_build}
eb6f8b5
eb6f8b5
%install
eb6f8b5
%{make_install}
8cec013
%{_fixperms} %{buildroot}/*
8cec013
# Install tests
8cec013
mkdir -p %{buildroot}%{_libexecdir}/%{name}
8cec013
cp -a t %{buildroot}%{_libexecdir}/%{name}
8cec013
cat > %{buildroot}%{_libexecdir}/%{name}/test << 'EOF'
8cec013
#!/bin/sh
8cec013
cd %{_libexecdir}/%{name} && exec prove -I . -r -j "$(getconf _NPROCESSORS_ONLN)"
8cec013
EOF
8cec013
chmod +x %{buildroot}%{_libexecdir}/%{name}/test
eb6f8b5
eb6f8b5
%check
eb6f8b5
unset PERL_CORE
8cec013
export HARNESS_OPTIONS=j$(perl -e 'if ($ARGV[0] =~ /.*-j([0-9][0-9]*).*/) {print $1} else {print 1}' -- '%{?_smp_mflags}')
eb6f8b5
make test
eb6f8b5
eb6f8b5
%files
eb6f8b5
%license LICENCE
eb6f8b5
%doc Changes CONTRIBUTING README
eb6f8b5
%{perl_vendorlib}/*
eb6f8b5
%{_mandir}/man3/*
eb6f8b5
8cec013
%files tests
8cec013
%{_libexecdir}/%{name}
8cec013
eb6f8b5
%changelog
8cec013
* Thu Feb 01 2024 Jitka Plesnikova <jplesnik@redhat.com> - 1.40-503
8cec013
- Package tests
8cec013
7b02829
* Thu Jan 25 2024 Fedora Release Engineering <releng@fedoraproject.org> - 1.40-502
7b02829
- Rebuilt for https://fedoraproject.org/wiki/Fedora_40_Mass_Rebuild
7b02829
1a32146
* Sun Jan 21 2024 Fedora Release Engineering <releng@fedoraproject.org> - 1.40-501
1a32146
- Rebuilt for https://fedoraproject.org/wiki/Fedora_40_Mass_Rebuild
1a32146
3d21851
* Fri Jul 21 2023 Fedora Release Engineering <releng@fedoraproject.org> - 1.40-500
3d21851
- Rebuilt for https://fedoraproject.org/wiki/Fedora_39_Mass_Rebuild
3d21851
f366ace
* Tue Jul 11 2023 Jitka Plesnikova <jplesnik@redhat.com> - 1.40-499
f366ace
- Increase release to favour standalone package
f366ace
4fca85f
* Fri Jan 20 2023 Fedora Release Engineering <releng@fedoraproject.org> - 1.40-490
4fca85f
- Rebuilt for https://fedoraproject.org/wiki/Fedora_38_Mass_Rebuild
4fca85f
fa95862
* Fri Jul 22 2022 Fedora Release Engineering <releng@fedoraproject.org> - 1.40-489
fa95862
- Rebuilt for https://fedoraproject.org/wiki/Fedora_37_Mass_Rebuild
fa95862
f8cf346
* Mon May 30 2022 Jitka Plesnikova <jplesnik@redhat.com> - 1.40-488
f8cf346
- Increase release to favour standalone package
f8cf346
5399f6a
* Fri Jan 21 2022 Fedora Release Engineering <releng@fedoraproject.org> - 1.40-479
5399f6a
- Rebuilt for https://fedoraproject.org/wiki/Fedora_36_Mass_Rebuild
5399f6a
971dbbf
* Fri Jul 23 2021 Fedora Release Engineering <releng@fedoraproject.org> - 1.40-478
971dbbf
- Rebuilt for https://fedoraproject.org/wiki/Fedora_35_Mass_Rebuild
971dbbf
faf95ba
* Fri May 21 2021 Jitka Plesnikova <jplesnik@redhat.com> - 1.40-477
faf95ba
- Increase release to favour standalone package
faf95ba
b1d8a07
* Wed Jan 27 2021 Fedora Release Engineering <releng@fedoraproject.org> - 1.40-2
b1d8a07
- Rebuilt for https://fedoraproject.org/wiki/Fedora_34_Mass_Rebuild
b1d8a07
eb6f8b5
* Tue Oct 13 2020 Petr Pisar <ppisar@redhat.com> 1.40-1
eb6f8b5
- Specfile autogenerated by cpanspec 1.78.