8
0
Files
perl-JSON-Parse/perl-JSON-Parse.spec

84 lines
2.7 KiB
RPMSpec
Raw Normal View History

#
# spec file for package perl-JSON-Parse
#
# Copyright (c) 2015 SUSE LINUX GmbH, Nuernberg, Germany.
#
# 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-Parse
Version: 0.38
Release: 0
%define cpan_name JSON-Parse
Summary: Read JSON into a Perl variable
License: Artistic-1.0 or GPL-1.0+
Group: Development/Libraries/Perl
Url: http://search.cpan.org/dist/JSON-Parse/
Source0: http://www.cpan.org/authors/id/B/BK/BKB/%{cpan_name}-%{version}.tar.gz
Source1: cpanspec.yml
BuildRoot: %{_tmppath}/%{name}-%{version}-build
BuildRequires: perl
BuildRequires: perl-macros
%{perl_requires}
%description
JSON::Parse offers the function 'parse_json', which takes one
argument, a string containing JSON, and returns a Perl reference or scalar.
The input to 'parse_json' must be a complete JSON structure.
A safer version of the same function the 'parse_json_safe' also
exists.
JSON::Parse also offers two validation functions, the 'valid_json',
which returns true or false, and the 'assert_valid_json', which
produces a descriptive fatal error if the JSON is invalid. These act at a
higher speed than the 'parse_json'. See the /PERFORMANCE manpage for
a comparison.
JSON::Parse also offers one convenience function to read JSON directly from
a file, the 'json_file_to_perl'.
For those who need to deal with special cases, such as JSON objects with
non-unique names, or round-trips with JSON booleans, there is also 'new'
and 'run'.
JSON::Parse accepts only UTF-8 as input. If its input is marked as Unicode
characters, the strings in its output are also marked as Unicode
characters. If its input contains Unicode escapes of the form '"\u3000"',
its output is upgraded to Unicode character strings.
(JSON means "JavaScript Object Notation" and it is specified in the RFC
7159.)
%prep
%setup -q -n %{cpan_name}-%{version}
find . -type f -print0 | xargs -0 chmod 644
%build
%{__perl} Makefile.PL INSTALLDIRS=vendor OPTIMIZE="%{optflags}"
%{__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