File perl-Data-Buffer.spec of Package perl-Data-Buffer
#
# spec file for package perl-Data-Buffer
#
# 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 Data-Buffer
Name: perl-Data-Buffer
Version: 0.60.0
Release: 0
# 0.06 -> normalize -> 0.60.0
%define cpan_version 0.06
License: Artistic-1.0 OR GPL-1.0-or-later
Summary: Data::Buffer - Read/write buffer class
URL: https://metacpan.org/release/%{cpan_name}
Source0: https://cpan.metacpan.org/authors/id/T/TI/TIMLEGGE/%{cpan_name}-%{cpan_version}.tar.gz
BuildArch: noarch
BuildRequires: perl
BuildRequires: perl-macros
BuildRequires: perl(Test2::V0)
Provides: perl(Data::Buffer) = %{version}
%undefine __perllib_provides
%{perl_requires}
%description
_Data::Buffer_ implements a low-level binary buffer in which you can get
and put integers, strings, and other data. Internally the implementation is
based on 'pack' and 'unpack', such that _Data::Buffer_ is really a layer on
top of those built-in functions.
All of the _get_*_ and _put_*_ methods respect the internal offset state in
the buffer object. This means that you should read data out of the buffer
in the same order that you put it in. For example:
$buf->put_int16(24);
$buf->put_int32(1233455);
$buf->put_int16(99);
$buf->get_int16; # 24
$buf->get_int32; # 1233455
$buf->get_int16; # 99
Of course, this assumes that you _know_ the order of the data items in the
buffer. If your setup is such that your sending and receiving processes
won't necessarily know what's inside the buffers they receive, take a look
at the _TEMPLATE USAGE_ section.
%prep
%autosetup -n %{cpan_name}-%{cpan_version}
%build
perl Makefile.PL INSTALLDIRS=vendor
%make_build
%check
make test
%install
%perl_make_install
%perl_process_packlist
%perl_gen_filelist
%files -f %{name}.files
%doc Changes README
%license LICENSE
%changelog