# Test suite needs patching if we have Test::More < 0.88
%global old_test_more %(perl -MTest::More -e 'print (($Test::More::VERSION) < 0.88 ? 1 : 0);' 2>/dev/null || echo 0)
Name: perl-File-Slurp-Tiny
Version: 0.003
Release: 3%{?dist}
Summary: A simple, sane and efficient file slurper
Group: Development/Libraries
License: GPL+ or Artistic
URL: http://search.cpan.org/dist/File-Slurp-Tiny/
Source0: http://search.cpan.org/CPAN/authors/id/L/LE/LEONT/File-Slurp-Tiny-%{version}.tar.gz
Patch0: File-Slurp-Tiny-0.003-old-Test::More.patch
BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}-root-%(id -nu)
BuildArch: noarch
# Build
BuildRequires: perl(ExtUtils::MakeMaker) >= 6.30
# Module
BuildRequires: perl(Carp)
BuildRequires: perl(Exporter) >= 5.57
BuildRequires: perl(File::Spec::Functions)
BuildRequires: perl(FileHandle)
BuildRequires: perl(strict)
BuildRequires: perl(warnings)
# Test Suite
BuildRequires: perl(File::Spec)
BuildRequires: perl(File::Temp)
BuildRequires: perl(IO::Handle)
BuildRequires: perl(IPC::Open3)
BuildRequires: perl(Test::More)
# Release Tests
BuildRequires: perl(Pod::Coverage::TrustPod)
BuildRequires: perl(Test::Pod)
BuildRequires: perl(Test::Pod::Coverage)
# Runtime
Requires: perl(:MODULE_COMPAT_%(eval "`perl -V:version`"; echo $version))
%description
This module provides functions for fast and correct slurping and spewing
of files.
%prep
%setup -q -n File-Slurp-Tiny-%{version}
# Test suite needs patching if we have Test::More < 0.88
%if %{old_test_more}
%patch0
%endif
%build
perl Makefile.PL INSTALLDIRS=vendor
make %{?_smp_mflags}
%install
rm -rf %{buildroot}
make pure_install DESTDIR=%{buildroot}
find %{buildroot} -type f -name .packlist -exec rm -f {} ';'
%{_fixperms} %{buildroot}
# Don't want to ship the benchmark script
rm %{buildroot}%{perl_vendorlib}/File/Slurp/benchmark.pl
%check
make test RELEASE_TESTING=1
%clean
rm -rf %{buildroot}
%files
%doc Changes LICENSE README
%{perl_vendorlib}/File/
%{_mandir}/man3/File::Slurp::Tiny.3pm*
%changelog
* Wed Feb 26 2014 Paul Howarth <paul@city-fan.org> - 0.003-3
- Make %%description explicit about the module operating on files
(#1064995)
* Thu Feb 13 2014 Paul Howarth <paul@city-fan.org> - 0.003-2
- Sanitize for Fedora submission
* Thu Feb 13 2014 Paul Howarth <paul@city-fan.org> - 0.003-1
- Initial RPM version