Blob Blame History Raw
Name:		perl-Cpanel-JSON-XS
Summary:	JSON::XS for Cpanel, fast and correct serializing
Version:	3.0204
Release:	1%{?dist}
License:	GPL+ or Artistic
URL:		http://search.cpan.org/dist/Cpanel-JSON-XS/
Source0:	http://search.cpan.org/CPAN/authors/id/R/RU/RURBAN/Cpanel-JSON-XS-%{version}.tar.gz
Patch0:		Cpanel-JSON-XS-3.0204-signature.patch
# Module Build
BuildRequires:	coreutils
BuildRequires:	findutils
BuildRequires:	gcc
BuildRequires:	make
BuildRequires:	perl
BuildRequires:	perl-devel
BuildRequires:	perl(Config)
BuildRequires:	perl(ExtUtils::MakeMaker)
# Module Runtime
BuildRequires:	perl(Carp)
BuildRequires:	perl(Exporter)
BuildRequires:	perl(overload)
BuildRequires:	perl(XSLoader)
# Script Runtime
BuildRequires:	perl(Compress::LZF)
BuildRequires:	perl(Convert::Bencode)
BuildRequires:	perl(Data::Dump)
BuildRequires:	perl(YAML)
# Test Suite
BuildRequires:	perl(constant)
BuildRequires:	perl(Data::Dumper)
BuildRequires:	perl(Encode) >= 1.9081
BuildRequires:	perl(strict)
BuildRequires:	perl(Test)
BuildRequires:	perl(Test::More) >= 0.88
BuildRequires:	perl(Tie::Array)
BuildRequires:	perl(Tie::Hash)
BuildRequires:	perl(utf8)
BuildRequires:	perl(warnings)
%if !%{defined perl_bootstrap}
# Cycle: perl-Cpanel-JSON-XS → perl-Test-LeakTrace → perl-Module-Install
# → perl-YAML-Tiny → perl-JSON-MaybeXS → perl-Cpanel-JSON-XS
# Cycle: perl-Cpanel-JSON-XS → perl-Perl-MinimumVersion → perl-PPI
# → perl-List-MoreUtils → perl-Test-LeakTrace → perl-Module-Install
# → perl-YAML-Tiny → perl-JSON-MaybeXS → perl-Cpanel-JSON-XS
# Cycle: perl-Cpanel-JSON-XS → perl-Test-MinimumVerion → perl-YAML-Tiny
# → perl-JSON-MaybeXS → perl-Cpanel-JSON-XS
# Cycle: perl-Cpanel-JSON-XS → perl-Test-Kwalitee → perl-Module-CPANTS-Analyse
# → perl-JSON-MaybeXS → perl-Cpanel-JSON-XS
# Optional Tests
BuildRequires:	perl(common::sense) >= 3.5
BuildRequires:	perl(Hash::Util)
BuildRequires:	perl(JSON)
BuildRequires:	perl(JSON::XS)
%if 0%{?fedora:1}
BuildRequires:	perl(Mojo::JSON) >= 6.11
%endif
BuildRequires:	perl(Test::LeakTrace)
BuildRequires:	perl(Time::Piece)
# Maintainer Tests
BuildRequires:	perl(Class::XSAccessor)
BuildRequires:	perl(List::MoreUtils)
BuildRequires:	perl(Perl::MinimumVersion) >= 1.20
BuildRequires:	perl(Test::CPAN::Meta) >= 0.12
BuildRequires:	perl(Test::Kwalitee)
BuildRequires:	perl(Test::MinimumVersion) >= 0.008
BuildRequires:	perl(Test::Pod) >= 1.00
BuildRequires:	perl(Test::Pod::Coverage) >= 1.04
BuildRequires:	perl(Text::CSV_XS)
%endif
# Runtime
Requires:	perl(:MODULE_COMPAT_%(eval "`perl -V:version`"; echo $version))
Requires:	perl(Carp)
Requires:	perl(Compress::LZF)
Requires:	perl(Convert::Bencode)
Requires:	perl(Data::Dump)
Requires:	perl(YAML)

# Avoid unwanted provides and dependencies
%{?perl_default_filter}

%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.

%prep
%setup -q -n Cpanel-JSON-XS-%{version}

