From f25d322066176bc81437eaa271ba78f8d43a2d8b Mon Sep 17 00:00:00 2001 From: Paul Howarth Date: Tue, 8 Oct 2019 19:03:29 +0100 Subject: [PATCH] Spec tidy-up - Use author-independent source URL - Enhance %description - Fix permissions verbosely - Make %files list more explicit --- perl-Test-MockModule.rpmlintrc | 3 +++ perl-Test-MockModule.spec | 40 ++++++++++++++++++++++++---------- 2 files changed, 31 insertions(+), 12 deletions(-) create mode 100644 perl-Test-MockModule.rpmlintrc diff --git a/perl-Test-MockModule.rpmlintrc b/perl-Test-MockModule.rpmlintrc new file mode 100644 index 0000000..c88ba27 --- /dev/null +++ b/perl-Test-MockModule.rpmlintrc @@ -0,0 +1,3 @@ +from Config import * + +addFilter("spelling-error %description -l en_US unmock -> ") diff --git a/perl-Test-MockModule.spec b/perl-Test-MockModule.spec index f11216b..5b2186a 100644 --- a/perl-Test-MockModule.spec +++ b/perl-Test-MockModule.spec @@ -7,12 +7,13 @@ Name: perl-Test-MockModule Version: 0.170.0 -Release: 4%{?dist} +Release: 5%{?dist} Summary: Override subroutines in a module for unit testing License: GPL+ or Artistic URL: https://metacpan.org/release/Test-MockModule -Source0: https://cpan.metacpan.org/authors/id/G/GF/GFRANKS/Test-MockModule-v%{version}.tar.gz +Source0: https://cpan.metacpan.org/modules/by-module/Test/Test-MockModule-v%{version}.tar.gz BuildArch: noarch +# Build: BuildRequires: coreutils BuildRequires: perl-generators BuildRequires: perl-interpreter @@ -26,39 +27,54 @@ BuildRequires: perl(SUPER) BuildRequires: perl(vars) # Tests: BuildRequires: perl(lib) -BuildRequires: perl(Test::More) -BuildRequires: perl(Test::Warnings) +BuildRequires: perl(parent) +BuildRequires: perl(Test::More) >= 0.88 +BuildRequires: perl(Test::Warnings) %if %{with perl_Test_MockModule_enables_optional_test} # Optional tests: BuildRequires: perl(Test::Pod) >= 1.00 BuildRequires: perl(Test::Pod::Coverage) >= 1.00 %endif -Requires: perl(:MODULE_COMPAT_%(eval "`%{__perl} -V:version`"; echo $version)) +# Dependencies: +Requires: perl(:MODULE_COMPAT_%(eval "`perl -V:version`"; echo $version)) %description -%{summary}. +Test::MockModule lets you temporarily redefine subroutines in other packages +for the purposes of unit testing. + +A Test::MockModule object is set up to mock subroutines for a given module. The +object remembers the original subroutine so it can easily be restored. This +happens automatically when all MockModule objects for the given module go out +of scope, or when you unmock() the subroutine. %prep %setup -q -n Test-MockModule-v%{version} %build -%{__perl} Build.PL installdirs=vendor +perl Build.PL installdirs=vendor ./Build %install -./Build install destdir=$RPM_BUILD_ROOT create_packlist=0 -chmod -R u+w $RPM_BUILD_ROOT/* +./Build install --destdir=%{buildroot} --create_packlist=0 +%{_fixperms} -c %{buildroot} %check ./Build test %files -%doc Changes README.md %license LICENSE -%{perl_vendorlib}/Test -%{_mandir}/man3/*.3* +%doc Changes README.md +%{perl_vendorlib}/Test/ +%{_mandir}/man3/Test::MockModule.3* %changelog +* Tue Oct 8 2019 Paul Howarth - 0.170.0-5 +- Spec tidy-up + - Use author-independent source URL + - Enhance %%description + - Fix permissions verbosely + - Make %%files list more explicit + * Fri Jul 26 2019 Fedora Release Engineering - 0.170.0-4 - Rebuilt for https://fedoraproject.org/wiki/Fedora_31_Mass_Rebuild