File perl-JSON-XS.spec of Package perl-JSON-XS
#
# spec file for package perl-JSON-XS
#
# Copyright (c) 2016 SUSE LINUX GmbH, Nuernberg, Germany.
#
# 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 http://bugs.opensuse.org/
#
Name: perl-JSON-XS
Version: 3.02
Release: 0
#Upstream: CHECK(GPL-1.0+ or Artistic-1.0)
%define cpan_name JSON-XS
Summary: JSON serialising/deserialising, done correctly and fast
License: Artistic-1.0 or GPL-1.0+
Group: Development/Libraries/Perl
Url: http://search.cpan.org/dist/JSON-XS/
Source0: http://www.cpan.org/authors/id/M/ML/MLEHMANN/%{cpan_name}-%{version}.tar.gz
Source1: cpanspec.yml
BuildRoot: %{_tmppath}/%{name}-%{version}-build
BuildRequires: perl
BuildRequires: perl-macros
BuildRequires: perl(Canary::Stability)
BuildRequires: perl(Types::Serialiser)
BuildRequires: perl(common::sense)
Requires: perl(Types::Serialiser)
Requires: perl(common::sense)
%{perl_requires}
%description
This module converts Perl data structures to JSON and vice versa. Its
primary goal is to be _correct_ and its secondary goal is to be _fast_. To
reach the latter goal it was written in C.
Beginning with version 2.0 of the JSON module, when both JSON and JSON::XS
are installed, then JSON will fall back on JSON::XS (this can be
overridden) with no overhead due to emulation (by inheriting constructor
and methods). If JSON::XS is not available, it will fall back to the
compatible JSON::PP module as backend, so using JSON instead of JSON::XS
gives you a portable JSON API that can be fast when you need and doesn't
require a C compiler when that is a problem.
As this is the n-th-something JSON module on CPAN, what was the reason to
write yet another JSON module? While it seems there are many JSON modules,
none of them correctly handle all corner cases, and in most cases their
maintainers are unresponsive, gone missing, or not listening to bug reports
for other reasons.
See MAPPING, below, on how JSON::XS maps perl values to JSON values and
vice versa.
%prep
%setup -q -n %{cpan_name}-%{version}
find . -type f ! -name \*.pl -print0 | xargs -0 chmod 644
%build
%{__perl} Makefile.PL INSTALLDIRS=vendor OPTIMIZE="%{optflags}"
%{__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 COPYING README
%changelog