From c6c28f1091285aa29100a31c705bcf916a13452b Mon Sep 17 00:00:00 2001 From: Paul Howarth Date: Mon, 10 Apr 2017 10:38:46 +0100 Subject: [PATCH] Introduce build-condition for optional tests, and spec clean-up - Introduce build-condition for optional tests - Drop EL-5 support - Drop BuildRoot: and Group: tags - Drop explicit buildroot cleaning in %install section - Drop explicit %clean section - Use %license where possible - Simplify find command using -delete - Classify buildreqs by usage --- .rpmlint | 2 + perl-IPC-System-Simple.spec | 76 ++++++++++++++++++++++++++----------- 2 files changed, 55 insertions(+), 23 deletions(-) create mode 100644 .rpmlint diff --git a/.rpmlint b/.rpmlint new file mode 100644 index 0000000..76d706e --- /dev/null +++ b/.rpmlint @@ -0,0 +1,2 @@ +from Config import * +addFilter("spelling-error %description -l en_US qw -> "); diff --git a/perl-IPC-System-Simple.spec b/perl-IPC-System-Simple.spec index dda7f00..0952749 100644 --- a/perl-IPC-System-Simple.spec +++ b/perl-IPC-System-Simple.spec @@ -1,40 +1,54 @@ -Name: perl-IPC-System-Simple +# Run optional tests +%bcond_without perl_IPC_System_Simple_enables_optional_test + +Name: perl-IPC-System-Simple Version: 1.25 -Release: 11%{?dist} -License: GPL+ or Artistic -Group: Development/Libraries -Summary: Run commands simply, with detailed diagnostics +Release: 12%{?dist} +License: GPL+ or Artistic +Summary: Run commands simply, with detailed diagnostics URL: http://search.cpan.org/dist/IPC-System-Simple -Source0: http://search.cpan.org/CPAN/authors/id/P/PJ/PJF/IPC-System-Simple-%{version}.tar.gz -BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}-root-%(id -un) +Source0: http://search.cpan.org/CPAN/authors/id/P/PJ/PJF/IPC-System-Simple-%{version}.tar.gz BuildArch: noarch +# Module Build +BuildRequires: coreutils +BuildRequires: findutils +BuildRequires: make +BuildRequires: perl BuildRequires: perl-generators -BuildRequires: perl(BSD::Resource) +BuildRequires: perl(ExtUtils::MakeMaker) >= 6.30 +# Module Runtime BuildRequires: perl(Carp) BuildRequires: perl(Config) BuildRequires: perl(constant) BuildRequires: perl(Exporter) -BuildRequires: perl(ExtUtils::MakeMaker) >= 6.30 -BuildRequires: perl(File::Basename) -BuildRequires: perl(File::Spec) BuildRequires: perl(List::Util) -BuildRequires: perl(Pod::Coverage::TrustPod) BuildRequires: perl(POSIX) BuildRequires: perl(re) BuildRequires: perl(Scalar::Util) BuildRequires: perl(strict) +BuildRequires: perl(warnings) +# Test Suite +BuildRequires: perl(File::Basename) BuildRequires: perl(Test) BuildRequires: perl(Test::More) +%if %{with perl_IPC_System_Simple_enables_optional_test} +# Optional Tests +BuildRequires: perl(BSD::Resource) BuildRequires: perl(Test::NoWarnings) +# Author Tests %if !%{defined perl_bootstrap} # Break build-cycle: perl-IPC-System-Simple → perl-Test-Perl-Critic # → perl-Perl-Critic → perl-PPI → perl-IO-All → perl-File-MimeInfo # → perl-File-BaseDir → perl-IPC-System-Simple +BuildRequires: perl(English) BuildRequires: perl(Test::Perl::Critic) %endif +# Release Tests (wants Test::Pod 1.41 but EL-6 doesn't have it) +BuildRequires: perl(Pod::Coverage::TrustPod) BuildRequires: perl(Test::Pod) BuildRequires: perl(Test::Pod::Coverage) >= 1.08 -BuildRequires: perl(warnings) +%endif +# Dependencies Requires: perl(:MODULE_COMPAT_%(eval "`perl -V:version`"; echo $version)) %description @@ -43,7 +57,7 @@ was successful is _hard_. Let's face it, '$?' isn't the nicest variable in the world to play with, and even if you _do_ check it, producing a well-formatted error string takes a lot of work. 'IPC::System::Simple' takes the hard work out of calling external commands. In fact, if you -want to be really lazy, you can just write: +want to be really lazy, you can just write: use IPC::System::Simple qw(system); @@ -61,23 +75,39 @@ 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 {} \; -%{_fixperms} %{buildroot} +find %{buildroot} -type f -name .packlist -delete +%{_fixperms} -c %{buildroot} %check -make test TEST_AUTHOR=1 AUTHOR_TESTING=1 RELEASE_TESTING=1 - -%clean -rm -rf %{buildroot} +make test \ +%if %{with perl_IPC_System_Simple_enables_optional_test} + TEST_AUTHOR=1 \ + %{!?perl_bootstrap:AUTHOR_TESTING=1} \ + RELEASE_TESTING=1 +%endif %files -%doc Changes LICENSE README examples/ +%if 0%{?_licensedir:1} +%license LICENSE +%else +%doc LICENSE +%endif +%doc Changes README examples/ %{perl_vendorlib}/IPC/ -%{_mandir}/man3/IPC::System::Simple.3pm* +%{_mandir}/man3/IPC::System::Simple.3* %changelog +* Mon Apr 10 2017 Paul Howarth - 1.25-12 +- Drop EL-5 support + - Drop BuildRoot: and Group: tags + - Drop explicit buildroot cleaning in %%install section + - Drop explicit %%clean section +- Introduce build-condition for optional tests +- Use %%license where possible +- Simplify find command using -delete +- Classify buildreqs by usage + * Sat Feb 11 2017 Fedora Release Engineering - 1.25-11 - Rebuilt for https://fedoraproject.org/wiki/Fedora_26_Mass_Rebuild