2868c63
%bcond_with authortests
2868c63
f0165e2
Name:           perl-Perl-Critic
311f21a
Version:        1.116
fbad33c
Release:        2%{?dist}
f0165e2
Summary:        Critique Perl source code for best-practices
f0165e2
f0165e2
Group:          Development/Libraries
3f17108
License:        GPL+ or Artistic
f0165e2
URL:            http://search.cpan.org/dist/Perl-Critic/
Chris Weyl 2f21615
Source0:        http://search.cpan.org/CPAN/authors/id/E/EL/ELLIOTJS/Perl-Critic-%{version}.tar.gz
2868c63
Patch0:         Perl-Critic-1.113-stopwords.patch
f0165e2
BuildArch:      noarch
Chris Weyl ebb8cf4
Requires:       perl(:MODULE_COMPAT_%(eval "`%{__perl} -V:version`"; echo $version))
Chris Weyl ebb8cf4
2868c63
# Build process
f0165e2
BuildRequires:  perl(Module::Build)
2868c63
BuildRequires:  perl(Task::Weaken)
2868c63
2868c63
# Module requirements
2868c63
BuildRequires:  aspell-en
2868c63
Requires:       aspell
53a0ea7
BuildRequires:  perl(B::Keywords) >= 1.05
2868c63
BuildRequires:  perl(Carp)
2868c63
BuildRequires:  perl(charnames)
f0165e2
BuildRequires:  perl(Config::Tiny) >= 2
2868c63
BuildRequires:  perl(Email::Address) >= 1.889
2868c63
BuildRequires:  perl(English)
2868c63
BuildRequires:  perl(Exception::Class) >= 1.23
2868c63
BuildRequires:  perl(Exporter)
2868c63
BuildRequires:  perl(File::Basename)
2868c63
BuildRequires:  perl(File::Find)
2868c63
BuildRequires:  perl(File::Path)
2868c63
BuildRequires:  perl(File::Spec)
2868c63
BuildRequires:  perl(File::Spec::Unix)
2868c63
BuildRequires:  perl(File::Temp)
2868c63
BuildRequires:  perl(Getopt::Long)
f0165e2
BuildRequires:  perl(IO::String)
2868c63
BuildRequires:  perl(List::MoreUtils) >= 0.19
2868c63
BuildRequires:  perl(List::Util)
fcf5720
BuildRequires:  perl(Module::Pluggable) >= 3.1
3fd13a0
Requires:       perl(Module::Pluggable) >= 3.1
2868c63
BuildRequires:  perl(overload)
2868c63
BuildRequires:  perl(Perl::Tidy)
8d08a15
BuildRequires:  perl(Pod::Parser)
8d08a15
Requires:       perl(Pod::Parser)
2868c63
BuildRequires:  perl(Pod::PlainText)
2868c63
BuildRequires:  perl(Pod::Select)
2868c63
BuildRequires:  perl(Pod::Spell) >= 1
2868c63
BuildRequires:  perl(Pod::Usage)
8d08a15
BuildRequires:  perl(PPI) >= 1.215
8d08a15
Requires:       perl(PPI) >= 1.215
2868c63
BuildRequires:  perl(PPIx::Regexp) >= 0.010
2868c63
BuildRequires:  perl(PPIx::Utilities::Statement) >= 1.001
Chris Weyl ebb8cf4
BuildRequires:  perl(Readonly) >= 1.03
2868c63
BuildRequires:  perl(Scalar::Util)
2868c63
BuildRequires:  perl(strict)
2868c63
BuildRequires:  perl(String::Format) >= 1.13
2868c63
BuildRequires:  perl(Text::ParseWords) >= 3
2868c63
BuildRequires:  perl(version) >= 0.77
2868c63
BuildRequires:  perl(warnings)
2868c63
2868c63
# Optional module requirements
2868c63
BuildRequires:  perl(File::HomeDir)
2868c63
Requires:       perl(File::HomeDir)
53a0ea7
BuildRequires:  perl(File::Which)
2868c63
Requires:       perl(File::Which)
2868c63
BuildRequires:  perl(Readonly::XS)
2868c63
Requires:       perl(Readonly::XS)
2868c63
BuildRequires:  perl(Term::ANSIColor) >= 2.02
2868c63
Requires:       perl(Term::ANSIColor) >= 2.02
Chris Weyl ebb8cf4
2868c63
# Main test suite
2868c63
BuildRequires:  perl(Test::Deep)
2868c63
BuildRequires:  perl(Test::Memory::Cycle)
Chris Weyl 2f21615
BuildRequires:  perl(Test::More)
2868c63
2868c63
# Author tests
2868c63
%if %{with authortests}
2868c63
BuildRequires:  perl(Devel::EnforceEncapsulation)
2868c63
BuildRequires:  perl(Perl::Critic::Policy::Editor::RequireEmacsFileVariables)
2868c63
BuildRequires:  perl(Perl::Critic::Policy::ErrorHandling::RequireUseOfExceptions)
2868c63
BuildRequires:  perl(Test::Kwalitee)
fbad33c
BuildRequires:  perl(Test::Perl::Critic)
2868c63
BuildRequires:  perl(Test::Pod) >= 1.00
2868c63
BuildRequires:  perl(Test::Pod::Coverage) >= 1.04
2868c63
BuildRequires:  perl(Test::Without::Module)
2868c63
%endif
Chris Weyl 2f21615
Chris Weyl 2f21615
# don't "provide" private Perl libs
3fd13a0
%{?perl_default_filter}
3fd13a0
Chris Weyl 2f21615
f0165e2
%description
f0165e2
Perl::Critic is an extensible framework for creating and applying coding
f0165e2
standards to Perl source code. Essentially, it is a static source code
f0165e2
analysis engine. Perl::Critic is distributed with a number of
f0165e2
Perl::Critic::Policy modules that attempt to enforce various coding
f0165e2
guidelines. Most Policy modules are based on Damian Conway's book Perl
f0165e2
Best Practices. However, Perl::Critic is not limited to PBP and will
f0165e2
even support Policies that contradict Conway. You can enable, disable,
f0165e2
and customize those Polices through the Perl::Critic interface. You can
f0165e2
also create new Policy modules that suit your own tastes.
f0165e2
f0165e2
0bc1d1f
%package -n perl-Test-Perl-Critic-Policy
0bc1d1f
Summary:        A framework for testing your custom Policies
0bc1d1f
Group:          Development/Libraries
0bc1d1f
License:        GPL+ or Artistic
0bc1d1f
0bc1d1f
0bc1d1f
%description -n perl-Test-Perl-Critic-Policy
0bc1d1f
This module provides a framework for function-testing your custom
0bc1d1f
Perl::Critic::Policy modules. Policy testing usually involves feeding it a
0bc1d1f
string of Perl code and checking its behavior. In the old days, those strings
0bc1d1f
of Perl code were mixed directly in the test script. That sucked.
0bc1d1f
0bc1d1f
f0165e2
%prep
f0165e2
%setup -q -n Perl-Critic-%{version}
Chris Weyl ebb8cf4
find . -type f -exec chmod -c -x {} +
Chris Weyl ebb8cf4
2868c63
# Extra stopwords for spell checker for author tests
2868c63
%patch0 -p1
f7d1997
f0165e2
%build
f0165e2
%{__perl} Build.PL installdirs=vendor
f0165e2
./Build
f0165e2
f0165e2
f0165e2
%install
f0165e2
./Build install destdir=$RPM_BUILD_ROOT create_packlist=0
f7d1997
%{_fixperms} $RPM_BUILD_ROOT
f0165e2
f0165e2
f0165e2
%check
2868c63
%if %{with authortests}
2868c63
LC_ALL=en_US ./Build authortest
2868c63
%else
2868c63
LC_ALL=en_US ./Build test
2868c63
%endif
f0165e2
f0165e2
f0165e2
%files
f0165e2
%defattr(-,root,root,-)
Chris Weyl ebb8cf4
%doc Changes LICENSE README TODO.pod examples/ extras/ tools/
0bc1d1f
%{_bindir}/perlcritic
f0165e2
%{perl_vendorlib}/Perl/
0bc1d1f
%{_mandir}/man1/perlcritic.1*
0bc1d1f
%{_mandir}/man3/Perl::Critic*.3pm*
0bc1d1f
0bc1d1f
0bc1d1f
%files -n perl-Test-Perl-Critic-Policy
0bc1d1f
%defattr(-,root,root,-)
0bc1d1f
%{perl_vendorlib}/Test/
0bc1d1f
%{_mandir}/man3/Test::Perl::Critic::Policy.3pm*
f0165e2
f0165e2
f0165e2
%changelog
fbad33c
* Wed Jun 29 2011 Paul Howarth <paul@city-fan.org> - 1.116-2
fbad33c
- move BR: perl(Test::Perl::Critic) to author test section where it belongs
fbad33c
311f21a
* Mon May 16 2011 Paul Howarth <paul@city-fan.org> - 1.116-1
311f21a
- update to 1.116
311f21a
  - BuiltInFunctions::ProhibitLvalueSubstr does not report violations if the
