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