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