311f21a
    document contains an explicit 'use n.nnn;' where the version is before
311f21a
    5.005 (CPAN RT#59112)
311f21a
  - Documentation::RequirePodSections no longer blows up on code having POD but
311f21a
    no =head1 (CPAN RT#67231)
311f21a
  - RegularExpressions::ProhibitUnusedCapture should more reliably find things
311f21a
    like s/(a)/${1}2/ (CPAN RT#67273)
311f21a
  - ValuesAndExpressions::ProhibitMagicNumbers and Module::RequireVersionVar
311f21a
    now treat versions passed as the second argument of a 'package' statement
311f21a
    the same as versions declared as 'our $VERSION ...' (CPAN RT#67159)
311f21a
  - Variables::RequireLexicalLoopIterators does not report violations if the
311f21a
    document contains an explicit 'use n.nnn;' where the version is before
311f21a
    5.004 (CPAN RT#67760)
311f21a
077f0fd
* Fri Apr  1 2011 Paul Howarth <paul@city-fan.org> - 1.115-1
077f0fd
- update to 1.115
077f0fd
  - fatal error in RegularExpressions::ProhibitUnusedCapture here document
077f0fd
    check (CPAN RT#67116)
077f0fd
  - internal POD error in Documentation::RequirePodLinksIncludeText
077f0fd
    (CPAN RT#67012)
077f0fd
8d08a15
* Tue Mar 29 2011 Paul Howarth <paul@city-fan.org> 1.114-1
8d08a15
- update to 1.114
8d08a15
  - Documentation::RequirePodLinksIncludeText now handles nested POD formatting
8d08a15
    (CPAN RT#65569)
8d08a15
  - clarified relation of severity numbers to names in Perl::Critic POD
8d08a15
    (CPAN RT#66017)
8d08a15
  - removed caveats from Variables::RequireLocalizedPunctuationVars, no longer
8d08a15
    necessary with PPI 1.208 (CPAN RT#65514)
8d08a15
  - have InputOutput::RequireBriefOpen attempt to expand scope as necessary to
8d08a15
    deal with the case where the open() and the corresponding close() are not
8d08a15
    in the same scope (CPAN RT#64437)
8d08a15
  - RegularExpressions::ProhibitUnusedCapture now looks inside double-quotish
8d08a15
    things (CPAN RT#38942)
8d08a15
  - RegularExpressions::ProhibitUnusedCapture now takes logical alternation
8d08a15
    into account, so that (e.g.)
8d08a15
        if ( /(a)/ || /(b)/ ) {
8d08a15
                say $1;
8d08a15
        }
8d08a15
    is not a violation (CPAN RT#38942)
8d08a15
  - ValuesAndExpressions::ProhibitCommaSeparatedStatements now recognizes
8d08a15
    'return { foo => 1, bar => 2 }' as containing a hash constructor, not a
8d08a15
    block; this was fixed by PPI 1.215 (CPAN RT#61301)
8d08a15
  - ValuesAndExpressions::ProhibitCommaSeparatedStatements now recognizes
8d08a15
    'bless { foo => 1, bar => 2 }' as containing a hash constructor, not a
8d08a15
    block; this was fixed by PPI 1.215 (CPAN RT#64132)
8d08a15
- bump PPI version requirement to 1.215
8d08a15
- BR/R: perl(Pod::Parser)
2868c63
- BR/R: optional modules perl(Readonly::XS), perl(Term::ANSIColor) >= 2.02
2868c63
- BR: perl(Pod::Spell) >= 1
2868c63
- BR: perl(Text::ParseWords) >= 3
2868c63
- add runtime deps for optional modules perl(File::HomeDir), perl(File::Which)
f7d1997
- drop redundant (for modern rpm) BuildRoot tag and buildroot cleaning
0bc1d1f
- split Test::Perl::Critic::Policy off into its own package
2868c63
- add dependency on aspell for Perl::Critic::Policy::Documentation::PodSpelling
2868c63
- add version 1.889 requirement for perl(Email::Address)
2868c63
- add version 0.19 requirement for perl(List::MoreUtils)
2868c63
- add version 0.010 requirement for perl(PPIx::Regexp)
2868c63
- add version 1.001 requirement for perl(PPIx::Utilities::Statement)
2868c63
- add version 0.77 requirement for perl(version)
2868c63
- drop unused buildreq perl(Test::Spelling)
2868c63
- drop bogus buildreqs perl(lib) and perl(base)
2868c63
- add option for building with author tests enabled (--with authortests)
2868c63
- add patch with words not in Fedora dictionaries for spell check tests
2868c63
- split buildreqs into separate sections for build process, the module, the
2868c63
  main test suite and the author tests
8d08a15
c185ce5
* Mon Mar  7 2011 Marcela Mašláňová <mmaslano@redhat.com> - 1.113-1
c185ce5
- update to 1.113
c185ce5
9aefc05
* Tue Feb 08 2011 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 1.111-2
4752cd7
- rebuilt for https://fedoraproject.org/wiki/Fedora_15_Mass_Rebuild
9aefc05
8ffc46b
* Mon Jan  3 2011 Marcela Mašláňová <mmaslano@redhat.com> - 1.111-1
8ffc46b
- update
8ffc46b
f9d95d7
* Tue Dec 21 2010 Marcela Maslanova <mmaslano@redhat.com> - 1.108-2
4752cd7
- rebuild to fix problems with vendorarch/lib (#661697)
f9d95d7
d1a7344
* Fri Aug  6 2010 Marcela Maslanova <mmaslano@redhat.com> - 1.108-1
d1a7344
- update
d1a7344
1c6cb25
* Tue May 04 2010 Marcela Maslanova <mmaslano@redhat.com> - 1.105-4
4752cd7
- mass rebuild with perl-5.12.0
1c6cb25
002cd45
* Mon Dec  7 2009 Stepan Kasal <skasal@redhat.com> - 1.105-3
002cd45
- rebuild against perl 5.10.1
002cd45
3fd13a0
* Wed Nov 25 2009 Stepan Kasal <skasal@redhat.com> - 1.105-2
3fd13a0
- use the new filtering macros (verified that the resulting provides
3fd13a0
  and requires are the same)
3fd13a0
- add version to perl(PPI) require (#541020)
3fd13a0
513098a
* Wed Oct  7 2009 Stepan Kasal <skasal@redhat.com> - 1.105-1
405ea31
- new upstream version
405ea31
- update build requires
405ea31
e88f9fe
* Sun Jul 26 2009 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 1.098-3
e88f9fe
- Rebuilt for https://fedoraproject.org/wiki/Fedora_12_Mass_Rebuild
e88f9fe
Chris Weyl 2f21615
* Sun May 17 2009 Chris Weyl <cweyl@alumni.drew.edu> 1.098-1
Chris Weyl 2f21615
- "neaten" filtering
Chris Weyl 2f21615
- auto-update to 1.098 (by cpan-spec-update 0.01)
Chris Weyl 2f21615
- added a new br on perl(strict) (version 0)
Chris Weyl 2f21615
- added a new br on perl(Scalar::Util) (version 0)
Chris Weyl 2f21615
- added a new br on perl(File::Temp) (version 0)
Chris Weyl 2f21615
- added a new br on perl(Pod::Usage) (version 0)
Chris Weyl 2f21615
- added a new br on perl(File::Find) (version 0)
Chris Weyl 2f21615
- added a new br on perl(PPI::Token::Whitespace) (version 1.203)
Chris Weyl 2f21615
- added a new br on perl(charnames) (version 0)
Chris Weyl 2f21615
- added a new br on perl(PPI::Document::File) (version 1.203)
Chris Weyl 2f21615
- added a new br on perl(File::Spec::Unix) (version 0)
Chris Weyl 2f21615
- added a new br on perl(List::Util) (version 0)
Chris Weyl 2f21615
- added a new br on perl(lib) (version 0)
Chris Weyl 2f21615
- added a new br on perl(Getopt::Long) (version 0)
Chris Weyl 2f21615
- added a new br on perl(Exporter) (version 0)
Chris Weyl 2f21615
- added a new br on perl(Test::More) (version 0)
Chris Weyl 2f21615
- added a new br on perl(overload) (version 0)
Chris Weyl 2f21615
- added a new br on perl(base) (version 0)
Chris Weyl 2f21615
- added a new br on perl(version) (version 0)
Chris Weyl 2f21615
- added a new br on perl(Carp) (version 0)
Chris Weyl 2f21615
- added a new br on perl(warnings) (version 0)
Chris Weyl 2f21615
- added a new br on perl(PPI::Document) (version 1.203)
Chris Weyl 2f21615
- added a new br on perl(File::Basename) (version 0)
Chris Weyl 2f21615
- added a new br on perl(PPI::Token::Quote::Single) (version 1.203)
Chris Weyl 2f21615
- added a new br on perl(File::Spec) (version 0)
Chris Weyl 2f21615
- added a new br on perl(File::Path) (version 0)
Chris Weyl 2f21615
- added a new br on perl(Pod::PlainText) (version 0)
Chris Weyl 2f21615
- added a new br on perl(Pod::Select) (version 0)
Chris Weyl 2f21615
- added a new br on perl(PPI::Node) (version 1.203)
Chris Weyl 2f21615
- added a new br on perl(English) (version 0)
Chris Weyl 2f21615
beff4c9
* Thu Feb 26 2009 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 1.092-2
beff4c9
- Rebuilt for https://fedoraproject.org/wiki/Fedora_11_Mass_Rebuild
beff4c9
Chris Weyl 87c23d7
* Mon Sep 08 2008 Chris Weyl <cweyl@alumni.drew.edu> 1.092-1
Chris Weyl 87c23d7
- update to 1.092
Chris Weyl 87c23d7
Chris Weyl ebb8cf4
* Sun Mar 09 2008 Chris Weyl <cweyl@alumni.drew.edu> 1.082-1
Chris Weyl ebb8cf4
- update to 1.082
Chris Weyl ebb8cf4
- resolve BZ#431577
Chris Weyl ebb8cf4
- add t/ examples/ extras/ tools/, and filter
Chris Weyl ebb8cf4
ac71051
* Wed Feb 27 2008 Tom "spot" Callaway <tcallawa@redhat.com> - 1.080-3
ac71051
- Rebuild for perl 5.10 (again)
ac71051
34e585e
* Mon Jan 14 2008 Tom "spot" Callaway <tcallawa@redhat.com> - 1.080-2
34e585e
- add missing BR: perl-Exception-Class
34e585e
0d7e944
* Mon Jan 14 2008 Tom "spot" Callaway <tcallawa@redhat.com> - 1.080-1
0d7e944
- bump to 1.080
0d7e944
3f17108
* Mon Jan 14 2008 Tom "spot" Callaway <tcallawa@redhat.com> - 1.053-2
3f17108
- rebuild for new perl
3f17108
4669580
* Sat Jun 16 2007 Jose Pedro Oliveira <jpo at di.uminho.pt> - 1.053-1
4669580
- Update to 1.053.
4669580
8e88ff8
* Tue Mar 20 2007 Jose Pedro Oliveira <jpo at di.uminho.pt> - 1.05-1
8e88ff8
- Update to 1.05.
8e88ff8
6a77a18
* Thu Feb 15 2007 Jose Pedro Oliveira <jpo at di.uminho.pt> - 1.03-1
6a77a18
- Update to 1.03.
6a77a18
aaa4488
* Fri Jan 26 2007 Jose Pedro Oliveira <jpo at di.uminho.pt> - 1.01-2
aaa4488
- Bumping release (forgot to commit sources and .cvsignore changes).
aaa4488
623a133
* Fri Jan 26 2007 Jose Pedro Oliveira <jpo at di.uminho.pt> - 1.01-1
623a133
- Update to 1.01.
623a133
- New build requirement: perl(Test::Memory::Cycle).
623a133
0bd18b6
* Thu Jan 25 2007 Jose Pedro Oliveira <jpo at di.uminho.pt> - 0.23-2
0bd18b6
- perl(Set::Scalar) is no longer required.
0bd18b6
53a0ea7
* Wed Jan 24 2007 Jose Pedro Oliveira <jpo at di.uminho.pt> - 0.23-1
53a0ea7
- Update to 0.23.
53a0ea7
- New requirement: perl(B::Keywords).
53a0ea7
- Author tests coverage improved.
53a0ea7
14fc448
* Sun Dec 17 2006 Jose Pedro Oliveira <jpo at di.uminho.pt> - 0.22-2
14fc448
- Enabled author tests.
14fc448
- BR perl(HomeDir).
14fc448
fcf5720
* Sun Dec 17 2006 Jose Pedro Oliveira <jpo at di.uminho.pt> - 0.22-1
fcf5720
- Update to 0.22.
fcf5720
1665da3
* Sat Nov 11 2006 Jose Pedro Oliveira <jpo at di.uminho.pt> - 0.21-1
1665da3
- Update to 0.21.
1665da3
- New BR: perl(Set::Scalar).
1665da3
f0165e2
* Sat Sep 16 2006 Jose Pedro Oliveira <jpo at di.uminho.pt> - 0.2-1
f0165e2
- First build.