157 lines
5.4 KiB
RPMSpec
157 lines
5.4 KiB
RPMSpec
%bcond_with perl_Perl_Critic_enables_extra_test
|
|
|
|
Name: perl-Perl-Critic
|
|
Version: 1.140
|
|
Release: 1
|
|
Summary: Critique Perl source code for best-practices
|
|
License: GPL+ or Artistic
|
|
URL: https://metacpan.org/release/Perl-Critic
|
|
Source0: https://cpan.metacpan.org/modules/by-module/Perl/Perl-Critic-%{version}.tar.gz
|
|
Patch0: 0001-Change-default-spell-check-tool-from-aspell-to-hunsp.patch
|
|
Patch3: Perl-Critic-1.136-ppidump-shellbang.patch
|
|
BuildArch: noarch
|
|
|
|
# Build process
|
|
BuildRequires: coreutils
|
|
BuildRequires: findutils
|
|
BuildRequires: perl-generators
|
|
BuildRequires: perl-interpreter
|
|
BuildRequires: perl(lib)
|
|
BuildRequires: perl(Module::Build) >= 0.42
|
|
BuildRequires: perl(Task::Weaken)
|
|
# Module requirements
|
|
BuildRequires: hunspell >= 1.2.12
|
|
BuildRequires: hunspell-en
|
|
BuildRequires: perl(B::Keywords) >= 1.05
|
|
BuildRequires: perl(base)
|
|
BuildRequires: perl(Carp)
|
|
BuildRequires: perl(Config::Tiny) >= 2
|
|
BuildRequires: perl(English)
|
|
BuildRequires: perl(Exception::Class) >= 1.23
|
|
BuildRequires: perl(Exporter) >= 5.58
|
|
BuildRequires: perl(File::Find)
|
|
BuildRequires: perl(File::Path)
|
|
BuildRequires: perl(File::Spec)
|
|
BuildRequires: perl(File::Spec::Unix)
|
|
BuildRequires: perl(File::Temp)
|
|
BuildRequires: perl(File::Which)
|
|
BuildRequires: perl(Getopt::Long)
|
|
BuildRequires: perl(IO::String)
|
|
BuildRequires: perl(List::MoreUtils) >= 0.19
|
|
BuildRequires: perl(List::Util)
|
|
BuildRequires: perl(Module::Pluggable) >= 3.1
|
|
BuildRequires: perl(Perl::Tidy)
|
|
BuildRequires: perl(Pod::Parser)
|
|
BuildRequires: perl(Pod::PlainText)
|
|
BuildRequires: perl(Pod::Select)
|
|
BuildRequires: perl(Pod::Spell) >= 1
|
|
BuildRequires: perl(Pod::Usage)
|
|
BuildRequires: perl(PPI) >= 1.265
|
|
BuildRequires: perl(PPIx::QuoteLike)
|
|
BuildRequires: perl(PPIx::Regexp) >= 0.010
|
|
BuildRequires: perl(PPIx::Regexp::Util) >= 0.068
|
|
BuildRequires: perl(PPIx::Utilities::Node)
|
|
BuildRequires: perl(PPIx::Utilities::Statement) >= 1.001
|
|
BuildRequires: perl(Readonly) >= 2
|
|
BuildRequires: perl(Scalar::Util)
|
|
BuildRequires: perl(strict)
|
|
BuildRequires: perl(String::Format) >= 1.18
|
|
BuildRequires: perl(Term::ANSIColor) >= 2.02
|
|
BuildRequires: perl(Test::Builder) >= 0.92
|
|
BuildRequires: perl(Text::ParseWords) >= 3
|
|
BuildRequires: perl(version) >= 0.77
|
|
BuildRequires: perl(warnings)
|
|
# Main test suite
|
|
BuildRequires: glibc-langpack-en
|
|
BuildRequires: perl(Fatal)
|
|
BuildRequires: perl(File::Spec::Functions)
|
|
BuildRequires: perl(Test::Deep)
|
|
BuildRequires: perl(Test::Memory::Cycle)
|
|
BuildRequires: perl(Test::More)
|
|
# Optional test suite
|
|
%if %{with perl_Perl_Critic_enables_extra_test}
|
|
BuildRequires: perl(Devel::EnforceEncapsulation)
|
|
BuildRequires: perl(Perl::Critic::Policy::Editor::RequireEmacsFileVariables)
|
|
BuildRequires: perl(Perl::Critic::Policy::ErrorHandling::RequireUseOfExceptions)
|
|
BuildRequires: perl(Perl::Critic::Policy::Miscellanea::RequireRcsKeywords)
|
|
BuildRequires: perl(Test::Kwalitee) >= 1.15
|
|
BuildRequires: perl(Test::Perl::Critic)
|
|
BuildRequires: perl(Test::Pod) >= 1.00
|
|
BuildRequires: perl(Test::Pod::Coverage) >= 1.04
|
|
BuildRequires: perl(Test::Without::Module)
|
|
%endif
|
|
|
|
# Optional/not automatically detected runtime dependencies
|
|
Requires: perl(:MODULE_COMPAT_%(eval "`perl -V:version`"; echo $version))
|
|
Requires: hunspell >= 1.2.12
|
|
Requires: perl(File::Which)
|
|
Requires: perl(Module::Pluggable) >= 3.1
|
|
Requires: perl(Pod::Parser)
|
|
Requires: perl(PPI) >= 1.265
|
|
Requires: perl(Term::ANSIColor) >= 2.02
|
|
|
|
%description
|
|
Perl::Critic is an extensible framework for creating and applying coding
|
|
standards to Perl source code. Essentially, it is a static source code
|
|
analysis engine. Perl::Critic is distributed with a number of
|
|
Perl::Critic::Policy modules that attempt to enforce various coding
|
|
guidelines. Most Policy modules are based on Damian Conway's book Perl
|
|
Best Practices. However, Perl::Critic is not limited to PBP and will
|
|
even support Policies that contradict Conway. You can enable, disable,
|
|
and customize those Polices through the Perl::Critic interface. You can
|
|
also create new Policy modules that suit your own tastes.
|
|
|
|
%package -n perl-Test-Perl-Critic-Policy
|
|
Summary: A framework for testing your custom Policies
|
|
License: GPL+ or Artistic
|
|
Requires: perl(Test::Builder) >= 0.92
|
|
|
|
%description -n perl-Test-Perl-Critic-Policy
|
|
This module provides a framework for function-testing your custom
|
|
Perl::Critic::Policy modules. Policy testing usually involves feeding it a
|
|
string of Perl code and checking its behavior. In the old days, those strings
|
|
of Perl code were mixed directly in the test script. That sucked.
|
|
|
|
%prep
|
|
%setup -q -n Perl-Critic-%{version}
|
|
|
|
# Switch spell checker tool from aspell to hunspell
|
|
%patch0 -p1
|
|
|
|
# Fix shellbang in ppidump tool
|
|
%patch3
|
|
|
|
# Drop exec bits from samples/docs to avoid dependency bloat
|
|
find tools examples -type f -exec chmod -c -x {} ';'
|
|
|
|
%build
|
|
perl Build.PL --installdirs=vendor
|
|
./Build
|
|
|
|
%install
|
|
./Build install --destdir=%{buildroot} --create_packlist=0
|
|
%{_fixperms} -c %{buildroot}
|
|
|
|
%check
|
|
%if %{with perl_Perl_Critic_enables_extra_test}
|
|
LC_ALL=en_US ./Build authortest
|
|
%else
|
|
LC_ALL=en_US ./Build test
|
|
%endif
|
|
|
|
%files
|
|
%license LICENSE
|
|
%doc Changes CONTRIBUTING.md README TODO.pod examples/ extras/ tools/
|
|
%{_bindir}/perlcritic
|
|
%{perl_vendorlib}/Perl/
|
|
%{_mandir}/man1/perlcritic.1*
|
|
%{_mandir}/man3/Perl::Critic*.3*
|
|
|
|
%files -n perl-Test-Perl-Critic-Policy
|
|
%{perl_vendorlib}/Test/
|
|
%{_mandir}/man3/Test::Perl::Critic::Policy.3*
|
|
|
|
%changelog
|
|
* Wed Jul 06 2022 misaka00251 <misaka00251@misakanet.cn> - 1.140-1
|
|
- Init package (Thanks to fedora team)
|