commit e37e1ae13d3e10b103f7dd86d316ba58b3f2271d Author: Paul Howarth <paul@xxxxxxxxxxxx> Date: Thu Mar 22 19:06:10 2012 +0000 Clean up and support EPEL-5 builds - Drop -tests subpackage (general lack of interest in this), but include them as documentation for the main package - Don't need explicit runtime dependency on perl(Test::Builder::Module) if we have rpm ≥ 4.9 as it can auto-detect it - BR: at least version 0.61 of perl(Test::More) as per upstream - Drop unnecessary version requirement for perl(ExtUtils::MakeMaker) - Drop redundant %{?perl_default_filter} - BR: aspell-en rather than hunspell-en on old distributions where Test::Spelling uses aspell instead of hunspell - Don't BR: perl(Test::Perl::Critic) when bootstrapping - Don't use macros for commands - Don't need to remove empty directories from buildroot - Make %files list more explicit - Drop %defattr, redundant since rpm 4.4 - Use tabs perl-Test-Requires.spec | 96 ++++++++++++++++++++++++++++++----------------- 1 files changed, 61 insertions(+), 35 deletions(-) --- diff --git a/perl-Test-Requires.spec b/perl-Test-Requires.spec index 8cf2d78..488bd88 100644 --- a/perl-Test-Requires.spec +++ b/perl-Test-Requires.spec @@ -1,63 +1,89 @@ -Name: perl-Test-Requires -Summary: Checks to see if a given module can be loaded -Version: 0.06 -Release: 3%{?dist} -License: GPL+ or Artistic -Group: Development/Libraries -Source0: http://search.cpan.org/CPAN/authors/id/T/TO/TOKUHIROM/Test-Requires-%{version}.tar.gz -URL: http://search.cpan.org/dist/Test-Requires -BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}-root-%(%{__id_u} -n) -Requires: perl(:MODULE_COMPAT_%(eval "`%{__perl} -V:version`"; echo $version)) -BuildArch: noarch - -BuildRequires: perl(ExtUtils::MakeMaker) >= 6.42 -BuildRequires: perl(Test::Builder::Module) -BuildRequires: perl(Test::More) -BuildRequires: perl(Test::Perl::Critic) -BuildRequires: perl(Test::Pod) -BuildRequires: perl(Test::Spelling), hunspell-en - -Requires: perl(Test::Builder::Module) - -%{?perl_default_filter} -%{?perl_default_subpackage_tests} +# Only need manual requires for "use base XXX;" prior to rpm 4.9 +%global rpm49 %(rpm --version | perl -pi -e 's/^.* (\\d+)\\.(\\d+).*/sprintf("%d.%03d",$1,$2) ge 4.009 ? 1 : 0/e') + +Name: perl-Test-Requires +Summary: Checks to see if a given module can be loaded +Version: 0.06 +Release: 4%{?dist} +License: GPL+ or Artistic +Group: Development/Libraries +URL: http://search.cpan.org/dist/Test-Requires +Source0: http://search.cpan.org/CPAN/authors/id/T/TO/TOKUHIROM/Test-Requires-%{version}.tar.gz +BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}-root-%(id -nu) +BuildArch: noarch +BuildRequires: perl(ExtUtils::MakeMaker) +BuildRequires: perl(Test::Builder::Module) +BuildRequires: perl(Test::More) >= 0.61 +# Test::Perl::Critic -> Perl::Critic -> PPIx::Regexp -> Test::Kwalitee -> +# Module::CPANTS::Analyse -> Test::Warn -> Sub::Uplevel -> Pod::Wordlist::hanekomu -> Test::Requires +%if 0%{!?perl_bootstrap:1} +BuildRequires: perl(Test::Perl::Critic) +%endif +BuildRequires: perl(Test::Pod) +BuildRequires: perl(Test::Spelling) +%if %(perl -e 'print $] >= 5.010 ? 1 : 0;') +BuildRequires: hunspell-en +%else +BuildRequires: aspell-en +%endif +Requires: perl(:MODULE_COMPAT_%(eval "`perl -V:version`"; echo $version)) +%if ! %{rpm49} +Requires: perl(Test::Builder::Module) +%endif + +# Obsolete/provide old -tests subpackage (can be removed in F19 development cycle) +Obsoletes: %{name}-tests < %{version}-%{release} +Provides: %{name}-tests = %{version}-%{release} %description -Test::Requires checks to see if the module can be loaded; if this fails -rather than failing tests this *skips all tests*. +Test::Requires checks to see if the module can be loaded. + +If this fails, rather than failing tests this skips all tests. %prep %setup -q -n Test-Requires-%{version} %build -%{__perl} Makefile.PL INSTALLDIRS=vendor +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 {} ';' -find %{buildroot} -depth -type d -exec rmdir {} 2>/dev/null ';' - -%{_fixperms} %{buildroot}/* +%{_fixperms} %{buildroot} %check # note the "skipped" warnings indicate success :) make test make test TEST_FILES="xt/*.t" - %clean rm -rf %{buildroot} %files -%defattr(-,root,root,-) -%doc Changes README -%{perl_vendorlib}/* -%{_mandir}/man3/*.3* +%doc Changes README t/ xt/ +%{perl_vendorlib}/Test/ +%{_mandir}/man3/Test::Requires.3pm* %changelog +* Thu Mar 22 2012 Paul Howarth <paul@xxxxxxxxxxxx> - 0.06-4 +- Drop -tests subpackage (general lack of interest in this), but include + them as documentation for the main package +- Don't need explicit runtime dependency on perl(Test::Builder::Module) if we + have rpm ≥ 4.9 as it can auto-detect it +- BR: at least version 0.61 of perl(Test::More) as per upstream +- Drop unnecessary version requirement for perl(ExtUtils::MakeMaker) +- Drop redundant %%{?perl_default_filter} +- BR: aspell-en rather than hunspell-en on old distributions where + Test::Spelling uses aspell instead of hunspell +- Don't BR: perl(Test::Perl::Critic) when bootstrapping +- Don't use macros for commands +- Don't need to remove empty directories from buildroot +- Make %%files list more explicit +- Drop %%defattr, redundant since rpm 4.4 +- Use tabs + * Wed Aug 17 2011 Paul Howarth <paul@xxxxxxxxxxxx> - 0.06-3 - BR: hunspell-en rather than aspell-en (#731272) -- Fedora Extras Perl SIG http://www.fedoraproject.org/wiki/Extras/SIGs/Perl perl-devel mailing list perl-devel@xxxxxxxxxxxxxxxxxxxxxxx https://admin.fedoraproject.org/mailman/listinfo/perl-devel