[perl-Perl-Critic] Tidy dependencies and add --with authortests build option

Paul Howarth pghmcfc at fedoraproject.org
Wed Mar 30 12:12:59 UTC 2011


commit 2868c631b83d5485b99bf59454790c74c7ba66f5
Author: Paul Howarth <paul at city-fan.org>
Date:   Wed Mar 30 09:23:02 2011 +0100

    Tidy dependencies and add --with authortests build option
    
    - BR/R: optional modules perl(Readonly::XS), perl(Term::ANSIColor) >= 2.02
    - BR: perl(Pod::Spell) >= 1
    - BR: perl(Text::ParseWords) >= 3
    - Add runtime deps for optional modules perl(File::HomeDir), perl(File::Which)
    - Add dependency on aspell for Perl::Critic::Policy::Documentation::PodSpelling
    - Add version 1.889 requirement for perl(Email::Address)
    - Add version 0.19 requirement for perl(List::MoreUtils)
    - Add version 0.010 requirement for perl(PPIx::Regexp)
    - Add version 1.001 requirement for perl(PPIx::Utilities::Statement)
    - Add version 0.77 requirement for perl(version)
    - Drop unused buildreq perl(Test::Spelling)
    - Drop bogus buildreqs perl(lib) and perl(base)
    - Add option for building with author tests enabled (--with authortests)
    - Add patch with words not in Fedora dictionaries for spell check tests
    - Split buildreqs into separate sections for build process, the module, the
      main test suite and the author tests

 Perl-Critic-1.113-stopwords.patch |   59 ++++++++++++++++
 perl-Perl-Critic.spec             |  132 ++++++++++++++++++++++++-------------
 2 files changed, 144 insertions(+), 47 deletions(-)
---
diff --git a/Perl-Critic-1.113-stopwords.patch b/Perl-Critic-1.113-stopwords.patch
new file mode 100644
index 0000000..ad7145d
--- /dev/null
+++ b/Perl-Critic-1.113-stopwords.patch
@@ -0,0 +1,59 @@
+--- Perl-Critic-1.113/xt/author/40_stop_words.orig	2011-02-15 01:38:45.000000000 +0000
++++ Perl-Critic-1.113/xt/author/40_stop_words	2011-03-18 14:26:58.075929860 +0000
+@@ -15,7 +15,9 @@
+ colour
+ colours
+ config
++Conway's
+ CPAN
++customizable
+ CVS
+ dereference
+ dereferencing
+@@ -28,6 +30,7 @@
+ filehandles
+ filename
+ filenames
++Fowler's
+ globals
+ globbing
+ Guzis
+@@ -37,9 +40,12 @@
+ HEREDOCs
+ IDE
+ lvalue
++maintainer's
++matcher
+ Maxia
+ Mehner
+ memoization
++MERCHANTABILITY
+ metacharacters
+ Metadata
+ metadata
+@@ -49,6 +55,7 @@
+ namespace
+ namespaces
+ octothorp
++optimizations
+ PBP
+ pbp
+ perl
+@@ -88,6 +95,7 @@
+ STDIN
+ STDOUT
+ stringification
++subclasses
+ subdirectories
+ subscripted
+ superclass
+@@ -101,6 +109,9 @@
+ undef
+ unescaped
+ unparsed
++untestable
++untrusted
++unvalidated
+ vice-versa
+ whitespace
+ Wyant
diff --git a/perl-Perl-Critic.spec b/perl-Perl-Critic.spec
index 44fc663..634062d 100644
--- a/perl-Perl-Critic.spec
+++ b/perl-Perl-Critic.spec
@@ -1,3 +1,5 @@
+%bcond_with authortests
+
 Name:           perl-Perl-Critic
 Version:        1.114
 Release:        1%{?dist}
@@ -7,66 +9,83 @@ Group:          Development/Libraries
 License:        GPL+ or Artistic
 URL:            http://search.cpan.org/dist/Perl-Critic/
 Source0:        http://search.cpan.org/CPAN/authors/id/E/EL/ELLIOTJS/Perl-Critic-%{version}.tar.gz
