1 | # Need to provide five digit version numbers until 3.x,
|
---|
2 | # so that BR: perl(JSON::PP) >= 2.27200 etc. will still work
|
---|
3 | %global our_version 2.97.001
|
---|
4 | %global five_digit_version 2.97001
|
---|
5 |
|
---|
6 | # Need to tweak provides differently if we don't have rpm ⥠4.9
|
---|
7 | %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)
|
---|
8 |
|
---|
9 | Name: perl-JSON-PP
|
---|
10 | Epoch: 1
|
---|
11 | Version: %{our_version}
|
---|
12 | Release: 1%{?dist}
|
---|
13 | Summary: JSON::XS compatible pure-Perl module
|
---|
14 | License: GPL+ or Artistic
|
---|
15 | Vendor: bww bitwise works GmbH
|
---|
16 | URL: http://search.cpan.org/dist/JSON-PP/
|
---|
17 | Source0: http://search.cpan.org/CPAN/authors/id/I/IS/ISHIGAKI/JSON-PP-%{five_digit_version}.tar.gz
|
---|
18 | BuildArch: noarch
|
---|
19 | # Module Build
|
---|
20 | BuildRequires: coreutils
|
---|
21 | BuildRequires: findutils
|
---|
22 | BuildRequires: make
|
---|
23 | BuildRequires: perl-generators
|
---|
24 | BuildRequires: perl%{?fedora:-interpreter}
|
---|
25 | BuildRequires: perl(ExtUtils::MakeMaker)
|
---|
26 | BuildRequires: perl(lib)
|
---|
27 | # Module Runtime
|
---|
28 | BuildRequires: perl(bytes)
|
---|
29 | BuildRequires: perl(Carp)
|
---|
30 | BuildRequires: perl(constant)
|
---|
31 | BuildRequires: perl(Encode)
|
---|
32 | BuildRequires: perl(Exporter)
|
---|
33 | BuildRequires: perl(Math::BigFloat)
|
---|
34 | BuildRequires: perl(Math::BigInt)
|
---|
35 | BuildRequires: perl(overload)
|
---|
36 | BuildRequires: perl(Scalar::Util) >= 1.08
|
---|
37 | BuildRequires: perl(strict)
|
---|
38 | BuildRequires: perl(utf8)
|
---|
39 | BuildRequires: perl(warnings)
|
---|
40 | # Script Runtime
|
---|
41 | BuildRequires: perl(Data::Dumper)
|
---|
42 | BuildRequires: perl(Getopt::Long)
|
---|
43 | # Test Suite
|
---|
44 | BuildRequires: perl(Test::More)
|
---|
45 | BuildRequires: perl(Tie::Array)
|
---|
46 | BuildRequires: perl(Tie::Hash)
|
---|
47 | # Optional tests
|
---|
48 | %if !%{defined perl_bootstrap}
|
---|
49 | # Disable non-core dependencies when bootstraping a core module
|
---|
50 | BuildRequires: perl(Tie::IxHash)
|
---|
51 | %endif
|
---|
52 | # Runtime
|
---|
53 | Requires: perl(:MODULE_COMPAT_%(eval "`perl -V:version`"; echo $version))
|
---|
54 | Requires: perl(Data::Dumper)
|
---|
55 | Requires: perl(Encode)
|
---|
56 | Requires: perl(Math::BigFloat)
|
---|
57 | Requires: perl(Math::BigInt)
|
---|
58 | Requires: perl(Scalar::Util) >= 1.08
|
---|
59 | Requires: perl(utf8)
|
---|
60 | Conflicts: perl-JSON < 2.50
|
---|
61 |
|
---|
62 | # Provide the five-digit version of the module
|
---|
63 | %if "%{our_version}" != "%{five_digit_version}"
|
---|
64 | Provides: perl(JSON::PP) = %{five_digit_version}
|
---|
65 | %global __provides_exclude ^perl\\(JSON::PP\\)
|
---|
66 | %endif
|
---|
67 |
|
---|
68 | %description
|
---|
69 | JSON::XS is the fastest and most proper JSON module on CPAN. It is written by
|
---|
70 | Marc Lehmann in C, so must be compiled and installed in the used environment.
|
---|
71 |
|
---|
72 | JSON::PP is a pure-Perl module and is compatible with JSON::XS.
|
---|
73 |
|
---|
74 | %prep
|
---|
75 | %setup -q -n JSON-PP-%{five_digit_version}
|
---|
76 |
|
---|
77 | # Don't provide less than five-digit version of the module (prior to rpm 4.9)
|
---|
78 | %if ! %{rpm49}
|
---|
79 | %if "%{our_version}" != "%{five_digit_version}"
|
---|
80 | %global perl_prov /bin/sh -c "%{__perl_provides} | sed -e '/^perl(JSON::PP)/d'"
|
---|
81 | %global __perl_provides %{perl_prov}
|
---|
82 | %endif
|
---|
83 | %endif
|
---|
84 |
|
---|
85 | %build
|
---|
86 | perl Makefile.PL INSTALLDIRS=vendor
|
---|
87 | make %{?_smp_mflags}
|
---|
88 | make manifypods
|
---|
89 |
|
---|
90 | %install
|
---|
91 | make pure_install DESTDIR=%{buildroot}
|
---|
92 | find %{buildroot} -type f -name .packlist -delete
|
---|
93 | %{_fixperms} -c %{buildroot}
|
---|
94 |
|
---|
95 | %check
|
---|
96 | #make test
|
---|
97 |
|
---|
98 | %files
|
---|
99 | %doc Changes README
|
---|
100 | %{_bindir}/json_pp
|
---|
101 | %{perl_vendorlib}/JSON/
|
---|
102 | %{_mandir}/man1/*.1*
|
---|
103 | %{_mandir}/man3/*.3*
|
---|
104 | #%{_mandir}/man3/JSON::PP::Boolean.3*
|
---|
105 |
|
---|
106 | %changelog
|
---|
107 | * Sun Mar 11 2018 Elbert Pol <elbert.pol@gmail.com> - 2.97.001-1
|
---|
108 | - initial rpm for OS2
|
---|