File perl-JSON-XS-VersionOneAndTwo.spec of Package perl-JSON-XS-VersionOneAndTwo
#
# spec file for package perl-JSON-XS-VersionOneAndTwo (Version 0.31)
#
# Copyright (c) 2010 SUSE LINUX Products GmbH, Nuernberg, Germany.
# This file and all modifications and additions to the pristine
# package are under the same license as the package itself.
#
# Please submit bugfixes or comments via http://bugs.opensuse.org/
# See also http://wiki.opensuse.org/openSUSE:Packaging_Perl
# norootforbuild
Name: perl-JSON-XS-VersionOneAndTwo
Version: 0.31
Release: 0%{?dist}
License: GPL-1.0+ or Artistic-1.0
Group: Development/Libraries/Perl
Summary: Support versions 1 and 2 of JSON::XS
Source: http://search.cpan.org/CPAN/authors/id/L/LB/LBROCARD/JSON-XS-VersionOneAndTwo-%{version}.tar.gz
Url: http://search.cpan.org/dist/JSON-XS-VersionOneAndTwo
BuildRoot: %{_tmppath}/%{name}-%{version}-build
BuildArch: noarch
%{perl_requires}
BuildRequires: perl-macros
BuildRequires: perl(ExtUtils::MakeMaker)
BuildRequires: perl(Test::Pod)
BuildRequires: perl(Test::Pod::Coverage)
BuildRequires: perl(Test::CheckManifest)
BuildRequires: perl(JSON::XS)
BuildRequires: perl(Test::More)
%description
the JSON::XS manpage is by far the best JSON module on the CPAN.
However, it changed its API at version 2.01. If you have to maintain
code which may be run on systems with either version one or two then
this is a bit of a pain. This module takes the pain away without
sacrificing performance.
%prep
%setup -q -n JSON-XS-VersionOneAndTwo-%{version}
%build
if [ -f Build.PL ]; then
%{__perl} Build.PL --installdirs vendor
else
%{__perl} Makefile.PL INSTALLDIRS=vendor
fi
if [ -f Build.PL ]; then
./Build build flags=%{?_smp_mflags}
else
%{__make} %{?_smp_mflags}
fi
%install
if [ -f Build.PL ]; then
./Build pure_install --destdir %{buildroot}
else
%{__make} pure_install PERL_INSTALL_ROOT=%{buildroot}
fi
# FIXME: use ./Build install destdir=$RPM_BUILD_ROOT create_packlist=0
# maybe then we would not need to remove the .packlist files :-)
find %{buildroot} -type f -name .packlist -exec rm -f {} ';'
find %{buildroot} -depth -type d -exec rmdir {} 2>/dev/null ';'
%{_fixperms} %{buildroot}/*
%perl_process_packlist
%perl_gen_filelist
%check
echo >> MANIFEST.SKIP # ensure trailing newline
echo >> MANIFEST.SKIP ^%{name}\\.files\$
if [ -f Build.PL ]; then
./Build test
else
%{__make} test
fi
%clean
[ "$RPM_BUILD_ROOT" != "/" ] && [ -d $RPM_BUILD_ROOT ] && %{__rm} -rf $RPM_BUILD_ROOT
%files -f %{name}.files
%defattr(-,root,root,-)
%doc README CHANGES
%changelog