File perl-BSON.spec of Package perl-BSON
#
# spec file for package perl-BSON
#
# Copyright (c) 2020 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/
#
Name: perl-BSON
Version: 1.12.2
Release: 0
%define cpan_name BSON
Summary: BSON serialization and deserialization (EOL)
License: Apache-2.0
Group: Development/Libraries/Perl
URL: https://metacpan.org/release/%{cpan_name}
Source0: https://cpan.metacpan.org/authors/id/M/MO/MONGODB/%{cpan_name}-v%{version}.tar.gz
BuildArch: noarch
BuildRoot: %{_tmppath}/%{name}-%{version}-build
BuildRequires: perl
BuildRequires: perl-macros
BuildRequires: perl(Crypt::URandom)
BuildRequires: perl(JSON::MaybeXS)
BuildRequires: perl(JSON::PP) >= 2.97001
BuildRequires: perl(Moo) >= 2.002004
BuildRequires: perl(Path::Tiny) >= 0.054
BuildRequires: perl(Test::Deep)
BuildRequires: perl(Test::Fatal)
BuildRequires: perl(Test::More) >= 0.96
BuildRequires: perl(Tie::IxHash)
BuildRequires: perl(boolean) >= 0.45
BuildRequires: perl(mro)
BuildRequires: perl(namespace::clean)
BuildRequires: perl(version)
Requires: perl(Crypt::URandom)
Requires: perl(Moo) >= 2.002004
Requires: perl(Tie::IxHash)
Requires: perl(boolean) >= 0.45
Requires: perl(mro)
Requires: perl(namespace::clean)
Requires: perl(version)
%{perl_requires}
%description
This class implements a BSON encoder/decoder ("codec"). It consumes
"documents" (typically hash references) and emits BSON strings and vice
versa in accordance with the at http://bsonspec.org.
BSON is the primary data representation for MongoDB. While this module has
several features that support MongoDB-specific needs and conventions, it
can be used as a standalone serialization format.
The codec may be customized through attributes on the codec option as well
as encode/decode specific options on methods:
my $codec = BSON->new( \%global_attributes );
my $bson = $codec->encode_one( $document, \%encode_options );
my $doc = $codec->decode_one( $bson , \%decode_options );
Because BSON is strongly-typed and Perl is not, this module supports a
number of "type wrappers" – classes that wrap Perl data to indicate how
they should serialize. The BSON::Types module describes these and provides
associated helper functions. See PERL-BSON TYPE MAPPING for more details.
When decoding, type wrappers are used for any data that has no native Perl
representation. Optionally, all data may be wrapped for precise control of
round-trip encoding.
Please read the configuration attributes carefully to understand more about
how to control encoding and decoding.
At compile time, this module will select an implementation backend. It will
prefer 'BSON::XS' (released separately) if available, or will fall back to
BSON::PP (bundled with this module). See ENVIRONMENT for a way to control
the selection of the backend.
%prep
%setup -q -n %{cpan_name}-v%{version}
%build
perl Makefile.PL INSTALLDIRS=vendor
make %{?_smp_mflags}
%check
make test
%install
%perl_make_install
%perl_process_packlist
%perl_gen_filelist
%files -f %{name}.files
%defattr(-,root,root,755)
%doc Changes CONTRIBUTING.mkdn README
%license LICENSE
%changelog