# Fix shellbangs
perl -pi -e 's|^#!/opt/bin/perl|#!/usr/bin/perl|' eg/*

# Skip the signature check as we've tweaked some files
%patch0

%build
perl Makefile.PL INSTALLDIRS=vendor OPTIMIZE="%{optflags}"
make %{?_smp_mflags}

%install
make pure_install DESTDIR=%{buildroot}
find %{buildroot} -type f -name .packlist -exec rm -f {} ';'
find %{buildroot} -type f -name '*.bs' -a -size 0 -exec rm -f {} ';'
%{_fixperms} %{buildroot}

%check
make test %{!?perl_bootstrap:AUTHOR_TESTING=1}

%files
%if 0%{?_licensedir:1}
%license COPYING
%else
%doc COPYING
%endif
%doc Changes README eg/
%{_bindir}/cpanel_json_xs
%{perl_vendorarch}/auto/Cpanel/
%{perl_vendorarch}/Cpanel/
%{_mandir}/man1/cpanel_json_xs.1*
%{_mandir}/man3/Cpanel::JSON::XS.3*
%{_mandir}/man3/Cpanel::JSON::XS::Boolean.3*

%changelog
* Fri Nov 27 2015 Paul Howarth <paul@city-fan.org> - 3.0204-1
- Update to 3.0204
  - Fix is_bool with JSON::XS >3.0 interop (GH#44)
- Avoid running signature tests as we fix shellbangs in example code

* Thu Nov 26 2015 Paul Howarth <paul@city-fan.org> - 3.0203-1
- Update to 3.0203
  - Simplify handling of references, removing all the complicated work-around
    for reblessing; breaks overloaded values, but fixes serialising refs to
    read-only values (GH#21); schmorp thinks that overloading is broken with
    this patch, but reblessing and breaking read-only is worse
  - Stabilize Test::Kwalitee with missing XS dependencies
  - Suggests common::sense, not recommend (GH#36)
  - Boolean interop: use only JSON::PP::Boolean (GH#40)
    - Remove our own JSON::XS::Boolean, and solely use JSON::PP::Boolean and
      accept Mojo::JSON::_Bool (GH#37) and Types::Serialiser::Boolean, which is
      aliased to JSON::PP::Boolean
    - JSON::YAJL::Parser just produces an unbless IV (0|1)
    - Fix overload of our bools
    - Stringify true to "true", false to "0"
    - Accept is_bool as method call also
  - Implement native encode_sv of the internal sv_yes/sv_no values (GH#39) and
    map them to json true/false (YAML::XS compatible)
  - pod: add SECURITY CONSIDERATIONS; added a table of safe and unsafe
    serializers for comparison (only JSON and Data::MessagePack are safe by
    default)
  - New feature: convert_blessed for encode; stringify overloaded perl objects
    and with allow_blessed even without string overload (GH#37)
  - New optional decode_json() argument to set allow_nonref as in RFC 7159 and
    PHP; before 3.02, JSON::XS and Cpanel::JSON::XS always allowed nonref
    values for decode_json due to an internal bug
  - With canonical only skip hash keys sorting for actually tied hashes (GH#42)
- Explicitly BR: perl-devel, needed for EXTERN.h

* Thu Jun 18 2015 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 3.0115-4
- Rebuilt for https://fedoraproject.org/wiki/Fedora_23_Mass_Rebuild

* Wed Jun 10 2015 Jitka Plesnikova <jplesnik@redhat.com> - 3.0115-3
- Perl 5.22 re-rebuild of bootstrapped packages

* Sat Jun 06 2015 Jitka Plesnikova <jplesnik@redhat.com> - 3.0115-2
- Perl 5.22 rebuild

* Mon Feb  2 2015 Paul Howarth <paul@city-fan.org> - 3.0115-1
- Update to 3.0115
  - Fix stack corruption when encoding nested objects with FREEZE method
    (GH#35)

* Tue Jan  6 2015 Paul Howarth <paul@city-fan.org> - 3.0114-1
- Update to 3.0114
  - Fix bad powl() with Freebsd 10 -Duselongdouble; rather use strtold
    (GH#34, CPAN RT#101265)

* Thu Dec 18 2014 Paul Howarth <paul@city-fan.org> - 3.0113-1
- Update to 3.0113
  - Relax the tests for negative NaN in t/117_number.t, as BSDs also cannot
    deal with it (GH#33)

* Mon Dec 15 2014 Paul Howarth <paul@city-fan.org> - 3.0112-1
- Update to 3.0112
  - Change encode of numbers with dual-strings (int and float); integers and
    numbers are now not mishandled anymore by dual-vars' temporary string
    representations
  - Add t/117_numbers.t from JSON::PP (GH#10)
  - Change stringification of false and true to 0 and 1, matching upstream
    JSON and JSON::XS (GH#29); this didn't affect string comparisons, just e.g.
    print decode_json("false")
  - Tolerate literal ASCII TABs in strings in relaxed mode (GH#22) (from
    JSON::XS)
  - Revise pod, merge updates from JSON::XS
  - Fix pod typo (PR#30)
  - Fixed detecting 1.#INF/1.#IND on Windows (GH#28)
  - Also detect now -inf and -nan (GH#28)
  - Fixed STRINGIFY_INFNAN return string, length off by one (GH#28)
  - Fixed a non-C99 declaration error in XS.xs, broken with older MSVC
  - Add {get_,}stringify_infnan methods and use it in the test, now run-time
    (GH#32); mode 0: null, 1: stringify, 2: inf/nan (invalid JSON) as before
  - Fix t/117_number tests for Solaris and MSWin32
  - Improve docs
- Add patch to make NaN encoding tests TODO (GH#33)

* Fri Nov 28 2014 Paul Howarth <paul@city-fan.org> - 3.0107-1
- Update to 3.0107
  - Fix fatal stack corruption with perl callbacks in list context (GH#27)

* Wed Nov 12 2014 Paul Howarth <paul@city-fan.org> - 3.0106-1
- Update to 3.0106
  - More minor doc improvements (GH#26)

* Thu Nov  6 2014 Paul Howarth <paul@city-fan.org> - 3.0105-1
- Update to 3.0105
  - Minor doc improvements (GH#25)
  - Fix d_Gconvert test in t/11_pc_expo.t for 5.6
- Upstream no longer shipping SIGNATURE file
- Use %%license where possible

* Wed Oct 22 2014 Petr Pisar <ppisar@redhat.com> - 3.0104-5
- Break build cycles

* Fri Aug 29 2014 Jitka Plesnikova <jplesnik@redhat.com> - 3.0104-4
- Perl 5.20 rebuild

* Sun Aug 17 2014 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 3.0104-3
- Rebuilt for https://fedoraproject.org/wiki/Fedora_21_22_Mass_Rebuild

* Sat Jun 07 2014 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 3.0104-2
- Rebuilt for https://fedoraproject.org/wiki/Fedora_21_Mass_Rebuild

* Sat Apr 26 2014 Paul Howarth <paul@city-fan.org> - 3.0104-1
- Update to 3.0104
  - Add t/z_leaktrace.t
  - Restore build on C89
  - Fix small cxt->sv_json leak on interp exit

* Tue Apr 22 2014 Paul Howarth <paul@city-fan.org> - 3.0103-1
- Update to 3.0103
  - Change booleans interop logic (again) for JSON-XS-3.01
    - Check now for Types::Serialiser::Boolean i.e. JSON::PP::Boolean refs
      (https://github.com/rurban/Cpanel-JSON-XS/issues/18) to avoid
      allow_blessed for JSON-XS-3.01 booleans
  - Fix boolean representation for JSON-XS-3.01/Types::Serialiser::Boolean
    interop (arrayref, not hashref)
  - Add t/52_object.t from JSON::XS
  - Backport encode_hv HE sort on stack < 64 or heap to avoid stack overflows
    from JSON-XS-3.01; do not use alloca
  - Backport allow_tags, decode_tag, FREEZE/THAW callbacks from JSON-XS-3.01
  - Added pod for OBJECT SERIALISATION (allow_tags, FREEZE/THAW)

* Thu Apr 17 2014 Paul Howarth <paul@city-fan.org> - 3.0102-1
- Update to 3.0102
  - Added PERL_NO_GET_CONTEXT for better performance on threaded Perls
  - MANIFEST: added t/96_interop.t
  - Document deprecated functions
  - Change booleans interop logic for JSON-XS-3.01
- Enable CLZF support via Compress::LZF

* Wed Apr 16 2014 Paul Howarth <paul@city-fan.org> - 3.0101-1
- Update to 3.0101
  - Added ithreads support: Cpanel::JSON::XS is now thread-safe
  - const'ed a translation table for memory savings
  - Fixed booleans for JSON 2.9 and JSON-XS-3.01 interop; JSON does not
    support JSON::XS booleans anymore, so I cannot think of any reason to
    still use JSON::XS

* Thu Apr 10 2014 Paul Howarth <paul@city-fan.org> - 2.3404-2
- Incorporate feedback from package review (#1085975)
  - Simplify %%summary
  - Temporarily drop Compress::LZF format support from cpanel_json_xs client
  - Add optional dependencies for module, tests and cpanel_json_xs client

* Wed Apr  9 2014 Paul Howarth <paul@city-fan.org> - 2.3404-1
- Initial RPM version