+Patch0:         Perl-Critic-1.113-stopwords.patch
 BuildArch:      noarch
 Requires:       perl(:MODULE_COMPAT_%(eval "`%{__perl} -V:version`"; echo $version))
 
+# Build process
 BuildRequires:  perl(Module::Build)
+BuildRequires:  perl(Task::Weaken)
+
+# Module requirements
+BuildRequires:  aspell-en
+Requires:       aspell
 BuildRequires:  perl(B::Keywords) >= 1.05
+BuildRequires:  perl(Carp)
+BuildRequires:  perl(charnames)
 BuildRequires:  perl(Config::Tiny) >= 2
-BuildRequires:  perl(File::HomeDir)
+BuildRequires:  perl(Email::Address) >= 1.889
+BuildRequires:  perl(English)
+BuildRequires:  perl(Exception::Class) >= 1.23
+BuildRequires:  perl(Exporter)
+BuildRequires:  perl(File::Basename)
+BuildRequires:  perl(File::Find)
+BuildRequires:  perl(File::Path)
+BuildRequires:  perl(File::Spec)
+BuildRequires:  perl(File::Spec::Unix)
+BuildRequires:  perl(File::Temp)
+BuildRequires:  perl(Getopt::Long)
 BuildRequires:  perl(IO::String)
-BuildRequires:  perl(List::MoreUtils)
-BuildRequires:  perl(String::Format) >= 1.13
-
+BuildRequires:  perl(List::MoreUtils) >= 0.19
+BuildRequires:  perl(List::Util)
 BuildRequires:  perl(Module::Pluggable) >= 3.1
 Requires:       perl(Module::Pluggable) >= 3.1
+BuildRequires:  perl(overload)
+BuildRequires:  perl(Perl::Tidy)
 BuildRequires:  perl(Pod::Parser)
 Requires:       perl(Pod::Parser)
+BuildRequires:  perl(Pod::PlainText)
+BuildRequires:  perl(Pod::Select)
+BuildRequires:  perl(Pod::Spell) >= 1
+BuildRequires:  perl(Pod::Usage)
 BuildRequires:  perl(PPI) >= 1.215
 Requires:       perl(PPI) >= 1.215
-BuildRequires:  perl(Perl::Tidy)
-
-BuildRequires:  perl(PPIx::Utilities::Statement)
-BuildRequires:  perl(Task::Weaken)
-BuildRequires:  perl(PPIx::Regexp)
-BuildRequires:  perl(Test::Memory::Cycle)
+BuildRequires:  perl(PPIx::Regexp) >= 0.010
+BuildRequires:  perl(PPIx::Utilities::Statement) >= 1.001
 BuildRequires:  perl(Readonly) >= 1.03
-BuildRequires:  perl(Exception::Class) >= 1.23
-BuildRequires:  perl(Email::Address)
-BuildRequires:  perl(Test::Deep)
-# Author tests
-BuildRequires:  perl(Test::Perl::Critic)
-BuildRequires:  perl(Test::Kwalitee)
-BuildRequires:  aspell-en
+BuildRequires:  perl(Scalar::Util)
+BuildRequires:  perl(strict)
+BuildRequires:  perl(String::Format) >= 1.13
+BuildRequires:  perl(Text::ParseWords) >= 3
+BuildRequires:  perl(version) >= 0.77
+BuildRequires:  perl(warnings)
+
+# Optional module requirements
+BuildRequires:  perl(File::HomeDir)
+Requires:       perl(File::HomeDir)
 BuildRequires:  perl(File::Which)
-BuildRequires:  perl(Test::Spelling)
-BuildRequires:  perl(Test::Pod)
-BuildRequires:  perl(Test::Pod::Coverage)
+Requires:       perl(File::Which)
+BuildRequires:  perl(Readonly::XS)
+Requires:       perl(Readonly::XS)
+BuildRequires:  perl(Term::ANSIColor) >= 2.02
+Requires:       perl(Term::ANSIColor) >= 2.02
 
