forked from pool/perl-JSON-Any
Compare commits
12 Commits
b262e3b8b1
...
c3264bba61
Author | SHA256 | Date | |
---|---|---|---|
c3264bba61 | |||
2789f922cc | |||
25f678adb2 | |||
705797521b | |||
a87ce081e2 | |||
f9fe699268 | |||
1c06e86dfd | |||
|
cf1fc27db5 | ||
a1b3bc02b8 | |||
|
baf2a36669 | ||
|
f84c8cb22c | ||
|
70de8369cb |
@@ -1,3 +0,0 @@
|
|||||||
version https://git-lfs.github.com/spec/v1
|
|
||||||
oid sha256:3989c07fd74ece8e98d40370550c12d62885b3e62f0ac023f4dac3cfb0aac1ed
|
|
||||||
size 26783
|
|
3
JSON-Any-1.40.tar.gz
Normal file
3
JSON-Any-1.40.tar.gz
Normal file
@@ -0,0 +1,3 @@
|
|||||||
|
version https://git-lfs.github.com/spec/v1
|
||||||
|
oid sha256:083256255a48094fd9ac1239e0fea8a10a2383a9cd1ef4b1c7264ede1b4400ab
|
||||||
|
size 40670
|
23
cpanspec.yml
Normal file
23
cpanspec.yml
Normal file
@@ -0,0 +1,23 @@
|
|||||||
|
---
|
||||||
|
#description_paragraphs: 3
|
||||||
|
#no_testing: broken upstream
|
||||||
|
#sources:
|
||||||
|
# - source1
|
||||||
|
# - source2
|
||||||
|
#patches:
|
||||||
|
# foo.patch: -p1
|
||||||
|
# bar.patch:
|
||||||
|
#preamble: |-
|
||||||
|
# BuildRequires: gcc-c++
|
||||||
|
#post_prep: |-
|
||||||
|
# hunspell=`pkg-config --libs hunspell | sed -e 's,-l,,; s, *,,g'`
|
||||||
|
# sed -i -e "s,hunspell-X,$hunspell," t/00-prereq.t Makefile.PL
|
||||||
|
#post_install: |-
|
||||||
|
# sed on %{name}.files
|
||||||
|
#license: SUSE-NonFree
|
||||||
|
#skip_noarch: 1
|
||||||
|
#custom_build: |-
|
||||||
|
#./Build build flags=%{?_smp_mflags} --myflag
|
||||||
|
#custom_test: |-
|
||||||
|
#startserver && make test
|
||||||
|
#ignore_requires: Bizarre::Module
|
@@ -1,3 +1,40 @@
|
|||||||
|
-------------------------------------------------------------------
|
||||||
|
Mon Jun 23 20:34:49 UTC 2025 - Tina Müller <tina.mueller@suse.com>
|
||||||
|
|
||||||
|
- Normalize CPAN version
|
||||||
|
See https://github.com/openSUSE/cpanspec/issues/47 for details
|
||||||
|
|
||||||
|
-------------------------------------------------------------------
|
||||||
|
Fri Mar 8 22:34:35 UTC 2024 - Tina Müller <tina.mueller@suse.com>
|
||||||
|
|
||||||
|
- Fix disabling of __perllib_provides
|
||||||
|
|
||||||
|
-------------------------------------------------------------------
|
||||||
|
Sun Sep 10 03:06:47 UTC 2023 - Tina Müller <timueller+perl@suse.de>
|
||||||
|
|
||||||
|
- updated to 1.40
|
||||||
|
see /usr/share/doc/packages/perl-JSON-Any/Changes
|
||||||
|
|
||||||
|
1.40 2023-09-09 21:59:01Z
|
||||||
|
- fix issues on perl 5.39.1 with 'import' subs
|
||||||
|
- added support for JSON v3, v4, JSON::XS v4
|
||||||
|
|
||||||
|
-------------------------------------------------------------------
|
||||||
|
Sun Jun 14 08:15:38 UTC 2015 - coolo@suse.com
|
||||||
|
|
||||||
|
- updated to 1.39
|
||||||
|
see /usr/share/doc/packages/perl-JSON-Any/Changes
|
||||||
|
|
||||||
|
1.39 2015-06-10 04:37:49Z
|
||||||
|
- mark this distribution as deprecated in metadata
|
||||||
|
- drop dependency on namespace::clean
|
||||||
|
|
||||||
|
-------------------------------------------------------------------
|
||||||
|
Mon Apr 13 19:30:04 UTC 2015 - coolo@suse.com
|
||||||
|
|
||||||
|
- updated to 1.38
|
||||||
|
see /usr/share/doc/packages/perl-JSON-Any/Changes
|
||||||
|
|
||||||
-------------------------------------------------------------------
|
-------------------------------------------------------------------
|
||||||
Tue Nov 26 07:34:04 UTC 2013 - coolo@suse.com
|
Tue Nov 26 07:34:04 UTC 2013 - coolo@suse.com
|
||||||
|
|
||||||
|
@@ -1,7 +1,7 @@
|
|||||||
#
|
#
|
||||||
# spec file for package perl-JSON-Any
|
# spec file for package perl-JSON-Any
|
||||||
#
|
#
|
||||||
# Copyright (c) 2013 SUSE LINUX Products GmbH, Nuernberg, Germany.
|
# Copyright (c) 2025 SUSE LLC
|
||||||
#
|
#
|
||||||
# All modifications and additions to the file contributed by third parties
|
# All modifications and additions to the file contributed by third parties
|
||||||
# remain the property of their copyright owners, unless otherwise agreed
|
# remain the property of their copyright owners, unless otherwise agreed
|
||||||
@@ -12,46 +12,124 @@
|
|||||||
# license that conforms to the Open Source Definition (Version 1.9)
|
# license that conforms to the Open Source Definition (Version 1.9)
|
||||||
# published by the Open Source Initiative.
|
# published by the Open Source Initiative.
|
||||||
|
|
||||||
# Please submit bugfixes or comments via http://bugs.opensuse.org/
|
# Please submit bugfixes or comments via https://bugs.opensuse.org/
|
||||||
#
|
#
|
||||||
|
|
||||||
|
|
||||||
Name: perl-JSON-Any
|
|
||||||
Version: 1.32
|
|
||||||
Release: 0
|
|
||||||
%define cpan_name JSON-Any
|
%define cpan_name JSON-Any
|
||||||
Summary: Wrapper Class for the various JSON classes.
|
Name: perl-JSON-Any
|
||||||
License: Artistic-1.0 or GPL-1.0+
|
Version: 1.400.0
|
||||||
Group: Development/Libraries/Perl
|
Release: 0
|
||||||
Url: http://search.cpan.org/dist/JSON-Any/
|
# 1.40 -> normalize -> 1.400.0
|
||||||
Source: http://www.cpan.org/authors/id/P/PE/PERIGRIN/%{cpan_name}-%{version}.tar.gz
|
%define cpan_version 1.40
|
||||||
|
License: Artistic-1.0 OR GPL-1.0-or-later
|
||||||
|
Summary: (DEPRECATED) Wrapper Class for the various JSON classes
|
||||||
|
URL: https://metacpan.org/release/%{cpan_name}
|
||||||
|
Source0: https://cpan.metacpan.org/authors/id/E/ET/ETHER/%{cpan_name}-%{cpan_version}.tar.gz
|
||||||
|
Source1: cpanspec.yml
|
||||||
BuildArch: noarch
|
BuildArch: noarch
|
||||||
BuildRoot: %{_tmppath}/%{name}-%{version}-build
|
|
||||||
BuildRequires: perl
|
BuildRequires: perl
|
||||||
BuildRequires: perl-macros
|
BuildRequires: perl-macros
|
||||||
BuildRequires: perl(Test::Requires)
|
BuildRequires: perl(CPAN::Meta::Requirements) >= 2.121
|
||||||
BuildRequires: perl(Test::Without::Module) >= 0.17
|
BuildRequires: perl(Module::Metadata)
|
||||||
#BuildRequires: perl(Devel::StringInfo)
|
BuildRequires: perl(Test::Fatal)
|
||||||
#BuildRequires: perl(Dist::Zilla::Plugin::MakeMaker::Awesome)
|
BuildRequires: perl(Test::More) >= 0.88
|
||||||
#BuildRequires: perl(JSON)
|
BuildRequires: perl(Test::Needs)
|
||||||
#BuildRequires: perl(JSON::XS)
|
BuildRequires: perl(Test::Warnings) >= 0.9
|
||||||
#BuildRequires: perl(Moose)
|
BuildRequires: perl(Test::Without::Module)
|
||||||
#BuildRequires: perl(namespace::autoclean)
|
Provides: perl(JSON::Any) = %{version}
|
||||||
|
%undefine __perllib_provides
|
||||||
%{perl_requires}
|
%{perl_requires}
|
||||||
|
|
||||||
%description
|
%description
|
||||||
Wrapper Class for the various JSON classes.
|
This module tries to provide a coherent API to bring together the various
|
||||||
|
JSON modules currently on CPAN. This module will allow you to code to any
|
||||||
|
JSON API and have it work regardless of which JSON module is actually
|
||||||
|
installed.
|
||||||
|
|
||||||
|
use JSON::Any;
|
||||||
|
|
||||||
|
my $j = JSON::Any->new;
|
||||||
|
|
||||||
|
$json = $j->objToJson({foo=>'bar', baz=>'quux'});
|
||||||
|
$obj = $j->jsonToObj($json);
|
||||||
|
|
||||||
|
or
|
||||||
|
|
||||||
|
$json = $j->encode({foo=>'bar', baz=>'quux'});
|
||||||
|
$obj = $j->decode($json);
|
||||||
|
|
||||||
|
or
|
||||||
|
|
||||||
|
$json = $j->Dump({foo=>'bar', baz=>'quux'});
|
||||||
|
$obj = $j->Load($json);
|
||||||
|
|
||||||
|
or
|
||||||
|
|
||||||
|
$json = $j->to_json({foo=>'bar', baz=>'quux'});
|
||||||
|
$obj = $j->from_json($json);
|
||||||
|
|
||||||
|
or without creating an object:
|
||||||
|
|
||||||
|
$json = JSON::Any->objToJson({foo=>'bar', baz=>'quux'});
|
||||||
|
$obj = JSON::Any->jsonToObj($json);
|
||||||
|
|
||||||
|
On load, JSON::Any will find a valid JSON module in your @INC by looking
|
||||||
|
for them in this order:
|
||||||
|
|
||||||
|
Cpanel::JSON::XS
|
||||||
|
JSON::XS
|
||||||
|
JSON::PP
|
||||||
|
JSON
|
||||||
|
JSON::DWIW
|
||||||
|
|
||||||
|
And loading the first one it finds.
|
||||||
|
|
||||||
|
You may change the order by specifying it on the 'use JSON::Any' line:
|
||||||
|
|
||||||
|
use JSON::Any qw(DWIW XS CPANEL JSON PP);
|
||||||
|
|
||||||
|
Specifying an order that is missing modules will prevent those module from
|
||||||
|
being used:
|
||||||
|
|
||||||
|
use JSON::Any qw(CPANEL PP); # same as JSON::MaybeXS
|
||||||
|
|
||||||
|
This will check in that order, and will never attempt to load JSON::XS,
|
||||||
|
JSON.pm/JSON, or JSON::DWIW. This can also be set via the
|
||||||
|
'$ENV{JSON_ANY_ORDER}' environment variable.
|
||||||
|
|
||||||
|
JSON::Syck has been deprecated by its author, but in the attempt to still
|
||||||
|
stay relevant as a "Compatibility Layer" JSON::Any still supports it. This
|
||||||
|
support however has been made optional starting with JSON::Any 1.19. In
|
||||||
|
deference to a bug request starting with JSON.pm 1.20, JSON::Syck and other
|
||||||
|
deprecated modules will still be installed, but only as a last resort and
|
||||||
|
will now include a warning.
|
||||||
|
|
||||||
|
use JSON::Any qw(Syck XS JSON);
|
||||||
|
|
||||||
|
or
|
||||||
|
|
||||||
|
$ENV{JSON_ANY_ORDER} = 'Syck XS JSON';
|
||||||
|
|
||||||
|
At install time, JSON::Any will attempt to install JSON::PP as a reasonable
|
||||||
|
fallback if you do not appear have *any* backends installed on your system.
|
||||||
|
|
||||||
|
WARNING: If you call JSON::Any with an empty list
|
||||||
|
|
||||||
|
use JSON::Any ();
|
||||||
|
|
||||||
|
It will skip the JSON package detection routines and will die loudly that
|
||||||
|
it couldn't find a package.
|
||||||
|
|
||||||
%prep
|
%prep
|
||||||
%setup -q -n %{cpan_name}-%{version}
|
%autosetup -n %{cpan_name}-%{cpan_version} -p1
|
||||||
find . -type f -print0 | xargs -0 chmod 644
|
|
||||||
|
|
||||||
%build
|
%build
|
||||||
%{__perl} Makefile.PL INSTALLDIRS=vendor
|
perl Makefile.PL INSTALLDIRS=vendor
|
||||||
%{__make} %{?_smp_mflags}
|
%make_build
|
||||||
|
|
||||||
%check
|
%check
|
||||||
%{__make} test
|
make test
|
||||||
|
|
||||||
%install
|
%install
|
||||||
%perl_make_install
|
%perl_make_install
|
||||||
@@ -59,7 +137,7 @@ find . -type f -print0 | xargs -0 chmod 644
|
|||||||
%perl_gen_filelist
|
%perl_gen_filelist
|
||||||
|
|
||||||
%files -f %{name}.files
|
%files -f %{name}.files
|
||||||
%defattr(-,root,root,755)
|
%doc Changes CONTRIBUTING README
|
||||||
%doc CHANGES LICENSE README weaver.ini xt
|
%license LICENCE
|
||||||
|
|
||||||
%changelog
|
%changelog
|
||||||
|
Reference in New Issue
Block a user