Files
perl-Hash-SharedMem/perl-Hash-SharedMem.spec

86 lines
3.2 KiB
RPMSpec
Raw Permalink Normal View History

#
# spec file for package perl-Hash-SharedMem
#
# 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-SharedMem
Name: perl-Hash-SharedMem
Version: 0.5.0
Release: 0
# 0.005 -> normalize -> 0.5.0
%define cpan_version 0.005
License: Artistic-1.0 OR GPL-1.0-or-later
Summary: Efficient shared mutable hash
URL: https://metacpan.org/release/%{cpan_name}
Source0: https://cpan.metacpan.org/authors/id/Z/ZE/ZEFRAM/%{cpan_name}-%{cpan_version}.tar.gz
Source1: cpanspec.yml
2025-08-12 18:14:31 +02:00
Source100: README.md
BuildRequires: perl
BuildRequires: perl-macros
BuildRequires: perl(ExtUtils::CBuilder) >= 0.15
BuildRequires: perl(ExtUtils::ParseXS) >= 3.30
BuildRequires: perl(File::Temp) >= 0.22
BuildRequires: perl(Module::Build)
BuildRequires: perl(Scalar::String)
BuildRequires: perl(parent)
Requires: perl(parent)
Provides: perl(Hash::SharedMem) = %{version}
Provides: perl(Hash::SharedMem::Handle) = %{version}
%undefine __perllib_provides
Recommends: perl(Devel::CallChecker) >= 0.3.0
%{perl_requires}
%description
This module provides a facility for efficiently sharing mutable data
between processes on one host. Data is organised as a key/value store,
resembling a Perl hash. The keys and values are restricted to octet
(Latin-1) strings. Structured objects may be stored by serialising them
using a mechanism such as Sereal.
The data is represented in files that are mapped into each process's memory
space, which for interprocess communication amounts to the processes
sharing memory. Processes are never blocked waiting for each other. The use
of files means that there is some persistence, with the data continuing to
exist when there are no processes with it mapped.
The data structure is optimised for the case where all the data fits into
RAM. This happens either via buffering of a disk-based filesystem, or as
the normal operation of a memory-backed filesystem, in either case as long
as there isn't much swapping activity. If RAM isn't large enough, such that
the data has to reside mainly on disk and parts of it have to be frequently
reread from disk, speed will seriously suffer. The data structure exhibits
poor locality of reference, and is not designed to play nicely with
filesystem block sizes.
%prep
%autosetup -n %{cpan_name}-%{cpan_version}
%build
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 DESIGN README
%changelog