File perl-JSON-XS.spec of Package perl-JSON-XS

#
# spec file for package perl-JSON-XS
#
# Copyright (c) 2011 SUSE LINUX Products 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/
#

# norootforbuild


Name:           perl-JSON-XS
%define cpan_name JSON-XS
Summary:        JSON serialising/deserialising, done correctly and fast
Version:        2.30
Release:        1
License:        GPL+ or Artistic
Group:          Development/Libraries/Perl
Url:            http://search.cpan.org/dist/JSON-XS/
#Source:         http://www.cpan.org/modules/by-module/JSON/JSON-XS-%{version}.tar.gz
Source:         %{cpan_name}-2.3.tar.bz2
Patch0:         fixversion.diff
BuildRoot:      %{_tmppath}/%{name}-%{version}-build
%{perl_requires}
BuildRequires:  perl
BuildRequires:  perl-macros
BuildRequires:  perl(common::sense)
Requires:       perl(common::sense)

%description
This module converts Perl data structures to JSON and vice versa. Its
primary goal is to be *correct* and its secondary goal is to be *fast*.
To reach the latter goal it was written in C.

Beginning with version 2.0 of the JSON module, when both JSON and
JSON::XS are installed, then JSON will fall back on JSON::XS (this can
be overridden) with no overhead due to emulation (by inheriting
constructor and methods). If JSON::XS is not available, it will fall
back to the compatible JSON::PP module as backend, so using JSON instead
of JSON::XS gives you a portable JSON API that can be fast when you need
and doesn`t require a C compiler when that is a problem.

As this is the n-th-something JSON module on CPAN, what was the reason
to write yet another JSON module? While it seems there are many JSON
modules, none of them correctly handle all corner cases, and in most
cases their maintainers are unresponsive, gone missing, or not listening
to bug reports for other reasons.

Author:
-------
    Marc Lehmann <schmorp@schmorp.de>

%prep
%setup -q -n %{cpan_name}-2.3
%patch0 -p1

%build
%{__perl} Makefile.PL INSTALLDIRS=vendor OPTIMIZE="$RPM_OPT_FLAGS"
%{__make} %{?_smp_mflags}

%check
%{__make} test

%install
%perl_make_install
%perl_process_packlist
%perl_gen_filelist

%clean
%{__rm} -rf $RPM_BUILD_ROOT

%files -f %{name}.files
%defattr(-,root,root,-)
%doc Changes COPYING README

%changelog
openSUSE Build Service is sponsored by