2011-08-26 22:40:17 +00:00
|
|
|
#
|
|
|
|
# spec file for package perl-JSON-Parse
|
|
|
|
#
|
2017-07-20 18:07:33 +00:00
|
|
|
# Copyright (c) 2017 SUSE LINUX GmbH, Nuernberg, Germany.
|
2011-08-26 22:40:17 +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/
|
|
|
|
#
|
2011-06-11 00:28:16 +00:00
|
|
|
|
2015-04-15 09:44:21 +00:00
|
|
|
|
2011-06-11 00:28:16 +00:00
|
|
|
Name: perl-JSON-Parse
|
2016-11-28 10:14:27 +00:00
|
|
|
Version: 0.49
|
2015-04-15 09:44:21 +00:00
|
|
|
Release: 0
|
2011-08-26 22:40:17 +00:00
|
|
|
%define cpan_name JSON-Parse
|
2015-04-15 09:44:21 +00:00
|
|
|
Summary: Read JSON into a Perl variable
|
|
|
|
License: Artistic-1.0 or GPL-1.0+
|
2011-06-11 00:28:16 +00:00
|
|
|
Group: Development/Libraries/Perl
|
2015-04-15 09:44:21 +00:00
|
|
|
Url: http://search.cpan.org/dist/JSON-Parse/
|
2015-08-02 05:06:24 +00:00
|
|
|
Source0: http://www.cpan.org/authors/id/B/BK/BKB/%{cpan_name}-%{version}.tar.gz
|
|
|
|
Source1: cpanspec.yml
|
2011-08-26 22:40:17 +00:00
|
|
|
BuildRoot: %{_tmppath}/%{name}-%{version}-build
|
|
|
|
BuildRequires: perl
|
2011-06-11 00:28:16 +00:00
|
|
|
BuildRequires: perl-macros
|
2011-08-26 22:40:17 +00:00
|
|
|
%{perl_requires}
|
2011-06-11 00:28:16 +00:00
|
|
|
|
|
|
|
%description
|
2016-11-18 11:50:12 +00:00
|
|
|
A module for parsing JSON. (JSON means "JavaScript Object Notation" and it
|
|
|
|
is specified in RFC 7159.)
|
2015-10-24 16:39:53 +00:00
|
|
|
|
2016-11-18 11:50:12 +00:00
|
|
|
JSON::Parse offers the function parse_json, which takes a string containing
|
|
|
|
JSON, and returns an equivalent Perl structure. It also offers validation
|
|
|
|
of JSON via valid_json, which returns true or false depending on whether
|
|
|
|
the JSON is correct or not, and assert_valid_json, which produces a
|
|
|
|
descriptive fatal error if the JSON is invalid. A function
|
|
|
|
json_file_to_perl reads JSON from a file, and there is a safer version of
|
|
|
|
parse_json called parse_json_safe which doesn't throw exceptions.
|
2015-10-24 16:39:53 +00:00
|
|
|
|
2016-11-18 11:50:12 +00:00
|
|
|
For special cases of parsing, there are also methods new and run, which
|
|
|
|
create a JSON parsing object and run it on text. See METHODS.
|
2015-04-15 09:44:21 +00:00
|
|
|
|
2016-11-18 11:50:12 +00:00
|
|
|
JSON::Parse accepts only UTF-8 as input. See UTF-8 only and Handling of
|
|
|
|
Unicode.
|
2015-11-08 12:07:19 +00:00
|
|
|
|
2011-06-11 00:28:16 +00:00
|
|
|
%prep
|
2015-04-15 09:44:21 +00:00
|
|
|
%setup -q -n %{cpan_name}-%{version}
|
2016-05-25 07:51:20 +00:00
|
|
|
find . -type f ! -name \*.pl -print0 | xargs -0 chmod 644
|
2017-07-20 18:07:33 +00:00
|
|
|
for file in $(find . -type f); do
|
|
|
|
sed -i "s|/home/ben/software/install/bin/perl|%{_bindir}/perl|g; \
|
|
|
|
s|/home/ben/projects/Json3/blib/lib|%{perl_vendorarch}|g; \
|
|
|
|
s|use lib '/home/ben/projects/Json3/blib/arch';||g;" "$file"
|
|
|
|
done
|
2011-06-11 00:28:16 +00:00
|
|
|
|
|
|
|
%build
|
2015-04-15 09:44:21 +00:00
|
|
|
%{__perl} Makefile.PL INSTALLDIRS=vendor OPTIMIZE="%{optflags}"
|
2011-08-26 22:40:17 +00:00
|
|
|
%{__make} %{?_smp_mflags}
|
|
|
|
|
|
|
|
%check
|
|
|
|
%{__make} test
|
2011-06-11 00:28:16 +00:00
|
|
|
|
|
|
|
%install
|
|
|
|
%perl_make_install
|
|
|
|
%perl_process_packlist
|
2011-08-26 22:40:17 +00:00
|
|
|
%perl_gen_filelist
|
2011-06-11 00:28:16 +00:00
|
|
|
|
2011-08-26 22:40:17 +00:00
|
|
|
%files -f %{name}.files
|
|
|
|
%defattr(-,root,root,755)
|
2016-11-18 11:50:12 +00:00
|
|
|
%doc Changes examples README
|
2011-06-11 00:28:16 +00:00
|
|
|
|
2011-08-26 22:40:17 +00:00
|
|
|
%changelog
|