d407a78
# We need to patch the test suite if we have an old version of Test::More
81c92d2
%global old_test_more %(perl -MTest::More -e 'print (($Test::More::VERSION < 0.96) ? 1 : 0);' 2>/dev/null || echo 0)
d407a78
d407a78
# Test::CPAN::Changes isn't available in EPEL < 7, due to requirement of perl(version) ≥ 0.79
d407a78
%global cpan_changes_available %(expr 0%{?fedora} + 0%{?rhel} '>' 6)
d407a78
d407a78
#TODO: BR: Test::Pod::No404s when available
d407a78
#TODO: BR: Test::Pod::LinkCheck when available
d407a78
d407a78
Name:		perl-Module-Implementation
81c92d2
Version:	0.07
cce2805
Release:	4%{?dist}
d407a78
Summary:	Loads one of several alternate underlying implementations for a module
d407a78
Group:		Development/Libraries
d407a78
License:	Artistic 2.0
d407a78
URL:		http://search.cpan.org/dist/perl-Module-Implementation/
d407a78
Source0:	http://search.cpan.org/CPAN/authors/id/D/DR/DROLSKY/Module-Implementation-%{version}.tar.gz
81c92d2
Patch1:		Module-Implementation-0.07-old-Test::More.patch
d407a78
BuildRoot:	%{_tmppath}/%{name}-%{version}-%{release}-root-%(id -nu)
d407a78
BuildArch:	noarch
d407a78
# ===================================================================
d407a78
# Build requirements
d407a78
# ===================================================================
81c92d2
BuildRequires:	perl(ExtUtils::MakeMaker) >= 6.30
d407a78
# ===================================================================
d407a78
# Module requirements
d407a78
# ===================================================================
d407a78
BuildRequires:	perl(Carp)
3e734a0
BuildRequires:	perl(Module::Runtime) >= 0.012
d407a78
BuildRequires:	perl(Try::Tiny)
d407a78
BuildRequires:	perl(strict)
d407a78
BuildRequires:	perl(warnings)
d407a78
# ===================================================================
d407a78
# Test suite requirements
d407a78
# ===================================================================
81c92d2
BuildRequires:	perl(File::Find)
81c92d2
BuildRequires:	perl(File::Temp)
d407a78
BuildRequires:	perl(lib)
81c92d2
BuildRequires:	perl(Test::Fatal) >= 0.006
d407a78
BuildRequires:	perl(Test::More)
be51602
BuildRequires:	perl(Test::Requires)
d407a78
BuildRequires:	perl(Test::Taint)
d407a78
# ===================================================================
d407a78
# Author/Release test requirements
d407a78
# ===================================================================
d407a78
%if %{cpan_changes_available}
81c92d2
BuildRequires:	perl(Test::CPAN::Changes) >= 0.19
d407a78
%endif
81c92d2
BuildRequires:	perl(Pod::Coverage::TrustPod)
d407a78
BuildRequires:	perl(Test::EOL)
d407a78
BuildRequires:	perl(Test::NoTabs)
d407a78
BuildRequires:	perl(Test::Pod)
81c92d2
BuildRequires:	perl(Test::Pod::Coverage)
81c92d2
# Can't use aspell-en from EPEL as BR: for RHEL-7+ package, and older EL
81c92d2
# releases don't have recent enough Test::Spelling so skip author tests
81c92d2
# there
81c92d2
%if ! 0%{?rhel}
c0228b7
BuildRequires:	aspell-en
81c92d2
BuildRequires:	perl(Pod::Wordlist::hanekomu)
81c92d2
BuildRequires:	perl(Test::Spelling) >= 0.12
c8e1258
%endif
d407a78
# ===================================================================
d407a78
# Runtime requirements
d407a78
# ===================================================================
d407a78
Requires:	perl(:MODULE_COMPAT_%(eval "`perl -V:version`"; echo $version))
d407a78
Requires:	perl(Carp)
d407a78
d407a78
%description
d407a78
This module abstracts out the process of choosing one of several underlying
d407a78
implementations for a module. This can be used to provide XS and pure Perl
d407a78
implementations of a module, or it could be used to load an implementation
d407a78
for a given OS or any other case of needing to provide multiple
d407a78
implementations.
d407a78
d407a78
This module is only useful when you know all the implementations ahead of
d407a78
time. If you want to load arbitrary implementations then you probably want
d407a78
something like a plugin system, not this module.
d407a78
d407a78
%prep
d407a78
%setup -q -n Module-Implementation-%{version}
d407a78
d407a78
# We have to patch the test suite if we have an old Test::More
d407a78
%if %{old_test_more}
d407a78
%patch1 -p1
d407a78
%endif
d407a78
d407a78
%build
d407a78
perl Makefile.PL INSTALLDIRS=vendor
d407a78
make %{?_smp_mflags}
d407a78
d407a78
%install
d407a78
rm -rf %{buildroot}
d407a78
make pure_install DESTDIR=%{buildroot}
d407a78
find %{buildroot} -type f -name .packlist -exec rm -f {} \;
d407a78
%{_fixperms} %{buildroot}
d407a78
d407a78
%check
81c92d2
# Don't run the author tests for EL builds (see above)
81c92d2
%if ! 0%{?rhel}
81c92d2
make test AUTHOR_TESTING=1 RELEASE_TESTING=1
81c92d2
%else
d407a78
make test RELEASE_TESTING=1
81c92d2
%endif
d407a78
d407a78
%clean
d407a78
rm -rf %{buildroot}
d407a78
d407a78
%files
d407a78
%doc Changes LICENSE README
d407a78
%{perl_vendorlib}/Module/
d407a78
%{_mandir}/man3/Module::Implementation.3pm*
d407a78
d407a78
%changelog
cce2805
* Sat Jun 07 2014 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 0.07-4
cce2805
- Rebuilt for https://fedoraproject.org/wiki/Fedora_21_Mass_Rebuild
cce2805
7361b46
* Sat Aug 03 2013 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 0.07-3
7361b46
- Rebuilt for https://fedoraproject.org/wiki/Fedora_20_Mass_Rebuild
7361b46
c0b65b5
* Wed Jul 24 2013 Petr Pisar <ppisar@redhat.com> - 0.07-2
c0b65b5
- Perl 5.18 rebuild
c0b65b5
81c92d2
* Mon Jul 15 2013 Paul Howarth <paul@city-fan.org> - 0.07-1
81c92d2
- Update to 0.07
81c92d2
  - Require Test::Fatal ≥ 0.006 to avoid test failures (CPAN RT#76809)
81c92d2
- Explicitly run author tests, except for EL builds
81c92d2
- Add buildreqs for new tests
81c92d2
- Apply old Test::More patch if we have Test::More < 0.96
81c92d2
6b40ecc
* Thu Feb 14 2013 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 0.06-6
6b40ecc
- Rebuilt for https://fedoraproject.org/wiki/Fedora_19_Mass_Rebuild
6b40ecc
c8dcafa
* Fri Jul 20 2012 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 0.06-5
c8dcafa
- Rebuilt for https://fedoraproject.org/wiki/Fedora_18_Mass_Rebuild
c8dcafa
ad625b9
* Wed Jun 13 2012 Petr Pisar <ppisar@redhat.com> - 0.06-4
ad625b9
- Perl 5.16 rebuild
ad625b9
c0228b7
* Thu Jun  7 2012 Paul Howarth <paul@city-fan.org> - 0.06-3
c0228b7
- Drop %%defattr, redundant since rpm 4.4
c0228b7
- Don't need to remove empty directories from buildroot
c0228b7
- Add commentary regarding conditionalized buildreqs
c0228b7
c8e1258
* Thu Jun  7 2012 Marcela Mašláňová <mmaslano@redhat.com> - 0.06-2
c0228b7
- Conditionalize aspell-en dependency
c8e1258
3e734a0
* Sun Feb 12 2012 Paul Howarth <paul@city-fan.org> - 0.06-1
3e734a0
- Update to 0.06
3e734a0
  - Require Module::Runtime 0.012, which has a number of useful bug fixes
3e734a0
be51602
* Fri Feb 10 2012 Paul Howarth <paul@city-fan.org> - 0.05-1
be51602
- Update to 0.05
be51602
  - Make Test::Taint an optional dependency; it requires XS, and requiring a
be51602
    compiler for Module::Implementation defeats its purpose (CPAN RT#74817)
be51602
- BR: perl(Test::Requires)
be51602
- Update patch for building with old Test::More versions
be51602
f128b86
* Thu Feb  9 2012 Paul Howarth <paul@city-fan.org> - 0.04-1
f128b86
- Update to 0.04
f128b86
  - This module no longer installs an _implementation() subroutine in callers;
f128b86
    instead, you can call Module::Implementation::implementation_for($package)
f128b86
    to get the implementation used for a given package
f128b86
- Update patch for building with old Test::More versions
f128b86
d407a78
* Wed Feb  8 2012 Paul Howarth <paul@city-fan.org> - 0.03-3
d407a78
- Incorporate feedback from package review (#788258)
d407a78
  - Correct License tag, which should be Artistic 2.0
d407a78
  - BR: perl(lib) for test suite
d407a78
  - Explicitly require perl(Carp), not automatically detected
d407a78
d407a78
* Tue Feb  7 2012 Paul Howarth <paul@city-fan.org> - 0.03-2
d407a78
- Sanitize for Fedora submission
d407a78
d407a78
* Tue Feb  7 2012 Paul Howarth <paul@city-fan.org> - 0.03-1
d407a78
- Initial RPM version