8d3b7b
# Need to stick with five digit version numbers until 3.x, to maintain upgrade path
8d3b7b
%global cpan_version 2.94
8d3b7b
%global five_digit_version %(LC_ALL=C; printf '%.5f' '%{cpan_version}')
8d3b7b
8d3b7b
# Need to tweak provides differently if we don't have rpm ≥ 4.9
8d3b7b
%global rpm49 %(rpm --version | perl -p -e 's/^.* (\\d+)\\.(\\d+).*/sprintf("%d.%03d",$1,$2) ge 4.009 ? 1 : 0/e' 2>/dev/null || echo 0)
8d3b7b
8d3b7b
Name:		perl-JSON-PP
8d3b7b
Version:	%{five_digit_version}
6da77d
Release:	2%{?dist}
8d3b7b
Summary:	JSON::XS compatible pure-Perl module
8d3b7b
License:	GPL+ or Artistic
8d3b7b
URL:		http://search.cpan.org/dist/JSON-PP/
8d3b7b
Source0:	http://search.cpan.org/CPAN/authors/id/I/IS/ISHIGAKI/JSON-PP-%{cpan_version}.tar.gz
8d3b7b
BuildArch:	noarch
8d3b7b
# Module Build
8d3b7b
BuildRequires:	coreutils
8d3b7b
BuildRequires:	findutils
8d3b7b
BuildRequires:	make
8d3b7b
BuildRequires:	perl
8d3b7b
BuildRequires:	perl-generators
8d3b7b
BuildRequires:	perl(ExtUtils::MakeMaker)
8d3b7b
BuildRequires:	perl(lib)
8d3b7b
# Module Runtime
8d3b7b
BuildRequires:	perl(bytes)
8d3b7b
BuildRequires:	perl(Carp)
8d3b7b
BuildRequires:	perl(constant)
8d3b7b
BuildRequires:	perl(Encode)
8d3b7b
BuildRequires:	perl(Exporter)
8d3b7b
BuildRequires:	perl(Math::BigFloat)
8d3b7b
BuildRequires:	perl(Math::BigInt)
8d3b7b
BuildRequires:	perl(overload)
8d3b7b
BuildRequires:	perl(Scalar::Util) >= 1.08
8d3b7b
BuildRequires:	perl(strict)
8d3b7b
BuildRequires:	perl(utf8)
8d3b7b
BuildRequires:	perl(warnings)
8d3b7b
# Script Runtime
8d3b7b
BuildRequires:	perl(Data::Dumper)
8d3b7b
BuildRequires:	perl(Getopt::Long)
8d3b7b
# Test Suite
8d3b7b
BuildRequires:	perl(Test::More)
8d3b7b
BuildRequires:	perl(Tie::Array)
8d3b7b
BuildRequires:	perl(Tie::Hash)
8d3b7b
# Optional tests
8d3b7b
%if !%{defined perl_bootstrap}
8d3b7b
# Disable non-core dependencies when bootstraping a core module
8d3b7b
BuildRequires:	perl(Tie::IxHash)
8d3b7b
%endif
8d3b7b
# Runtime
8d3b7b
Requires:	perl(:MODULE_COMPAT_%(eval "`perl -V:version`"; echo $version))
8d3b7b
Requires:	perl(Data::Dumper)
8d3b7b
Requires:	perl(Encode)
8d3b7b
Requires:	perl(Math::BigFloat)
8d3b7b
Requires:	perl(Math::BigInt)
8d3b7b
Requires:	perl(Scalar::Util) >= 1.08
8d3b7b
Requires:	perl(utf8)
8d3b7b
Conflicts:	perl-JSON < 2.50
8d3b7b
8d3b7b
# Provide the five-digit version of the module
8d3b7b
%if "%{cpan_version}" != "%{five_digit_version}"
8d3b7b
Provides:	perl(JSON::PP) = %{five_digit_version}
8d3b7b
%global __provides_exclude ^perl\\(JSON::PP\\)
8d3b7b
%endif
8d3b7b
8d3b7b
%description
8d3b7b
JSON::XS is the fastest and most proper JSON module on CPAN. It is written by
8d3b7b
Marc Lehmann in C, so must be compiled and installed in the used environment.
8d3b7b
8d3b7b
JSON::PP is a pure-Perl module and is compatible with JSON::XS.
8d3b7b
8d3b7b
%prep
8d3b7b
%setup -q -n JSON-PP-%{cpan_version}
8d3b7b
8d3b7b
# Don't provide less than five-digit version of the module (prior to rpm 4.9)
8d3b7b
%if ! %{rpm49}
8d3b7b
%if "%{cpan_version}" != "%{five_digit_version}"
8d3b7b
%global perl_prov /bin/sh -c "%{__perl_provides} | sed -e '/^perl(JSON::PP)/d'"
8d3b7b
%global __perl_provides %{perl_prov}
8d3b7b
%endif
8d3b7b
%endif
8d3b7b
8d3b7b
%build
8d3b7b
perl Makefile.PL INSTALLDIRS=vendor
8d3b7b
make %{?_smp_mflags}
8d3b7b
8d3b7b
%install
8d3b7b
make pure_install DESTDIR=%{buildroot}
8d3b7b
find %{buildroot} -type f -name .packlist -delete
8d3b7b
%{_fixperms} -c %{buildroot}
8d3b7b
8d3b7b
%check
8d3b7b
make test
8d3b7b
8d3b7b
%files
8d3b7b
%doc Changes README
8d3b7b
%{_bindir}/json_pp
8d3b7b
%{perl_vendorlib}/JSON/
8d3b7b
%{_mandir}/man1/json_pp.1*
8d3b7b
%{_mandir}/man3/JSON::PP.3*
8d3b7b
%{_mandir}/man3/JSON::PP::Boolean.3*
8d3b7b
8d3b7b
%changelog
6da77d
* Fri Mar 29 2019 Jitka Plesnikova <jplesnik@redhat.com> - 2.94000-2
6da77d
- Rebuild with enable hardening (bug #1636329)
6da77d
8d3b7b
* Mon May 29 2017 Paul Howarth <paul@city-fan.org> - 2.94000-1
8d3b7b
- Update to 2.94
8d3b7b
  - Fix a test to support perl 5.6
8d3b7b
8d3b7b
* Wed May 17 2017 Paul Howarth <paul@city-fan.org> - 2.93000-1
8d3b7b
- Update to 2.93
8d3b7b
  - Changed the number detection logic (experimental)
8d3b7b
  - Correct 0 handling (GH#23)
8d3b7b
  - Removed base.pm dependency (GH#5)
8d3b7b
  - Fixed wrong character offset (CPAN RT#116998)
8d3b7b
  - Address VAX issues (CPAN RT#118469)
8d3b7b
  - Various documentation fixes
8d3b7b
  - Remove . in @INC in json_pp (GH#25, CVE-2016-1238)
8d3b7b
  - Removed $VAR1 from json_pp output (GH#11)
8d3b7b
  - Fixed an issue to ignore trailing 0 (GH#29)
8d3b7b
  - Added Scalar::Util dependency for Perl 5.8+ (CPAN RT#84347)
8d3b7b
  - Fixed issues spotted by Nicolas Seriot's JSON Test Suite including
8d3b7b
    experimental UTF-16/32 support and backward incompatible change of
8d3b7b
    C style comment handling (now disabled by default) (GH#28)
8d3b7b
  - Moved the guts of JSON::PP::Boolean into lib/JSON/PP/Boolean.pm and gave
8d3b7b
    it a proper version
8d3b7b
  - Refactored incremental parser to let it handle incomplete JSON text
8d3b7b
    properly
8d3b7b
  - Imported and tweaked tests from JSON.pm
8d3b7b
  - Minor code clean up
8d3b7b
  - Fixed not to fail tests under Perl 5.25.* (CPAN RT#119114)
8d3b7b
  - Reworked documentation, based on the one for JSON::XS
8d3b7b
  - Let json_pp utility show the version of JSON::PP
8d3b7b
  - Fix loading order of B module (GH#31)
8d3b7b
  - Fixed isa tests for bignum
8d3b7b
- This release by ISHIGAKI → update source URL
8d3b7b
- Use five-digit version number for rpm to maintain upgrade path
8d3b7b
- Drop EL-5 support
8d3b7b
  - Drop BuildRoot: and Group: tags
8d3b7b
  - Drop explicit buildroot cleaning in %%install section
8d3b7b
  - Drop explicit %%clean section
8d3b7b
8d3b7b
* Sat Feb 11 2017 Fedora Release Engineering <releng@fedoraproject.org> - 2.27400-5
8d3b7b
- Rebuilt for https://fedoraproject.org/wiki/Fedora_26_Mass_Rebuild
8d3b7b
8d3b7b
* Tue Aug 02 2016 Jitka Plesnikova <jplesnik@redhat.com> - 2.27400-4
8d3b7b
- Avoid loading optional modules from default . (CVE-2016-1238)
8d3b7b
8d3b7b
* Wed May 18 2016 Jitka Plesnikova <jplesnik@redhat.com> - 2.27400-3
8d3b7b
- Perl 5.24 re-rebuild of bootstrapped packages
8d3b7b
8d3b7b
* Sat May 14 2016 Jitka Plesnikova <jplesnik@redhat.com> - 2.27400-2
8d3b7b
- Perl 5.24 rebuild
8d3b7b
8d3b7b
* Mon Apr 25 2016 Paul Howarth <paul@city-fan.org> - 2.27400-1
8d3b7b
- Update to 2.27400
8d3b7b
  - Applied and merged long term neglected patches and pull requests
8d3b7b
  - Modified Makefile.PL to set UNINST=1 if needed on old perls
8d3b7b
  - Decode decimals to Perl's internal NV type
8d3b7b
- Simplify find command using -delete
8d3b7b
8d3b7b
* Thu Feb 04 2016 Fedora Release Engineering <releng@fedoraproject.org> - 2.27300-348
8d3b7b
- Rebuilt for https://fedoraproject.org/wiki/Fedora_24_Mass_Rebuild
8d3b7b
8d3b7b
* Thu Jun 18 2015 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 2.27300-347
8d3b7b
- Rebuilt for https://fedoraproject.org/wiki/Fedora_23_Mass_Rebuild
8d3b7b
8d3b7b
* Wed Jun 10 2015 Jitka Plesnikova <jplesnik@redhat.com> - 2.27300-346
8d3b7b
- Perl 5.22 re-rebuild of bootstrapped packages
8d3b7b
8d3b7b
* Thu Jun 04 2015 Jitka Plesnikova <jplesnik@redhat.com> - 2.27300-345
8d3b7b
- Increase release to favour standalone package
8d3b7b
8d3b7b
* Wed Jun 03 2015 Jitka Plesnikova <jplesnik@redhat.com> - 2.27300-3
8d3b7b
- Perl 5.22 rebuild
8d3b7b
8d3b7b
* Thu Dec 11 2014 Petr Pisar <ppisar@redhat.com> - 2.27300-2
8d3b7b
- Disable non-core dependencies when bootstraping a core module
8d3b7b
8d3b7b
* Wed Oct  8 2014 Paul Howarth <paul@city-fan.org> - 2.27300-1
8d3b7b
- Update to 2.27300
8d3b7b
  - Fixed a problem about substr in perl 5.8.6 and below
8d3b7b
- Classify buildreqs by usage
8d3b7b
8d3b7b
* Wed Sep 03 2014 Jitka Plesnikova <jplesnik@redhat.com> - 2.27203-310
8d3b7b
- Increase release to favour standalone package
8d3b7b
8d3b7b
* Wed Aug 27 2014 Jitka Plesnikova <jplesnik@redhat.com> - 2.27203-3
8d3b7b
- Perl 5.20 rebuild
8d3b7b
8d3b7b
* Sat Jun 07 2014 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 2.27203-2
8d3b7b
- Rebuilt for https://fedoraproject.org/wiki/Fedora_21_Mass_Rebuild
8d3b7b
8d3b7b
* Fri Oct 18 2013 Paul Howarth <paul@city-fan.org> - 2.27203-1
8d3b7b
- Update to 2.27203
8d3b7b
  - Fixed return/or in _incr_parse (CPAN RT#86948)
8d3b7b
- Specify all dependencies
8d3b7b
8d3b7b
* Sat Aug 03 2013 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 2.27202-291
8d3b7b
- Rebuilt for https://fedoraproject.org/wiki/Fedora_20_Mass_Rebuild
8d3b7b
8d3b7b
* Mon Jul 15 2013 Petr Pisar <ppisar@redhat.com> - 2.27202-290
8d3b7b
- Increase release to favour standalone package
8d3b7b
8d3b7b
* Fri Jul 12 2013 Petr Pisar <ppisar@redhat.com> - 2.27202-2
8d3b7b
- Perl 5.18 rebuild
8d3b7b
8d3b7b
* Wed Mar 13 2013 Paul Howarth <paul@city-fan.org> - 2.27202-1
8d3b7b
- Update to 2.27202
8d3b7b
  - Fix test failures due to hash iterator randomization in perl 5.17.6 onwards
8d3b7b
    (CPAN RT#83421)
8d3b7b
8d3b7b
* Thu Feb 14 2013 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 2.27200-243
8d3b7b
- Rebuilt for https://fedoraproject.org/wiki/Fedora_19_Mass_Rebuild
8d3b7b
8d3b7b
* Mon Nov 19 2012 Petr Šabata <contyk@redhat.com> - 2.27200-242
8d3b7b
- Correct the URL
8d3b7b
- Add a few missing buildtime dependencies
8d3b7b
- Drop Getopt::Long dep; json_pp isn't tested
8d3b7b
8d3b7b
* Tue Aug 28 2012 Paul Howarth <paul@city-fan.org> - 2.27200-241
8d3b7b
- BR: perl(base), perl(constant) and perl(lib)
8d3b7b
- Install to vendor directories
8d3b7b
- Drop %%defattr, redundant since rpm 4.4
8d3b7b
- Don't need to remove empty directories from the buildroot
8d3b7b
8d3b7b
* Fri Aug 17 2012 Petr Pisar <ppisar@redhat.com> - 2.27200-240
8d3b7b
- Increase release to replace perl sub-package (bug #848961)
8d3b7b
8d3b7b
* Fri Jul 20 2012 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 2.27200-6
8d3b7b
- Rebuilt for https://fedoraproject.org/wiki/Fedora_18_Mass_Rebuild
8d3b7b
8d3b7b
* Wed Jun 06 2012 Petr Pisar <ppisar@redhat.com> - 2.27200-5
8d3b7b
- Perl 5.16 rebuild
8d3b7b
8d3b7b
* Fri Jun 01 2012 Petr Pisar <ppisar@redhat.com> - 2.27200-4
8d3b7b
- Depend of Data::Dumper
8d3b7b
8d3b7b
* Thu Jan 12 2012 Paul Howarth <paul@city-fan.org> - 2.27200-3
8d3b7b
- Add buildreqs for perl core modules, which might be dual-lived
8d3b7b
8d3b7b
* Sun Jun 19 2011 Marcela Mašláňová <mmaslano@redhat.com> - 2.27200-2
8d3b7b
- Perl mass rebuild
8d3b7b
8d3b7b
* Sun May 22 2011 Paul Howarth <paul@city-fan.org> - 2.27200-1
8d3b7b
- Update to 2.27200
8d3b7b
  - Fixed incr_parse decoding string more correctly (CPAN RT#68032)
8d3b7b
8d3b7b
* Tue Mar  8 2011 Paul Howarth <paul@city-fan.org> - 2.27105-1
8d3b7b
- Update to 2.27105
8d3b7b
  - Removed t/900_pod.t from package because of author test
8d3b7b
- Drop buildreq perl(Test::Pod), no longer needed
8d3b7b
8d3b7b
* Tue Feb  8 2011 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 2.27104-4
8d3b7b
- Rebuilt for https://fedoraproject.org/wiki/Fedora_15_Mass_Rebuild
8d3b7b
8d3b7b
* Thu Jan 27 2011 Paul Howarth <paul@city-fan.org> - 2.27104-3
8d3b7b
- Conflict with perl-JSON < 2.50 (#672764)
8d3b7b
8d3b7b
* Wed Jan 26 2011 Paul Howarth <paul@city-fan.org> - 2.27104-2
8d3b7b
- Sanitize for Fedora submission
8d3b7b
8d3b7b
* Tue Jan 25 2011 Paul Howarth <paul@city-fan.org> - 2.27104-1
8d3b7b
- Initial RPM version