11Name: perl-File-Slurper
2- Version: 0.012
3- Release: 8 %{?dist }
2+ Version: 0.014
3+ Release: 1 %{?dist }
44Summary: Simple, sane and efficient module to slurp a file
5- License: GPL+ or Artistic
5+ License: GPL-1.0-or-later OR Artistic-1.0 -Perl
66Vendor: Microsoft Corporation
77Distribution: Azure Linux
88URL: https://metacpan.org/release/File-Slurper
9- Source0: https://cpan.metacpan.org/authors/id/L/LE/LEONT/File-Slurper-%{version }.tar.gz# /perl-File-Slurper-%{version}.tar.gz
9+ Source0: https://cpan.metacpan.org/authors/id/L/LE/LEONT/File-Slurper-%{version }.tar.gz
1010BuildArch: noarch
1111# Build
12+ BuildRequires: coreutils
1213BuildRequires: make
1314BuildRequires: perl-generators
1415BuildRequires: perl-interpreter
16+ BuildRequires: perl(Config)
1517BuildRequires: perl(ExtUtils::MakeMaker) >= 6.76
1618BuildRequires: perl(strict)
1719BuildRequires: perl(warnings)
@@ -28,25 +30,51 @@ BuildRequires: perl(File::Temp)
2830BuildRequires: perl(FindBin)
2931BuildRequires: perl(Test::More)
3032BuildRequires: perl(Test::Warnings)
31- Requires: perl(:MODULE_COMPAT_%(eval "$(perl -V:version)"; echo $version))
3233Recommends: perl(PerlIO::utf8_strict)
3334
3435%description
3536This module provides functions for fast and correct slurping and spewing.
3637All functions are optionally exported.
3738
39+ %package tests
40+ Summary: Tests for %{name }
41+ Requires: %{name } = %{?epoch:%{epoch }:}%{version }-%{release }
42+ Requires: perl-Test-Harness
43+
44+ %description tests
45+ Tests from %{name }. Execute them
46+ with "%{_libexecdir }/%{name }/test".
47+
3848%prep
3949%setup -q -n File-Slurper-%{version }
4050
51+ # Help generators to recognize Perl scripts
52+ for F in t/*.t; do
53+ perl -i -MConfig -ple 'print $Config{startperl} if $. == 1 && ! s{\A#!.*perl\b}{$Config{startperl}}' "$F"
54+ chmod +x "$F"
55+ done
56+
4157%build
42- perl Makefile.PL INSTALLDIRS=vendor NO_PACKLIST=1
43- make %{? _smp_mflags }
58+ perl Makefile.PL INSTALLDIRS=vendor NO_PACKLIST=1 NO_PERLLOCAL=1
59+ %{ make_build }
4460
4561%install
46- make pure_install DESTDIR=%{ buildroot }
62+ %{ make_install }
4763%{_fixperms } %{buildroot }/*
4864
65+ # Install tests
66+ mkdir -p %{buildroot }%{_libexecdir }/%{name }
67+ cp -a t %{buildroot }%{_libexecdir }/%{name }
68+ mkdir -p %{buildroot }%{_libexecdir }/%{name }/lib/File
69+ ln -s %{perl_vendorlib }/File/Slurper.pm %{buildroot }%{_libexecdir }/%{name }/lib/File
70+ cat > %{buildroot }%{_libexecdir }/%{name }/test << 'EOF'
71+ #!/bin/sh
72+ cd %{_libexecdir }/%{name } && exec prove -I . -j "$(getconf _NPROCESSORS_ONLN)"
73+ EOF
74+ chmod +x %{buildroot }%{_libexecdir }/%{name }/test
75+
4976%check
77+ export HARNESS_OPTIONS=j$( perl -e ' if ($ARGV[0] =~ /.*-j([0-9][0-9]*).*/) {print $1} else {print 1}' -- ' %{?_smp_mflags}' )
5078make test
5179
5280%files
@@ -55,7 +83,14 @@ make test
5583%{perl_vendorlib} /*
5684%{_mandir }/man3/*
5785
86+ %files tests
87+ %{_libexecdir }/%{name }
88+
5889%changelog
90+ * Mon Feb 27 2025 Sumit Jena <v-sumitjena@microsoft.com> - 0.014-1
91+ - Update to version 0.014
92+ - License verified
93+
5994* Fri Oct 15 2021 Pawel Winogrodzki <pawelwi@microsoft.com> - 0.012-8
6095- Initial CBL-Mariner import from Fedora 32 (license: MIT).
6196
0 commit comments