[5844] | 1 | # We need to patch the test suite if we have an old version of Test::More |
---|
| 2 | %global old_test_more %(perl -MTest::More -e 'print (($Test::More::VERSION < 0.88) ? 1 : 0);' 2>/dev/null || echo 0) |
---|
| 3 | |
---|
| 4 | # Test::CPAN::Changes isn't available in EPEL < 7, due to requirement of perl(version) ≥ 0.79 |
---|
| 5 | %global cpan_changes_available %(expr 0%{?fedora} + 0%{?rhel} '>' 6) |
---|
| 6 | |
---|
| 7 | #TODO: BR: Test::Pod::No404s when available |
---|
| 8 | #TODO: BR: Test::Pod::LinkCheck when available |
---|
| 9 | |
---|
| 10 | Name: perl-Module-Implementation |
---|
| 11 | Version: 0.06 |
---|
| 12 | Release: 1%{?_dist_release} |
---|
| 13 | Summary: Loads one of several alternate underlying implementations for a module |
---|
| 14 | Group: Development/Libraries |
---|
| 15 | License: Artistic 2.0 |
---|
| 16 | URL: http://search.cpan.org/dist/perl-Module-Implementation/ |
---|
| 17 | Source0: http://search.cpan.org/CPAN/authors/id/D/DR/DROLSKY/Module-Implementation-%{version}.tar.gz |
---|
| 18 | Patch1: Module-Implementation-0.05-old-Test::More.patch |
---|
| 19 | BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}-root-%(id -nu) |
---|
| 20 | BuildArch: noarch |
---|
| 21 | # =================================================================== |
---|
| 22 | # Build requirements |
---|
| 23 | # =================================================================== |
---|
| 24 | BuildRequires: perl(ExtUtils::MakeMaker) |
---|
| 25 | # =================================================================== |
---|
| 26 | # Module requirements |
---|
| 27 | # =================================================================== |
---|
| 28 | BuildRequires: perl(Carp) |
---|
| 29 | BuildRequires: perl(Module::Runtime) >= 0.012 |
---|
| 30 | BuildRequires: perl(Try::Tiny) |
---|
| 31 | BuildRequires: perl(strict) |
---|
| 32 | BuildRequires: perl(warnings) |
---|
| 33 | # =================================================================== |
---|
| 34 | # Test suite requirements |
---|
| 35 | # =================================================================== |
---|
| 36 | BuildRequires: perl(lib) |
---|
| 37 | BuildRequires: perl(Test::Fatal) |
---|
| 38 | BuildRequires: perl(Test::More) |
---|
| 39 | BuildRequires: perl(Test::Requires) |
---|
| 40 | BuildRequires: perl(Test::Taint) |
---|
| 41 | # =================================================================== |
---|
| 42 | # Author/Release test requirements |
---|
| 43 | # =================================================================== |
---|
| 44 | %if %{cpan_changes_available} |
---|
| 45 | BuildRequires: perl(Test::CPAN::Changes) |
---|
| 46 | %endif |
---|
| 47 | BuildRequires: perl(Test::EOL) |
---|
| 48 | BuildRequires: perl(Test::NoTabs) |
---|
| 49 | BuildRequires: perl(Test::Pod) |
---|
| 50 | BuildRequires: perl(Test::Spelling), aspell-en |
---|
| 51 | # =================================================================== |
---|
| 52 | # Runtime requirements |
---|
| 53 | # =================================================================== |
---|
| 54 | Requires: perl(:MODULE_COMPAT_%(eval "`perl -V:version`"; echo $version)) |
---|
| 55 | Requires: perl(Carp) |
---|
| 56 | |
---|
| 57 | %description |
---|
| 58 | This module abstracts out the process of choosing one of several underlying |
---|
| 59 | implementations for a module. This can be used to provide XS and pure Perl |
---|
| 60 | implementations of a module, or it could be used to load an implementation |
---|
| 61 | for a given OS or any other case of needing to provide multiple |
---|
| 62 | implementations. |
---|
| 63 | |
---|
| 64 | This module is only useful when you know all the implementations ahead of |
---|
| 65 | time. If you want to load arbitrary implementations then you probably want |
---|
| 66 | something like a plugin system, not this module. |
---|
| 67 | |
---|
| 68 | %prep |
---|
| 69 | %setup -q -n Module-Implementation-%{version} |
---|
| 70 | |
---|
| 71 | # We have to patch the test suite if we have an old Test::More |
---|
| 72 | %if %{old_test_more} |
---|
| 73 | %patch1 -p1 |
---|
| 74 | %endif |
---|
| 75 | |
---|
| 76 | %build |
---|
| 77 | perl Makefile.PL INSTALLDIRS=vendor |
---|
| 78 | make %{?_smp_mflags} |
---|
| 79 | |
---|
| 80 | %install |
---|
| 81 | rm -rf %{buildroot} |
---|
| 82 | make pure_install DESTDIR=%{buildroot} |
---|
| 83 | find %{buildroot} -type f -name .packlist -exec rm -f {} \; |
---|
| 84 | find %{buildroot} -depth -type d -exec rmdir {} \; 2>/dev/null |
---|
| 85 | %{_fixperms} %{buildroot} |
---|
| 86 | |
---|
| 87 | %check |
---|
| 88 | make test RELEASE_TESTING=1 |
---|
| 89 | |
---|
| 90 | %clean |
---|
| 91 | rm -rf %{buildroot} |
---|
| 92 | |
---|
| 93 | %files |
---|
| 94 | %defattr(-,root,root,-) |
---|
| 95 | %doc Changes LICENSE README |
---|
| 96 | %{perl_vendorlib}/Module/ |
---|
| 97 | %{_mandir}/man3/Module::Implementation.3pm* |
---|
| 98 | |
---|
| 99 | %changelog |
---|
| 100 | * Mon Mar 05 2012 MATSUBAYASHI Kohji <shaolin@vinelinux.org> - 0.06-1 |
---|
| 101 | - initial build for Vine Linux |
---|
| 102 | |
---|
| 103 | * Sun Feb 12 2012 Paul Howarth <paul@city-fan.org> - 0.06-1 |
---|
| 104 | - Update to 0.06 |
---|
| 105 | - Require Module::Runtime 0.012, which has a number of useful bug fixes |
---|
| 106 | |
---|
| 107 | * Fri Feb 10 2012 Paul Howarth <paul@city-fan.org> - 0.05-1 |
---|
| 108 | - Update to 0.05 |
---|
| 109 | - Make Test::Taint an optional dependency; it requires XS, and requiring a |
---|
| 110 | compiler for Module::Implementation defeats its purpose (CPAN RT#74817) |
---|
| 111 | - BR: perl(Test::Requires) |
---|
| 112 | - Update patch for building with old Test::More versions |
---|
| 113 | |
---|
| 114 | * Thu Feb 9 2012 Paul Howarth <paul@city-fan.org> - 0.04-1 |
---|
| 115 | - Update to 0.04 |
---|
| 116 | - This module no longer installs an _implementation() subroutine in callers; |
---|
| 117 | instead, you can call Module::Implementation::implementation_for($package) |
---|
| 118 | to get the implementation used for a given package |
---|
| 119 | - Update patch for building with old Test::More versions |
---|
| 120 | |
---|
| 121 | * Wed Feb 8 2012 Paul Howarth <paul@city-fan.org> - 0.03-3 |
---|
| 122 | - Incorporate feedback from package review (#788258) |
---|
| 123 | - Correct License tag, which should be Artistic 2.0 |
---|
| 124 | - BR: perl(lib) for test suite |
---|
| 125 | - Explicitly require perl(Carp), not automatically detected |
---|
| 126 | |
---|
| 127 | * Tue Feb 7 2012 Paul Howarth <paul@city-fan.org> - 0.03-2 |
---|
| 128 | - Sanitize for Fedora submission |
---|
| 129 | |
---|
| 130 | * Tue Feb 7 2012 Paul Howarth <paul@city-fan.org> - 0.03-1 |
---|
| 131 | - Initial RPM version |
---|