perl-Module-Implementation-vl.spec 4.9 KB

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