Spec tidy-up

- Use author-independent source URL
- Drop support for building with Test::More < 0.88
- Specify all build dependencies
- Drop redundant buildroot cleaning in %install section
- Simplify find command using -delete
- Fix permissions verbosely
- Use %license where possible
This commit is contained in:
Paul Howarth 2020-03-10 15:12:29 +00:00
parent 95aaab65fc
commit 766b786d3a
2 changed files with 27 additions and 144 deletions

View File

@ -1,128 +0,0 @@
--- t/also.t
+++ t/also.t
@@ -1,7 +1,7 @@
#!/usr/bin/env perl
use strict;
use warnings;
-use Test::More;
+use Test::More tests => 2;
use Test::Fatal;
use lib 't/lib/also';
@@ -29,4 +29,3 @@ use lib 't/lib/also';
);
}
-done_testing;
--- t/basic.t
+++ t/basic.t
@@ -1,7 +1,7 @@
#!/usr/bin/env perl
use strict;
use warnings;
-use Test::More;
+use Test::More tests => 4;
use lib 't/lib/basic';
{
@@ -44,4 +44,3 @@ use lib 't/lib/basic';
);
}
-done_testing;
--- t/conflicts.t
+++ t/conflicts.t
@@ -2,7 +2,7 @@
use strict;
use warnings;
-use Test::More;
+use Test::More tests => 12;
use Test::Fatal;
use lib 't/lib/conflicts';
@@ -109,4 +109,3 @@ use lib 't/lib/conflicts';
;
}
-done_testing;
--- t/dist.t
+++ t/dist.t
@@ -1,7 +1,7 @@
#!/usr/bin/env perl
use strict;
use warnings;
-use Test::More;
+use Test::More tests => 12;
use Test::Fatal;
use lib 't/lib/dist';
@@ -73,4 +73,3 @@ use lib 't/lib/dist';
is(Bar::Conflicts::Bad->dist, 'Bar', "correct dist");
}
-done_testing;
--- t/merge.t
+++ t/merge.t
@@ -1,7 +1,7 @@
#!/usr/bin/env perl
use strict;
use warnings;
-use Test::More;
+use Test::More tests => 1;
use lib 't/lib/merge';
{
@@ -18,4 +18,3 @@ use lib 't/lib/merge';
);
}
-done_testing;
--- t/runtime.t
+++ t/runtime.t
@@ -1,7 +1,7 @@
#!/usr/bin/env perl
use strict;
use warnings;
-use Test::More;
+use Test::More tests => 7;
use lib 't/lib/runtime';
use Module::Runtime 'require_module';
@@ -46,4 +46,3 @@ is(scalar(grep { ref($_) eq 'ARRAY' && @
1,
"only installed one \@INC hook");
-done_testing;
--- t/warn.t
+++ t/warn.t
@@ -1,7 +1,7 @@
#!/usr/bin/env perl
use strict;
use warnings;
-use Test::More;
+use Test::More tests => 1;
use lib 't/lib/warn';
{
@@ -13,4 +13,3 @@ use lib 't/lib/warn';
is($warning, '', "we don't see warnings from loaded modules");
}
-done_testing;
--- xt/release/no-tabs.t
+++ xt/release/no-tabs.t
@@ -3,7 +3,7 @@ use warnings;
# this test was generated with Dist::Zilla::Plugin::NoTabsTests 0.06
-use Test::More 0.88;
+use Test::More tests => 1;
use Test::NoTabs;
my @files = (
@@ -11,4 +11,3 @@ my @files = (
);
notabs_ok($_) foreach @files;
-done_testing;

View File

@ -1,5 +1,3 @@
# We need to patch the test suite if we have an old version of Test::More
%global old_test_more %(perl -MTest::More -e 'print (($Test::More::VERSION < 0.88) ? 1 : 0);' 2>/dev/null || echo 0)
# Run extra test # Run extra test
%if 0%{?fedora} %if 0%{?fedora}
%bcond_without perl_Dist_CheckConflicts_enables_extra_test %bcond_without perl_Dist_CheckConflicts_enables_extra_test
@ -9,15 +7,18 @@
Name: perl-Dist-CheckConflicts Name: perl-Dist-CheckConflicts
Version: 0.11 Version: 0.11
Release: 17%{?dist} Release: 18%{?dist}
Summary: Declare version conflicts for your dist Summary: Declare version conflicts for your dist
License: GPL+ or Artistic License: GPL+ or Artistic
URL: https://metacpan.org/release/Dist-CheckConflicts URL: https://metacpan.org/release/Dist-CheckConflicts
Source0: https://cpan.metacpan.org/authors/id/D/DO/DOY/Dist-CheckConflicts-%{version}.tar.gz Source0: https://cpan.metacpan.org/modules/by-module/Dist/Dist-CheckConflicts-%{version}.tar.gz
Patch0: Dist-CheckConflicts-0.11-old-Test::More.patch
BuildArch: noarch BuildArch: noarch
# Module Build # Module Build
BuildRequires: coreutils
BuildRequires: findutils
BuildRequires: make
BuildRequires: perl-generators BuildRequires: perl-generators
BuildRequires: perl-interpreter
BuildRequires: perl(ExtUtils::MakeMaker) >= 6.30 BuildRequires: perl(ExtUtils::MakeMaker) >= 6.30
# Module # Module
BuildRequires: perl(base) BuildRequires: perl(base)
@ -27,12 +28,13 @@ BuildRequires: perl(Module::Runtime) >= 0.009
BuildRequires: perl(strict) BuildRequires: perl(strict)
BuildRequires: perl(warnings) BuildRequires: perl(warnings)
# Test Suite # Test Suite
BuildRequires: perl(blib)
BuildRequires: perl(File::Spec) BuildRequires: perl(File::Spec)
BuildRequires: perl(IO::Handle) BuildRequires: perl(IO::Handle)
BuildRequires: perl(IPC::Open3) BuildRequires: perl(IPC::Open3)
BuildRequires: perl(lib) BuildRequires: perl(lib)
BuildRequires: perl(Test::Fatal) BuildRequires: perl(Test::Fatal)
BuildRequires: perl(Test::More) >= 0.47 BuildRequires: perl(Test::More) >= 0.88
# Extra Tests # Extra Tests
%if %{with perl_Dist_CheckConflicts_enables_extra_test} %if %{with perl_Dist_CheckConflicts_enables_extra_test}
BuildRequires: perl(Pod::Coverage::TrustPod) BuildRequires: perl(Pod::Coverage::TrustPod)
@ -65,20 +67,14 @@ this manually.
%prep %prep
%setup -q -n Dist-CheckConflicts-%{version} %setup -q -n Dist-CheckConflicts-%{version}
# Test suite needs patching if we have Test::More < 0.88
%if %{old_test_more}
%patch0
%endif
%build %build
perl Makefile.PL INSTALLDIRS=vendor perl Makefile.PL INSTALLDIRS=vendor
make %{?_smp_mflags} make %{?_smp_mflags}
%install %install
rm -rf %{buildroot}
make pure_install DESTDIR=%{buildroot} make pure_install DESTDIR=%{buildroot}
find %{buildroot} -type f -name .packlist -exec rm -f {} \; find %{buildroot} -type f -name .packlist -delete
%{_fixperms} %{buildroot} %{_fixperms} -c %{buildroot}
%check %check
make test make test
@ -87,11 +83,26 @@ make test TEST_FILES="$(echo $(find xt/ -name '*.t'))"
%endif %endif
%files %files
%doc Changes LICENSE README %if 0%{?_licensedir:1}
%license LICENSE
%else
%doc LICENSE
%endif
%doc Changes README
%{perl_vendorlib}/Dist/ %{perl_vendorlib}/Dist/
%{_mandir}/man3/Dist::CheckConflicts.3pm* %{_mandir}/man3/Dist::CheckConflicts.3*
%changelog %changelog
* Tue Mar 10 2020 Paul Howarth <paul@city-fan.org> - 0.11-18
- Spec tidy-up
- Use author-independent source URL
- Drop support for building with Test::More < 0.88
- Specify all build dependencies
- Drop redundant buildroot cleaning in %%install section
- Simplify find command using -delete
- Fix permissions verbosely
- Use %%license where possible
* Wed Jan 29 2020 Fedora Release Engineering <releng@fedoraproject.org> - 0.11-17 * Wed Jan 29 2020 Fedora Release Engineering <releng@fedoraproject.org> - 0.11-17
- Rebuilt for https://fedoraproject.org/wiki/Fedora_32_Mass_Rebuild - Rebuilt for https://fedoraproject.org/wiki/Fedora_32_Mass_Rebuild