File perl-CBOR-XS.spec of Package perl-CBOR-XS

95
 
1
#
2
# spec file for package perl-CBOR-XS
3
#
4
# Copyright (c) 2024 SUSE LLC
5
#
6
# All modifications and additions to the file contributed by third parties
7
# remain the property of their copyright owners, unless otherwise agreed
8
# upon. The license for this file, and modifications and additions to the
9
# file, is the same license as for the pristine package itself (unless the
10
# license for the pristine package is not an Open Source License, in which
11
# case the license is the MIT License). An "Open Source License" is a
12
# license that conforms to the Open Source Definition (Version 1.9)
13
# published by the Open Source Initiative.
14
15
# Please submit bugfixes or comments via https://bugs.opensuse.org/
16
#
17
18
19
%define cpan_name CBOR-XS
20
Name:           perl-CBOR-XS
21
Version:        1.870.0
22
Release:        0
23
%define cpan_version 1.87
24
#Upstream: CHECK(Artistic-1.0 or GPL-1.0-or-later)
25
License:        GPL-3.0-only
26
Summary:        Concise Binary Object Representation (CBOR, RFC7049)
27
URL:            https://metacpan.org/release/%{cpan_name}
28
Source0:        https://cpan.metacpan.org/authors/id/M/ML/MLEHMANN/%{cpan_name}-%{cpan_version}.tar.gz
29
Source1:        cpanspec.yml
30
BuildRequires:  perl
31
BuildRequires:  perl-macros
32
BuildRequires:  perl(Canary::Stability)
33
BuildRequires:  perl(ExtUtils::MakeMaker) >= 6.64
34
BuildRequires:  perl(Task::Weaken) >= 1.06
35
BuildRequires:  perl(Types::Serialiser)
36
BuildRequires:  perl(common::sense)
37
Requires:       perl(Types::Serialiser)
38
Requires:       perl(common::sense)
39
Provides:       perl(CBOR::XS) = 1.870.0
40
%undefine       __perllib_provides
41
%{perl_requires}
42
43
%description
44
This module converts Perl data structures to the Concise Binary Object
45
Representation (CBOR) and vice versa. CBOR is a fast binary serialisation
46
format that aims to use an (almost) superset of the JSON data model, i.e.
47
when you can represent something useful in JSON, you should be able to
48
represent it in CBOR.
49
50
In short, CBOR is a faster and quite compact binary alternative to JSON,
51
with the added ability of supporting serialisation of Perl objects. (JSON
52
often compresses better than CBOR though, so if you plan to compress the
53
data later and speed is less important you might want to compare both
54
formats first).
55
56
The primary goal of this module is to be _correct_ and the secondary goal
57
is to be _fast_. To reach the latter goal it was written in C.
58
59
To give you a general idea about speed, with texts in the megabyte range,
60
'CBOR::XS' usually encodes roughly twice as fast as Storable or JSON::XS
61
and decodes about 15%-30% faster than those. The shorter the data, the
62
worse Storable performs in comparison.
63
64
Regarding compactness, 'CBOR::XS'-encoded data structures are usually about
65
20% smaller than the same data encoded as (compact) JSON or Storable.
66
67
In addition to the core CBOR data format, this module implements a number
68
of extensions, to support cyclic and shared data structures (see
69
'allow_sharing' and 'allow_cycles'), string deduplication (see
70
'pack_strings') and scalar references (always enabled).
71
72
See MAPPING, below, on how CBOR::XS maps perl values to CBOR values and
73
vice versa.
74
75
%prep
76
%autosetup  -n %{cpan_name}-%{cpan_version}
77
78
%build
79
perl Makefile.PL INSTALLDIRS=vendor OPTIMIZE="%{optflags}"
80
%make_build
81
82
%check
83
make test
84
85
%install
86
%perl_make_install
87
%perl_process_packlist
88
%perl_gen_filelist
89
90
%files -f %{name}.files
91
%doc Changes README
92
%license COPYING
93
94
%changelog
95