From 49262945741c5842f7a54de689fccc1fdb71ff12 Mon Sep 17 00:00:00 2001 From: yuanhui Date: Mon, 10 Apr 2023 17:36:51 +0800 Subject: [PATCH] Optimize the spec file Signed-off-by: yuanhui --- perl-Tie-RefHash.spec | 73 +++++++++++++++++++++---------------------- 1 file changed, 35 insertions(+), 38 deletions(-) diff --git a/perl-Tie-RefHash.spec b/perl-Tie-RefHash.spec index 354ca27..654e061 100644 --- a/perl-Tie-RefHash.spec +++ b/perl-Tie-RefHash.spec @@ -1,6 +1,6 @@ -%define anolis_release 3 -# Perform optional tests -%bcond_without perl_Tie_RefHash_enables_optional_test +%define anolis_release 4 + +%bcond_without test Name: perl-Tie-RefHash Version: 1.40 @@ -10,47 +10,38 @@ License: GPL+ or Artistic URL: https://metacpan.org/release/Tie-RefHash Source0: https://cpan.metacpan.org/authors/id/E/ET/ETHER/Tie-RefHash-%{version}.tar.gz BuildArch: noarch -BuildRequires: coreutils -BuildRequires: make -BuildRequires: perl-generators -BuildRequires: perl-interpreter -BuildRequires: perl(:VERSION) >= 5.6 -BuildRequires: perl(Config) -BuildRequires: perl(ExtUtils::MakeMaker) >= 6.76 -BuildRequires: perl(strict) -BuildRequires: perl(warnings) -# Run-time: -BuildRequires: perl(Carp) -# Scalar::Util || overload -BuildRequires: perl(overload) -# Scalar::Util skipped to exhibit overload fallback -BuildRequires: perl(Tie::Hash) +BuildRequires: coreutils make +BuildRequires: perl-generators perl-interpreter +BuildRequires: perl(:VERSION) >= 5.6 perl(Config) perl(strict) +BuildRequires: perl(ExtUtils::MakeMaker) >= 6.76 perl(warnings) +BuildRequires: perl(Carp) perl(overload) perl(Tie::Hash) # Tests: -BuildRequires: perl(File::Spec) -BuildRequires: perl(Storable) -BuildRequires: perl(Test::More) -%if %{with perl_Tie_RefHash_enables_optional_test} -# Optional tests: -BuildRequires: perl(Data::Dumper) -BuildRequires: perl(threads) +BuildRequires: perl(File::Spec) perl(Storable) perl(Test::More) +%if %{with test} +BuildRequires: perl(Data::Dumper) perl(threads) %endif + Requires: perl(overload) + Suggests: perl(Scalar::Util) >= 1.01 Conflicts: perl-interpreter < 4:5.30.1-451 %description -This module provides the ability to use references as hash keys if you first -"tie" the hash variable to this module. Normally, only the keys of the tied -hash itself are preserved as references; to use references as keys in -hashes-of-hashes, use Tie::RefHash::Nestable, included as part of -Tie::RefHash. +Tie::RefHash is a Perl module that allows you to use references as hash keys. +It is implemented using the standard perl TIEHASH interface1. The Nestable version +works by looking for hash references being stored and converting them to tied +hashes so that they too can have references as keys + +%package doc +Summary: Documentation files for %{name} +Requires: %{name} = %{version}-%{release} +BuildArch: noarch + +%description doc +The %{name}-doc package contains documentation files for %{name}. %prep -%setup -q -n Tie-RefHash-%{version} -%if !%{with perl_Tie_RefHash_enables_optional_test} -rm t/refhash.t -perl -i -ne 'print $_ unless m{^t/refhash\.t}' MANIFEST -%endif +%autosetup -p1 -n Tie-RefHash-%{version} %build perl Makefile.PL INSTALLDIRS=vendor NO_PACKLIST=1 NO_PERLLOCAL=1 @@ -58,19 +49,25 @@ perl Makefile.PL INSTALLDIRS=vendor NO_PACKLIST=1 NO_PERLLOCAL=1 %install %{make_install} -%{_fixperms} $RPM_BUILD_ROOT/* +%{_fixperms} %{buildroot}/* %check -unset PERL_CORE +%if %{with test} make test +%endif %files %license LICENCE -%doc Changes CONTRIBUTING README %{perl_vendorlib}/* %{_mandir}/man3/* +%files doc +%doc Changes CONTRIBUTING README + %changelog +* Mon Apr 10 2023 yuanhui - 1.40-4 +- Optimize the spec file + * Fri Feb 03 2023 mgb01105731 - 1.40-3 - remove versioned MODULE_COMPAT_ requires -- Gitee