diff --git a/JSON-4.10.tar.gz b/JSON-4.10.tar.gz new file mode 100644 index 0000000000000000000000000000000000000000..10f4141e71993c6d737768aac6f685f1aff89455 Binary files /dev/null and b/JSON-4.10.tar.gz differ diff --git a/perl-JSON.spec b/perl-JSON.spec new file mode 100644 index 0000000000000000000000000000000000000000..0252aaa2b2e5115ed6975a0f9d8b7d90a24578f0 --- /dev/null +++ b/perl-JSON.spec @@ -0,0 +1,134 @@ +%define anolis_release 1 +Name: perl-JSON +Summary: Parse and convert to JSON (JavaScript Object Notation) +Version: 4.10 +Release: %{anolis_release}%{?dist} +License: GPL-1.0-or-later OR Artistic-1.0-Perl +URL: https://metacpan.org/release/JSON +Source0: https://cpan.metacpan.org/modules/by-module/JSON/JSON-%{version}.tar.gz +BuildArch: noarch +# Build +BuildRequires: coreutils +BuildRequires: findutils +BuildRequires: make +BuildRequires: perl-generators +BuildRequires: perl-interpreter +BuildRequires: perl(Config) +BuildRequires: perl(ExtUtils::MakeMaker) +BuildRequires: perl(lib) +BuildRequires: perl(:VERSION) >= 5.5.30 +# Module +BuildRequires: perl(B) +BuildRequires: perl(bytes) +BuildRequires: perl(Carp) +BuildRequires: perl(constant) +BuildRequires: perl(Encode) +BuildRequires: perl(Exporter) +BuildRequires: perl(Math::BigFloat) +BuildRequires: perl(Math::BigInt) +BuildRequires: perl(overload) +BuildRequires: perl(Scalar::Util) +BuildRequires: perl(strict) +BuildRequires: perl(warnings) +# subs not used +# Tests +BuildRequires: perl(charnames) +BuildRequires: perl(Data::Dumper) +BuildRequires: perl(Test::More) +BuildRequires: perl(Tie::Array) +BuildRequires: perl(Tie::Hash) +BuildRequires: perl(Tie::IxHash) +BuildRequires: perl(utf8) +BuildRequires: perl(vars) +# Optional tests +BuildRequires: perl(JSON::XS) >= 4.00 +BuildRequires: perl(Types::Serialiser) +# Dependencies +Requires: perl(B) +Requires: perl(Encode) +Requires: perl(Math::BigFloat) +Requires: perl(Math::BigInt) +Suggests: perl(Scalar::Util) +Requires: perl(warnings) + +%{?perl_default_filter} +%global __provides_exclude %{?__provides_exclude:%__provides_exclude|}perl\\(JSON::(Backend::PP|backportPP::Boolean|Boolean|PP|PP::IncrParser)\\) +%global __requires_exclude %{?__requires_exclude:%__requires_exclude|}perl\\(JSON::(backportPP|backportPP::Boolean)\\) + +%description +This module converts between JSON (JavaScript Object Notation) and Perl +data structure into each other. For JSON, see http://www.crockford.com/JSON/. + +%package tests +Summary: Tests for %{name} +Requires: %{name} = %{version}-%{release} +Requires: coreutils +Requires: perl-Test-Harness +Requires: perl(Tie::IxHash) + +%description tests +Tests from %{name}. Execute them +with "%{_libexecdir}/%{name}/test". + +%package doc +Summary: Documentation files for %{name} +Requires: %{name} = %{version}-%{release} +BuildArch: noarch + +%description doc +The %{name}-doc package contains documentation files for %{name}. + +%prep +%setup -q -n JSON-%{version} + +# make rpmlint happy... +find . -type f -exec chmod -c -x {} + +sed -i 's/\r//' README t/* +# Help generators to recognize Perl scripts +for F in t/*.t; do + perl -i -MConfig -ple 'print $Config{startperl} if $. == 1' "$F" + chmod +x "$F" +done + +%build +/usr/bin/perl Makefile.PL INSTALLDIRS=vendor NO_PACKLIST=1 NO_PERLLOCAL=1 +%{make_build} + +%install +%{make_install} +# Install tests +mkdir -p %{buildroot}%{_libexecdir}/%{name} +cp -a t %{buildroot}%{_libexecdir}/%{name} +cat > %{buildroot}%{_libexecdir}/%{name}/test << 'EOF' +#!/bin/bash +# t/20_unknown.t writes to CWD +DIR=$(mktemp -d) +cp -a %{_libexecdir}/%{name}/t "$DIR" +unset PERL_JSON_BACKEND PERL_JSON_DEBUG PERL_JSON_PP_USE_B +pushd "$DIR" +prove -I . -j "$(getconf _NPROCESSORS_ONLN)" +popd +rm -r "$DIR" +EOF +chmod +x %{buildroot}%{_libexecdir}/%{name}/test +# Correct permissions +%{_fixperms} -c %{buildroot} + +%check +unset PERL_JSON_BACKEND PERL_JSON_DEBUG PERL_JSON_PP_USE_B +export HARNESS_OPTIONS=j$(perl -e 'if ($ARGV[0] =~ /.*-j([0-9][0-9]*).*/) {print $1} else {print 1}' -- '%{?_smp_mflags}') +%{make_build} test + +%files +%{perl_vendorlib}/* +%{_mandir}/man3/* + +%files doc +%doc Changes README + +%files tests +%{_libexecdir}/%{name} + +%changelog +* Mon Jan 30 2023 Funda Wang - 4.10-1 +- Import package for anolis 23