# # spec file for package perl-Hash-FieldHash # # Copyright (c) 2024 SUSE LLC # # All modifications and additions to the file contributed by third parties # remain the property of their copyright owners, unless otherwise agreed # upon. The license for this file, and modifications and additions to the # file, is the same license as for the pristine package itself (unless the # license for the pristine package is not an Open Source License, in which # case the license is the MIT License). An "Open Source License" is a # license that conforms to the Open Source Definition (Version 1.9) # published by the Open Source Initiative. # Please submit bugfixes or comments via https://bugs.opensuse.org/ # %define cpan_name Hash-FieldHash Name: perl-Hash-FieldHash Version: 0.150.0 Release: 0 # 0.15 -> normalize -> 0.150.0 %define cpan_version 0.15 License: Artistic-1.0 OR GPL-1.0-or-later Summary: Lightweight field hash for inside-out objects URL: https://metacpan.org/release/%{cpan_name} Source0: https://cpan.metacpan.org/authors/id/G/GF/GFUJI/%{cpan_name}-%{cpan_version}.tar.gz Source1: cpanspec.yml Source100: README.md BuildRequires: perl BuildRequires: perl-macros BuildRequires: perl(Devel::PPPort) >= 3.19 BuildRequires: perl(ExtUtils::MakeMaker) >= 6.59 BuildRequires: perl(ExtUtils::ParseXS) >= 2.21 BuildRequires: perl(Module::Build) >= 0.4005 BuildRequires: perl(Test::LeakTrace) >= 0.07 BuildRequires: perl(parent) >= 0.221 Requires: perl(parent) >= 0.221 Provides: perl(Hash::FieldHash) = %{version} %undefine __perllib_provides %{perl_requires} %description 'Hash::FieldHash' provides the field hash mechanism which supports the inside-out technique. You may know 'Hash::Util::FieldHash'. It's a very useful module, but too complex to understand the functionality and only available in 5.10. 'H::U::F::Compat' is available for pre-5.10, but it is too slow to use. This is a better alternative to 'H::U::F' with following features: * Simpler interface 'Hash::FieldHash' provides a few functions: 'fieldhash()' and 'fieldhashes()'. That's enough. * Higher performance 'Hash::FieldHash' is faster than 'Hash::Util::FieldHash', because its internals use simpler structures. * Relic support Although 'Hash::FieldHash' uses a new feature introduced in Perl 5.10, _the uvar magic for hashes_ described in Hash::Util::Fieldhash/"GUTS", it supports Perl 5.8 using the traditional tie-hash layer. %prep %autosetup -n %{cpan_name}-%{cpan_version} %build PERL_USE_UNSAFE_INC=1 perl Build.PL installdirs=vendor optimize="%{optflags}" ./Build build flags=%{?_smp_mflags} %check ./Build test %install ./Build install --destdir=%{buildroot} --create_packlist=0 %perl_gen_filelist %files -f %{name}.files %doc Changes example README.md %license LICENSE %changelog