@ -1,45 +1,71 @@
# We need to patch the test suite if we have an old version of Test::More
# 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)
%global old_test_more %(perl -MTest::More -e 'print (($Test::More::VERSION < 0.96 ) ? 1 : 0);' 2>/dev/null || echo 0)
# Test::CPAN::Changes isn't available in EPEL-6 either, due to requirement of perl(version) ≥ 0.79
# CPAN::Meta isn't available in EPEL < 7 due to requirement of perl(version) ≥ 0.88
%global cpan_changes_available %(expr 0%{?fedora} + 0%{?rhel} '>' 6)
%global cpan_meta_available %(expr 0%{?fedora} + 0%{?rhel} '>' 6)
# TODO: BR: perl(Test::Code::TidyAll) >= 0.24 when available
# NOTE: BR: perl(Test::Pod::No404s) not included as it requires network access
Name: perl-Package-DeprecationManager
Name: perl-Package-DeprecationManager
Version: 0.13
Version: 0.14
Release: 11 %{?dist}
Release: 1%{?dist}
Summary: Manage deprecation warnings for your distribution
Summary: Manage deprecation warnings for your distribution
Group: Development/Libraries
Group: Development/Libraries
License: Artistic 2.0
License: Artistic 2.0
URL: http://search.cpan.org/dist/Package-DeprecationManager/
URL: http://search.cpan.org/dist/Package-DeprecationManager/
Source0: http://search.cpan.org/CPAN/authors/id/D/DR/DROLSKY/Package-DeprecationManager-%{version}.tar.gz
Source0: http://search.cpan.org/CPAN/authors/id/D/DR/DROLSKY/Package-DeprecationManager-%{version}.tar.gz
Patch1: Package-DeprecationManager-0.12-old-Test::More.patch
Patch0: Package-DeprecationManager-0.14-no-Test::Code::TidyAll.patch
Patch3: Package-DeprecationManager-0.12-stopwords.patch
Patch1: Package-DeprecationManager-0.14-old-List::Util.patch
Patch2: Package-DeprecationManager-0.14-old-Test::More.patch
Patch3: Package-DeprecationManager-0.14-stopwords.patch
BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}-root-%(id -nu)
BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}-root-%(id -nu)
BuildArch: noarch
BuildArch: noarch
BuildRequires: perl(Carp)
# Module Build
BuildRequires: perl
BuildRequires: perl(ExtUtils::MakeMaker)
BuildRequires: perl(ExtUtils::MakeMaker)
# Module Runtime
BuildRequires: perl(Carp)
%if 0%{?fedora} < 21 || 0%{?rhel} < 8
BuildRequires: perl(List::MoreUtils)
BuildRequires: perl(List::MoreUtils)
%else
BuildRequires: perl(List::Util)
%endif
BuildRequires: perl(Params::Util)
BuildRequires: perl(Params::Util)
BuildRequires: perl(Pod::Coverage::TrustPod)
BuildRequires: perl(strict )
BuildRequires: perl(Sub::Install)
BuildRequires: perl(Sub::Install)
%if %{cpan_changes_available}
BuildRequires: perl(warnings)
BuildRequires: perl(Test::CPAN::Changes)
# Test Suite
%endif
BuildRequires: perl(File::Spec)
BuildRequires: perl(Test::EOL)
BuildRequires: perl(IO::Handle)
BuildRequires: perl(IPC::Open3)
BuildRequires: perl(Test::Fatal)
BuildRequires: perl(Test::Fatal)
BuildRequires: perl(Test::More)
BuildRequires: perl(Test::More)
BuildRequires: perl(Test::NoTabs)
BuildRequires: perl(Test::Output)
BuildRequires: perl(Test::Pod)
BuildRequires: perl(Test::Pod::Coverage)
BuildRequires: perl(Test::Requires)
BuildRequires: perl(Test::Requires)
BuildRequires: perl(Test::Spelling)
# Optional Tests
# Can't use aspell-en from EPEL-7 as BR: for RHEL-7 package so skip the spell
%if %{cpan_meta_available}
# check test there; test would fail rather than skip without Test::Spelling so
BuildRequires: perl(CPAN::Meta) >= 2.120900
# we need to keep that as a buildreq
BuildRequires: perl(CPAN::Meta::Prereqs)
%if 0%{?rhel} < 7
%endif
BuildRequires: aspell-en
%if 0%{?fedora} || 0%{?rhel} > 6
BuildRequires: perl(Test::Output) >= 0.16
%endif
%endif
%if 0%{!?perl_bootstrap:1} && ! 0%{?rhel}
# Author Tests
BuildRequires: perl(Pod::Wordlist)
BuildRequires: perl(Test::EOL)
BuildRequires: perl(Test::NoTabs)
BuildRequires: perl(Test::Spelling), hunspell-en
# Release Tests
BuildRequires: perl(Pod::Coverage::TrustPod)
BuildRequires: perl(Test::CPAN::Changes) >= 0.19
BuildRequires: perl(Test::Pod) >= 1.41
BuildRequires: perl(Test::Pod::Coverage) >= 1.08
BuildRequires: perl(Test::Pod::LinkCheck)
BuildRequires: perl(Test::Portability::Files)
BuildRequires: perl(Test::Version) >= 1.002
%endif
# Runtime
Requires: perl(:MODULE_COMPAT_%(eval "`perl -V:version`"; echo $version))
Requires: perl(:MODULE_COMPAT_%(eval "`perl -V:version`"; echo $version))
%description
%description
@ -52,12 +78,20 @@ the version when that feature was deprecated.
%prep
%prep
%setup -q -n Package-DeprecationManager-%{version}
%setup -q -n Package-DeprecationManager-%{version}
# Fix tests for Test::More prior to 0.88
# Test::Code::TidyAll not yet available in Fedora
%if %{old_test_more}
%patch0
# We need to patch the module if we have an old version of List::Util
%if 0%{?fedora} < 21 || 0%{?rhel} < 8
%patch1
%patch1
%endif
%endif
# "deprecations" not a common dictionary word
# Fix tests for Test::More prior to 0.96
%if %{old_test_more}
%patch2
%endif
# "PayPal" not a common dictionary word
%patch3
%patch3
%build
%build
@ -71,17 +105,37 @@ find %{buildroot} -type f -name .packlist -exec rm -f {} \;
%{_fixperms} %{buildroot}
%{_fixperms} %{buildroot}
%check
%check
make test RELEASE_TESTING=1
%if 0%{!?perl_bootstrap:1} && ! 0%{?rhel}
make test AUTHOR_TESTING=1 RELEASE_TESTING=1
%else
make test
%endif
%clean
%clean
rm -rf %{buildroot}
rm -rf %{buildroot}
%files
%files
%doc Changes LICENSE README
%if 0%{?_licensedir:1}
%license LICENSE
%else
%doc LICENSE
%endif
%doc Changes README.md
%{perl_vendorlib}/Package/
%{perl_vendorlib}/Package/
%{_mandir}/man3/Package::DeprecationManager.3pm*
%{_mandir}/man3/Package::DeprecationManager.3*
%changelog
%changelog
* Tue Apr 21 2015 Paul Howarth <paul@city-fan.org> - 0.14-1
- Update to 0.14
- Use any() from List::Util 1.33+ instead of List::MoreUtils
- Add patch to use List::MoreUtils::any() on old distributions where we don't
have List::Util 1.33+
- Add patch to support building without Test::Code::TidyAll
- Classify buildreqs by usage
- Update patches as needed
- Use %%license where possible
- Don't try to do the author or release tests for RHEL builds
* Fri Aug 29 2014 Jitka Plesnikova <jplesnik@redhat.com> - 0.13-11
* Fri Aug 29 2014 Jitka Plesnikova <jplesnik@redhat.com> - 0.13-11
- Perl 5.20 rebuild
- Perl 5.20 rebuild