-### auto-added brs!
-BuildRequires:  perl(strict)
-BuildRequires:  perl(Scalar::Util)
-BuildRequires:  perl(File::Temp)
-BuildRequires:  perl(Pod::Usage)
-BuildRequires:  perl(File::Find)
-BuildRequires:  perl(charnames)
-BuildRequires:  perl(File::Spec::Unix)
-BuildRequires:  perl(List::Util)
-BuildRequires:  perl(lib)
-BuildRequires:  perl(Getopt::Long)
-BuildRequires:  perl(Exporter)
+# Main test suite
+BuildRequires:  perl(Test::Deep)
+BuildRequires:  perl(Test::Memory::Cycle)
 BuildRequires:  perl(Test::More)
-BuildRequires:  perl(overload)
-BuildRequires:  perl(base)
-BuildRequires:  perl(version)
-BuildRequires:  perl(Carp)
-BuildRequires:  perl(warnings)
-BuildRequires:  perl(File::Basename)
-BuildRequires:  perl(File::Spec)
-BuildRequires:  perl(File::Path)
-BuildRequires:  perl(Pod::PlainText)
-BuildRequires:  perl(Pod::Select)
-BuildRequires:  perl(English)
+BuildRequires:  perl(Test::Perl::Critic)
+
+# Author tests
+%if %{with authortests}
+BuildRequires:  perl(Devel::EnforceEncapsulation)
+BuildRequires:  perl(Perl::Critic::Policy::Editor::RequireEmacsFileVariables)
+BuildRequires:  perl(Perl::Critic::Policy::ErrorHandling::RequireUseOfExceptions)
+BuildRequires:  perl(Test::Kwalitee)
+BuildRequires:  perl(Test::Pod) >= 1.00
+BuildRequires:  perl(Test::Pod::Coverage) >= 1.04
+BuildRequires:  perl(Test::Without::Module)
+%endif
 
 # don't "provide" private Perl libs
 %{?perl_default_filter}
@@ -101,6 +120,8 @@ of Perl code were mixed directly in the test script. That sucked.
 %setup -q -n Perl-Critic-%{version}
 find . -type f -exec chmod -c -x {} +
 
+# Extra stopwords for spell checker for author tests
+%patch0 -p1
 
 %build
 %{__perl} Build.PL installdirs=vendor
@@ -113,10 +134,11 @@ find . -type f -exec chmod -c -x {} +
 
 
 %check
-# Additional requirements of author tests:
-#   Test::Perl::Critic, Test::Kwalitee
-#TEST_AUTHOR=1 ./Build test
-./Build test
+%if %{with authortests}
+LC_ALL=en_US ./Build authortest
+%else
+LC_ALL=en_US ./Build test
+%endif
 
 
 %files
@@ -162,8 +184,24 @@ find . -type f -exec chmod -c -x {} +
     block; this was fixed by PPI 1.215 (CPAN RT#64132)
 - bump PPI version requirement to 1.215
 - BR/R: perl(Pod::Parser)
+- BR/R: optional modules perl(Readonly::XS), perl(Term::ANSIColor) >= 2.02
+- BR: perl(Pod::Spell) >= 1
+- BR: perl(Text::ParseWords) >= 3
+- add runtime deps for optional modules perl(File::HomeDir), perl(File::Which)
 - drop redundant (for modern rpm) BuildRoot tag and buildroot cleaning
 - split Test::Perl::Critic::Policy off into its own package
+- add dependency on aspell for Perl::Critic::Policy::Documentation::PodSpelling
+- add version 1.889 requirement for perl(Email::Address)
+- add version 0.19 requirement for perl(List::MoreUtils)
+- add version 0.010 requirement for perl(PPIx::Regexp)
+- add version 1.001 requirement for perl(PPIx::Utilities::Statement)
+- add version 0.77 requirement for perl(version)
+- drop unused buildreq perl(Test::Spelling)
+- drop bogus buildreqs perl(lib) and perl(base)
+- add option for building with author tests enabled (--with authortests)
+- add patch with words not in Fedora dictionaries for spell check tests
+- split buildreqs into separate sections for build process, the module, the
+  main test suite and the author tests
 
 * Mon Mar  7 2011 Marcela Mašláňová <mmaslano at redhat.com> - 1.113-1
 - update to 1.113



More information about the perl-devel mailing list