# # spec file for package perl-JSON-XS # # Copyright (c) 2017 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.04 Release: 42.9 #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: https://cpan.metacpan.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 it 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 README %license COPYING %changelog * Fri Aug 18 2017 coolo@suse.com - updated to 3.04 see /usr/share/doc/packages/perl-JSON-XS/Changes TODO: move json_xs to types::serialiser 3.04 Thu Aug 17 04:30:47 CEST 2017 - change exponential realloc algorithm on encoding and string decoding to be really exponential (this helps slow/debugging allocators such as libumem) (reported by Matthew Horsfall). - string encoding would needlessly overallocate output space (testcase by Matthew Horsfall). - be very paranoid about extending buffer lengths and croak if buffers get too large, which might (or might not) improve security. - add cbor-packed type to json_xs. - switch from YAML to YAML::XS in json_xs, as YAML is way too buggy and outdated. * Thu Nov 17 2016 coolo@suse.com - updated to 3.03 see /usr/share/doc/packages/perl-JSON-XS/Changes TODO: rfc7464 TODO: Victor Efimov 3.03 Wed Nov 16 20:20:59 CET 2016 - fix a bug introduced by a perl bug workaround that would cause incremental parsing to fail with a sv_chop panic. - json_xs: toformat failure error message fixed. - json_xs: allow cyclic data structures in CBOR. * Fri Mar 11 2016 coolo@suse.com - updated to 3.02 see /usr/share/doc/packages/perl-JSON-XS/Changes TODO: how to cope with tagged values and standard json decoders TODO: investigate magic (Eric Brine) * Mon Nov 25 2013 coolo@suse.com - updated to 3.01 - backport to perls < 5.18 (reported by Paul Howarth). - implemented an object tagging extension (using the Types::Serialiser serialisation protocol). - reworked the documentation regarding object serialisation, add a new OBJECT SERIALISATION section that explains the whole process. - new setting: allow_tags. - switch to Types::Serialiser booleans. - remove to_json/from_json. - other minor improvements to the documentation. * Wed Jun 5 2013 coolo@suse.com - updated to 2.34 - work around bugs in perl 5.18 breaking more than 100 widely used modules, without a fix in sight because p5pers don't care about CPAN anymore. - when canonicalising, only allocate up to 64 hash key pointers on the stack. for larger hashes, use the heap, to avoid using too much stackspace. - discuss the problem with setlocale (reported by a few victims). - internal encode/decode XS wrappers did not expect stack moves caused by callbacks (analyzed and testcase by Jesse Luehrs). - add bencode as to/from option in bin/json_xs. - add -e option to json_xs, and none and string in/out formats. * Fri Nov 18 2011 coolo@suse.com - use original .tar.gz * Sat Aug 13 2011 pascal.bleser@opensuse.org - update to 2.32: * fix a bug in the initial whitespace accumulation - changes from 2.31: * don't accumulate initial whitespace in the incremental buffer (this can be useful to allow whitespace-keepalive on a tcp connection without triggering the max_size limit) * properly croak on some invalid inputs that are not strings (e.g. undef) when trying to decode a json text * Mon Jan 17 2011 coolo@novell.com - update to 2.3(0) - make sure decoder doesn't change the decoding in the incremental parser (testcase provided by Hendrik Schumacher). - applied patch by DaTa for Data::Dumper support in json_xs. - added -t dump support to json_xs, using Data::Dump. - added -f eval support to json_xs. * Wed Dec 1 2010 coolo@novell.com - switch to perl_requires macro * Wed Sep 8 2010 chris@computersalat.de - update to 2.29 - fix a memory leak when callbacks set using filter_json_object or filter_json_single_key_object were called (great testcase by Eric Wilhelm). 2.28 Thu Mar 11 20:30:46 CET 2010 - implement our own atof function - perl's can be orders of magnitudes slower than even the system one. on the positive side, ours seems to be more exact in general than perl's. (testcase provided by Tim Meadowcroft). - clarify floating point conversion issues a bit. - update jpsykes csrf article url. - updated benchmark section - JSON::PP became much faster! - recreated by cpanspec 1.78 - fix deps o missing Req perl(common::sense) - changelog to changes file * Wed Jan 13 2010 jw@novell.com - 2.27 Thu Jan 7 07:35:08 CET 2010 - support relaxed option inside the incremental parser (testcase provided by IKEGAMI via Makamaka). - 2.26 Sat Oct 10 03:26:19 CEST 2009 - big integers could become truncated (based on patch by Strobl Anton). - output format change: indent now adds a final newline, which is more expected and more true to the documentation. - 2.25 Sat Aug 8 12:04:41 CEST 2009 - the perl debugger completely breaks lvalue subs - try to work around the issue. - ignore RMAGICAL hashes w.r.t. CANONICAL. - try to work around a possible char signedness issue on aix. - require common sense. * Sat Jul 25 2009 chris@computersalat.de - spec mods * removed ^---------- * removed ^#--------- * Sat Jun 20 2009 chris@computersalat.de - update to 2.24 - added perl-macros o autogen filelist with perl_gen_filelist - spec mods o added header o fixed deps * Sun Oct 26 2008 gerrit.beine@gmx.de - first release 2.23