commit 938a8efe3629b07d225cfcfedded12b3ac12cac6 Author: MSVSphere Packaging Team Date: Wed Jan 10 02:30:55 2024 +0300 import perl-JSON-Any-1.39-20.el9 diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..74d316e --- /dev/null +++ b/.gitignore @@ -0,0 +1 @@ +SOURCES/JSON-Any-1.39.tar.gz diff --git a/.perl-JSON-Any.metadata b/.perl-JSON-Any.metadata new file mode 100644 index 0000000..b2b52f4 --- /dev/null +++ b/.perl-JSON-Any.metadata @@ -0,0 +1 @@ +2c7e404fc4a398359693d62e9c74994f9273dd4c SOURCES/JSON-Any-1.39.tar.gz diff --git a/SOURCES/JSON-Any-1.39-Disable-allow_nonref-in-JSON-XS-4-and-JSON-PP-3.patch b/SOURCES/JSON-Any-1.39-Disable-allow_nonref-in-JSON-XS-4-and-JSON-PP-3.patch new file mode 100644 index 0000000..4581c15 --- /dev/null +++ b/SOURCES/JSON-Any-1.39-Disable-allow_nonref-in-JSON-XS-4-and-JSON-PP-3.patch @@ -0,0 +1,120 @@ +From 2361260e8d4c84ce6ab43f225322b28a8e4e4391 Mon Sep 17 00:00:00 2001 +From: =?UTF-8?q?Petr=20P=C3=ADsa=C5=99?= +Date: Mon, 4 Feb 2019 16:14:30 +0100 +Subject: [PATCH] Disable allow_nonref in JSON::XS 4 and JSON:PP 3 +MIME-Version: 1.0 +Content-Type: text/plain; charset=UTF-8 +Content-Transfer-Encoding: 8bit + +This patch disables allow_nonref feature in JSON::XS >= 4 and JSON::PP >= 3. +The reason is to provide a uniform behavior including backends that +do not support it. + + + +Signed-off-by: Petr Písař +--- + lib/JSON/Any.pm | 19 ++++++++++++++---- + t/15-allow_nonref.t | 48 +++++++++++++++++++++++++++++++++++++++++++++ + 2 files changed, 63 insertions(+), 4 deletions(-) + create mode 100644 t/15-allow_nonref.t + +diff --git a/lib/JSON/Any.pm b/lib/JSON/Any.pm +index 11a4928..b47ca3a 100644 +--- a/lib/JSON/Any.pm ++++ b/lib/JSON/Any.pm +@@ -207,9 +207,17 @@ BEGIN { + ); + + # JSON::PP has the same API as JSON.pm v2 +- $conf{json_pp} = { %{ $conf{json_2} } }; +- $conf{json_pp}{get_true} = sub { return JSON::PP::true(); }; +- $conf{json_pp}{get_false} = sub { return JSON::PP::false(); }; ++ $conf{json_pp_2} = { %{ $conf{json_2} } }; ++ $conf{json_pp_2}{get_true} = sub { return JSON::PP::true(); }; ++ $conf{json_pp_2}{get_false} = sub { return JSON::PP::false(); }; ++ ++ # JSON::PP 3.99 enables allow_nonref by default. ++ $conf{json_pp_3} = { %{ $conf{json_pp_2} } }; ++ $conf{json_pp_3}{create_object} = sub { ++ $conf{json_pp_2}{create_object}->($_[0], {allow_nonref => 0, %{$_[1]}}); ++ }; ++ ++ $conf{json_pp_4} = { %{ $conf{json_pp_3} } }; + + # Cpanel::JSON::XS is a fork of JSON::XS (currently) + $conf{cpanel_json_xs} = { %{ $conf{json_xs_2} } }; +@@ -224,12 +232,15 @@ BEGIN { + # JSON::XS 4 is almost the same as JSON::XS 3. It only enables + # allow_nonref by default. + $conf{json_xs_4} = { %{ $conf{json_xs_3} } }; ++ $conf{json_xs_4}{create_object} = sub { ++ $conf{json_xs_3}{create_object}->($_[0], {allow_nonref => 0, %{$_[1]}}); ++ }; + } + + sub _make_key { + my $handler = shift; + ( my $key = lc($handler) ) =~ s/::/_/g; +- if ( 'json_xs' eq $key || 'json' eq $key ) { ++ if ( 'json_xs' eq $key || 'json_pp' eq $key || 'json' eq $key ) { + no strict 'refs'; + $key .= "_" . ( split /\./, ${"$handler\::VERSION"} )[0]; + } +diff --git a/t/15-allow_nonref.t b/t/15-allow_nonref.t +new file mode 100644 +index 0000000..7a36df3 +--- /dev/null ++++ b/t/15-allow_nonref.t +@@ -0,0 +1,48 @@ ++use strict; ++use warnings; ++ ++use Test::More; ++use Test::Fatal; ++use JSON::Any; ++ ++my @backends = qw(CPANEL XS PP JSON DWIW); ++ ++plan tests => @backends * 2 * 3; ++ ++test ($_) for @backends; ++ ++sub test { ++ my ($backend) = @_; ++ ++ SKIP: { ++ my $j = eval { ++ JSON::Any->import($backend); ++ JSON::Any->new; ++ }; ++ ++ note("$backend: " . $@), skip("Backend $backend failed to load", 2 * 3) if $@; ++ ++ $j and $j->handler or next; ++ ++ note "handler is " . ( ref( $j->handler ) || $j->handlerType ); ++ ++ for my $json ( 'null', '42', '"hello"' ) { ++ my $data; ++ isnt( ++ exception { $data = $j->jsonToObj($json) }, ++ undef, ++ "decoding '$json' is not supported", ++ ); ++ } ++ ++ for my $object ( undef, 42, 'hello' ) { ++ my $json; ++ my $printable_object = $object // 'undef'; ++ isnt( ++ exception { $json = $j->objToJson($object) }, ++ undef, ++ "encoding '$printable_object' is not supported", ++ ); ++ } ++ }; ++} +-- +2.17.2 + diff --git a/SOURCES/JSON-Any-1.39-Support-JSON-XS-4.patch b/SOURCES/JSON-Any-1.39-Support-JSON-XS-4.patch new file mode 100644 index 0000000..296aac2 --- /dev/null +++ b/SOURCES/JSON-Any-1.39-Support-JSON-XS-4.patch @@ -0,0 +1,36 @@ +From 073c636002cb9c19bba16389e882f1bf4ab23fb2 Mon Sep 17 00:00:00 2001 +From: =?UTF-8?q?Petr=20P=C3=ADsa=C5=99?= +Date: Tue, 4 Dec 2018 12:52:28 +0100 +Subject: [PATCH] Support JSON::XS 4 +MIME-Version: 1.0 +Content-Type: text/plain; charset=UTF-8 +Content-Transfer-Encoding: 8bit + +JSON::XS 4 has the same API as version 3. It only enables allow_nonref +by default. + +CPAN RT#127753 + +Signed-off-by: Petr Písař +--- + lib/JSON/Any.pm | 4 ++++ + 1 file changed, 4 insertions(+) + +diff --git a/lib/JSON/Any.pm b/lib/JSON/Any.pm +index a8a607e..11a4928 100644 +--- a/lib/JSON/Any.pm ++++ b/lib/JSON/Any.pm +@@ -220,6 +220,10 @@ BEGIN { + $conf{json_xs_3} = { %{ $conf{json_xs_2} } }; + $conf{json_xs_3}{get_true} = sub { return Types::Serialiser::true(); }; + $conf{json_xs_3}{get_false} = sub { return Types::Serialiser::false(); }; ++ ++ # JSON::XS 4 is almost the same as JSON::XS 3. It only enables ++ # allow_nonref by default. ++ $conf{json_xs_4} = { %{ $conf{json_xs_3} } }; + } + + sub _make_key { +-- +2.17.2 + diff --git a/SPECS/perl-JSON-Any.spec b/SPECS/perl-JSON-Any.spec new file mode 100644 index 0000000..3a0cb0c --- /dev/null +++ b/SPECS/perl-JSON-Any.spec @@ -0,0 +1,242 @@ +Name: perl-JSON-Any +Summary: A meta-module to make working with JSON easier +Version: 1.39 +Release: 20%{?dist} +License: GPL+ or Artistic + +Source0: https://cpan.metacpan.org/authors/id/E/ET/ETHER/JSON-Any-%{version}.tar.gz +# Adapt to changes in JSON-XS-4.0, CPAN RT#127753 +Patch0: JSON-Any-1.39-Support-JSON-XS-4.patch +# And disable allow_nonref as requested in CPAN RT#127753 +Patch1: JSON-Any-1.39-Disable-allow_nonref-in-JSON-XS-4-and-JSON-PP-3.patch + +URL: https://metacpan.org/release/JSON-Any +Requires: perl(:MODULE_COMPAT_%(eval "`%{__perl} -V:version`"; echo $version)) +BuildArch: noarch + +BuildRequires: make +BuildRequires: perl-generators +BuildRequires: perl(Carp) +BuildRequires: perl(CPAN) +BuildRequires: perl(Cpanel::JSON::XS) +BuildRequires: perl(Data::Dumper) +BuildRequires: perl(ExtUtils::MakeMaker) >= 6.76 +BuildRequires: perl(JSON) +# Not in Fedora +# BuildRequires: perl(JSON::DWIW) +BuildRequires: perl(JSON::MaybeXS) +BuildRequires: perl(JSON::PP) +BuildRequires: perl(JSON::Syck) +BuildRequires: perl(JSON::XS) >= 1.52 +BuildRequires: perl(namespace::clean) +BuildRequires: perl(Storable) +BuildRequires: perl(Test::Fatal) +BuildRequires: perl(Test::More) >= 0.42 +BuildRequires: perl(Test::Requires) +BuildRequires: perl(Test::Warnings) +BuildRequires: perl(Test::Without::Module) + +Requires: perl(Carp) +Requires: perl(JSON::XS) >= 1.52 + +%{?perl_default_filter} +%{?perl_default_subpackage_tests} + +%description +JSON::Any provides a coherent API to bring together the various JSON modules +currently on CPAN. + +%prep +%setup -q -n JSON-Any-%{version} +%patch0 -p1 +%patch1 -p1 + +find . -type f -exec chmod -c -x {} + + +%build +%{__perl} Makefile.PL NO_PACKLIST=1 INSTALLDIRS=vendor --default +make + +%install +make pure_install DESTDIR=%{buildroot} +%{_fixperms} %{buildroot}/* + +%check +make test + +%files +%doc Changes README +%{perl_vendorlib}/JSON* +%{_mandir}/man3/JSON* + +%changelog +* Wed Jan 10 2024 MSVSphere Packaging Team - 1.39-20 +- Rebuilt for MSVSphere 9.3 + +* Thu Jul 22 2021 Fedora Release Engineering - 1.39-20 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_35_Mass_Rebuild + +* Fri May 21 2021 Jitka Plesnikova - 1.39-19 +- Perl 5.34 rebuild + +* Wed Jan 27 2021 Fedora Release Engineering - 1.39-18 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_34_Mass_Rebuild + +* Tue Jul 28 2020 Fedora Release Engineering - 1.39-17 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_33_Mass_Rebuild + +* Tue Jun 23 2020 Jitka Plesnikova - 1.39-16 +- Perl 5.32 rebuild + +* Thu Jan 30 2020 Fedora Release Engineering - 1.39-15 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_32_Mass_Rebuild + +* Fri Jul 26 2019 Fedora Release Engineering - 1.39-14 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_31_Mass_Rebuild + +* Fri May 31 2019 Jitka Plesnikova - 1.39-13 +- Perl 5.30 rebuild + +* Mon Feb 04 2019 Petr Pisar - 1.39-12 +- Adapt to changes in JSON-XS-4.0 (CPAN RT#127753) + +* Fri Feb 01 2019 Fedora Release Engineering - 1.39-11 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_30_Mass_Rebuild + +* Fri Jul 13 2018 Fedora Release Engineering - 1.39-10 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_29_Mass_Rebuild + +* Fri Jun 29 2018 Jitka Plesnikova - 1.39-9 +- Perl 5.28 rebuild + +* Thu Feb 08 2018 Fedora Release Engineering - 1.39-8 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_28_Mass_Rebuild + +* Thu Jul 27 2017 Fedora Release Engineering - 1.39-7 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_27_Mass_Rebuild + +* Mon Jun 05 2017 Jitka Plesnikova - 1.39-6 +- Perl 5.26 rebuild + +* Sat Feb 11 2017 Fedora Release Engineering - 1.39-5 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_26_Mass_Rebuild + +* Mon May 16 2016 Jitka Plesnikova - 1.39-4 +- Perl 5.24 rebuild + +* Thu Feb 04 2016 Fedora Release Engineering - 1.39-3 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_24_Mass_Rebuild + +* Thu Jun 18 2015 Fedora Release Engineering - 1.39-2 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_23_Mass_Rebuild + +* Fri Jun 12 2015 Emmanuel Seyman - 1.39-1 +- Update to 1.39 +- Tighten file listing +- Tidy up spec file + +* Sat Jun 06 2015 Jitka Plesnikova - 1.38-2 +- Perl 5.22 rebuild + +* Sun Oct 05 2014 Emmanuel Seyman - 1.38-1 +- Update to 1.38 + +* Wed Sep 03 2014 Jitka Plesnikova - 1.36-2 +- Perl 5.20 rebuild + +* Sun Aug 31 2014 Emmanuel Seyman - 1.36-1 +- Update to 1.36 + +* Fri Aug 29 2014 Jitka Plesnikova - 1.35-2 +- Perl 5.20 rebuild + +* Sun Aug 17 2014 Emmanuel Seyman - 1.35-1 +- Update to 1.35 +- Drop Group (no longer used) + +* Sat Jun 07 2014 Fedora Release Engineering - 1.34-2 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_21_Mass_Rebuild + +* Sun Jun 01 2014 Emmanuel Seyman - 1.34-1 +- Update to 1.34 + +* Sun Apr 20 2014 Emmanuel Seyman - 1.33-1 +- Update to 1.33 + +* Sun Nov 10 2013 Emmanuel Seyman - 1.32-1 +- Update to 1.32 + +* Sat Aug 03 2013 Petr Pisar - 1.30-2 +- Perl 5.18 rebuild + +* Sun Jun 16 2013 Emmanuel Seyman - 1.30-1 +- Update to 1.30 + +* Thu Feb 14 2013 Fedora Release Engineering - 1.29-4 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_19_Mass_Rebuild + +* Fri Jul 20 2012 Fedora Release Engineering - 1.29-3 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_18_Mass_Rebuild + +* Wed Jun 20 2012 Petr Pisar - 1.29-2 +- Perl 5.16 rebuild +- Specify all dependencies + +* Thu Jan 12 2012 Emmanuel Seyman - 1.29-1 +- Update to 1.29 +- Remove the defattr macro (no longer used) + +* Wed Jul 20 2011 Petr Sabata - 1.25-3 +- Perl mass rebuild + +* Tue Feb 08 2011 Fedora Release Engineering - 1.25-2 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_15_Mass_Rebuild + +* Sun Nov 21 2010 Iain Arnell 1.25-1 +- update to latest upstream version +- clean up spec for modern rpmbuild +- restore JSON and JSON::Syck BRs for tests + +* Sun May 02 2010 Marcela Maslanova - 1.22-2 +- Mass rebuild with perl-5.12.0 + +* Tue Feb 23 2010 Chris Weyl 1.22-1 +- update by Fedora::App::MaintainerTools 0.003 +- PERL_INSTALL_ROOT => DESTDIR +- dropped old BR on perl(JSON) +- dropped old BR on perl(JSON::Syck) + +* Mon Dec 7 2009 Stepan Kasal - 1.21-2 +- rebuild against perl 5.10.1 + +* Tue Aug 11 2009 Chris Weyl 1.21-1 +- auto-update to 1.21 (by cpan-spec-update 0.01) +- altered br on perl(ExtUtils::MakeMaker) (0 => 6.42) +- altered br on perl(Test::More) (0.62 => 0.42) +- added a new br on CPAN (inc::Module::AutoInstall found) +- added a new req on perl(Carp) (version 0) + +* Sun Jul 26 2009 Fedora Release Engineering - 1.19-4 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_12_Mass_Rebuild + +* Thu Feb 26 2009 Fedora Release Engineering - 1.19-3 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_11_Mass_Rebuild + +* Thu Feb 26 2009 Fedora Release Engineering - 1.19-2 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_11_Mass_Rebuild + +* Wed Feb 11 2009 Chris Weyl 1.19-1 +- update to 1.19 + +* Sun Sep 21 2008 Ville Skyttä - 1.16-4 +- Fix Patch:/%%patch0 mismatch. + +* Sat Mar 22 2008 Chris Weyl 1.16-3 +- patch to allow utf8 to work properly with JSON::XS earlier than version 2 +- patch to skip JSON when JSON is earlier than version 2 + +* Wed Mar 12 2008 Chris Weyl 1.16-2 +- bump + +* Sun Mar 09 2008 Chris Weyl 1.16-1 +- Specfile autogenerated by cpanspec 1.74.