2014-02-24 08:35:32 +00:00
|
|
|
#
|
|
|
|
|
# spec file for package perl-JSON-MaybeXS
|
|
|
|
|
#
|
2018-02-07 15:53:19 +00:00
|
|
|
# Copyright (c) 2018 SUSE LINUX GmbH, Nuernberg, Germany.
|
2014-02-24 08:35:32 +00:00
|
|
|
#
|
|
|
|
|
# All modifications and additions to the file contributed by third parties
|
|
|
|
|
# remain the property of their copyright owners, unless otherwise agreed
|
|
|
|
|
# upon. The license for this file, and modifications and additions to the
|
|
|
|
|
# file, is the same license as for the pristine package itself (unless the
|
|
|
|
|
# license for the pristine package is not an Open Source License, in which
|
|
|
|
|
# case the license is the MIT License). An "Open Source License" is a
|
|
|
|
|
# license that conforms to the Open Source Definition (Version 1.9)
|
|
|
|
|
# published by the Open Source Initiative.
|
|
|
|
|
|
|
|
|
|
# Please submit bugfixes or comments via http://bugs.opensuse.org/
|
|
|
|
|
#
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
Name: perl-JSON-MaybeXS
|
2018-04-20 13:44:39 +00:00
|
|
|
Version: 1.004000
|
2014-02-24 08:35:32 +00:00
|
|
|
Release: 0
|
|
|
|
|
%define cpan_name JSON-MaybeXS
|
2015-04-13 19:52:02 +00:00
|
|
|
Summary: Use L<Cpanel::JSON::XS> with a fallback to L<JSON::XS> and L<JSON::PP>
|
2018-04-20 13:44:39 +00:00
|
|
|
License: Artistic-1.0 OR GPL-1.0-or-later
|
2014-02-24 08:35:32 +00:00
|
|
|
Group: Development/Libraries/Perl
|
|
|
|
|
Url: http://search.cpan.org/dist/JSON-MaybeXS/
|
2018-02-07 15:53:19 +00:00
|
|
|
Source0: https://cpan.metacpan.org/authors/id/H/HA/HAARG/%{cpan_name}-%{version}.tar.gz
|
2016-09-16 06:54:17 +00:00
|
|
|
Source1: cpanspec.yml
|
2014-02-24 08:35:32 +00:00
|
|
|
BuildArch: noarch
|
|
|
|
|
BuildRoot: %{_tmppath}/%{name}-%{version}-build
|
|
|
|
|
BuildRequires: perl
|
|
|
|
|
BuildRequires: perl-macros
|
2016-09-16 06:54:17 +00:00
|
|
|
BuildRequires: perl(Cpanel::JSON::XS) >= 2.3310
|
|
|
|
|
BuildRequires: perl(JSON::PP) >= 2.27300
|
2014-02-24 08:35:32 +00:00
|
|
|
BuildRequires: perl(Test::More) >= 0.88
|
2016-09-16 06:54:17 +00:00
|
|
|
Requires: perl(Cpanel::JSON::XS) >= 2.3310
|
|
|
|
|
Requires: perl(JSON::PP) >= 2.27300
|
2016-10-05 13:08:58 +00:00
|
|
|
Recommends: perl(Cpanel::JSON::XS) >= 2.3310
|
2014-02-24 08:35:32 +00:00
|
|
|
%{perl_requires}
|
|
|
|
|
|
|
|
|
|
%description
|
2016-09-16 06:54:17 +00:00
|
|
|
This module first checks to see if either Cpanel::JSON::XS or JSON::XS is
|
|
|
|
|
already loaded, in which case it uses that module. Otherwise it tries to
|
|
|
|
|
load Cpanel::JSON::XS, then JSON::XS, then JSON::PP in order, and either
|
|
|
|
|
uses the first module it finds or throws an error.
|
2014-02-24 08:35:32 +00:00
|
|
|
|
|
|
|
|
It then exports the 'encode_json' and 'decode_json' functions from the
|
|
|
|
|
loaded module, along with a 'JSON' constant that returns the class name for
|
|
|
|
|
calling 'new' on.
|
|
|
|
|
|
2016-09-16 06:54:17 +00:00
|
|
|
If you're writing fresh code rather than replacing JSON.pm usage, you might
|
2014-02-24 08:35:32 +00:00
|
|
|
want to pass options as constructor args rather than calling mutators, so
|
|
|
|
|
we provide our own 'new' method that supports that.
|
|
|
|
|
|
|
|
|
|
%prep
|
|
|
|
|
%setup -q -n %{cpan_name}-%{version}
|
|
|
|
|
|
|
|
|
|
%build
|
|
|
|
|
%{__perl} Makefile.PL INSTALLDIRS=vendor
|
|
|
|
|
%{__make} %{?_smp_mflags}
|
|
|
|
|
|
|
|
|
|
%check
|
|
|
|
|
%{__make} test
|
|
|
|
|
|
|
|
|
|
%install
|
|
|
|
|
%perl_make_install
|
|
|
|
|
%perl_process_packlist
|
|
|
|
|
%perl_gen_filelist
|
|
|
|
|
|
|
|
|
|
%files -f %{name}.files
|
|
|
|
|
%defattr(-,root,root,755)
|
|
|
|
|
%doc Changes README
|
|
|
|
|
|
|
|
|
|
%changelog
|