# Test::Kwalitee and Test::Requires not available in EPEL < 6
%global extra_tests_available %(expr 0%{?fedora} + 0%{?rhel} '>' 5)

Name:		perl-Package-DeprecationManager
Version:	0.11
Release:	3%{?dist}
Summary:	Manage deprecation warnings for your distribution
Group:		Development/Libraries
License:	Artistic 2.0
URL:		http://search.cpan.org/dist/Package-DeprecationManager/
Source0:	http://search.cpan.org/CPAN/authors/id/D/DR/DROLSKY/Package-DeprecationManager-%{version}.tar.gz
Patch0:		Package-DeprecationManager-0.11-old-EU::MM.patch
Patch1:		Package-DeprecationManager-0.11-old-Test::More.patch
Patch2:		Package-DeprecationManager-0.10-no-Test::Requires.patch
BuildRoot:	%{_tmppath}/%{name}-%{version}-%{release}-root-%(id -nu)
BuildArch:	noarch
BuildRequires:	perl(Carp)
BuildRequires:	perl(ExtUtils::MakeMaker)
BuildRequires:	perl(List::MoreUtils)
BuildRequires:	perl(Params::Util)
BuildRequires:	perl(Sub::Install)
BuildRequires:	perl(Test::EOL)
BuildRequires:	perl(Test::Fatal)
BuildRequires:	perl(Test::More)
BuildRequires:	perl(Test::NoTabs)
BuildRequires:	perl(Test::Output)
BuildRequires:	perl(Test::Pod)
BuildRequires:	perl(Test::Pod::Coverage)
BuildRequires:	perl(Pod::Coverage::TrustPod)
BuildRequires:	perl(Test::CPAN::Changes)
%if %{extra_tests_available}
BuildRequires:	perl(Test::Kwalitee)
BuildRequires:	perl(Test::Requires)
%endif
Requires:	perl(:MODULE_COMPAT_%(eval "`perl -V:version`"; echo $version))

%description
This module allows you to manage a set of deprecations for one or more modules.

When you import Package::DeprecationManager, you must provide a set of
-deprecations as a hash ref. The keys are "feature" names, and the values are
the version when that feature was deprecated.

%prep
%setup -q -n Package-DeprecationManager-%{version}

# If we don't have Test::Requires, we need to patch it out of the test suite
%if ! %{extra_tests_available}
%patch2 -p1
%endif

%build
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 {} \;
find %{buildroot} -depth -type d -exec rmdir {} \; 2>/dev/null
%{_fixperms} %{buildroot}

%check
make test RELEASE_TESTING=1

%clean
rm -rf %{buildroot}

%files
%defattr(-,root,root,-)
%doc Changes LICENSE README
%{perl_vendorlib}/Package/
%{_mandir}/man3/Package::DeprecationManager.3pm*

%changelog
* Mon Mar 05 2012 MATSUBAYASHI Kohji <shaolin@vinelinux.org> - 0.11-1
- initial build for Vine Linux

* Thu Jan 12 2012 Paul Howarth <paul@city-fan.org> - 0.11-3
- Fedora 17 mass rebuild

* Tue Jul 19 2011 Petr Sabata <contyk@redhat.com> - 0.11-2
- Perl mass rebuild

* Mon Jun 20 2011 Paul Howarth <paul@city-fan.org> - 0.11-1
- Update to 0.11:
  - Allow an empty hash for the -deprecations parameter
- BR: perl(ExtUtils::MakeMaker)
- BR: perl(Test::CPAN::Changes)
- BR: perl(Pod::Coverage::TrustPod) unconditionally
- Update patches for old ExtUtils::MakeMaker and Test::More compatibility

* Tue Feb 08 2011 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 0.10-3
- Rebuilt for https://fedoraproject.org/wiki/Fedora_15_Mass_Rebuild

* Sat Jan 08 2011 Paul Howarth <paul@city-fan.org> - 0.10-2
- Update patches for old Test::More and no Test::Requires
- perl(Pod::Coverage::TrustPod) now available everywhere except EPEL-4

* Sat Jan 08 2011 Iain Arnell <iarnell@gmail.com> - 0.10-1
- Update to 0.10:
  - Test suite uses Test::Fatal instead of Test::Exception

* Mon Oct 18 2010 Paul Howarth <paul@city-fan.org> - 0.09-1
- Update to 0.09:
  - Added a compilation test

* Fri Oct 15 2010 Paul Howarth <paul@city-fan.org> - 0.08-1
- Update to 0.08:
  - The use of regular expressions in ignores didn't really work in 0.06
  - Added missing deps on List::MoreUtils and Test::Requires
  - Replaced Test::Warn with Test::Output in the tests
  - Made the tests actually test what they should be testing
- BR: Test::Output rather than Test::Warn
- Update patches

* Fri Oct 15 2010 Paul Howarth <paul@city-fan.org> - 0.06-1
- Update to 0.06:
  - Removed hard dep on Test::Warn for the benefit of Moose
  - Fixed what looked like a bug in -ignore handling
  - The -ignore parameter now accepts regexes as well as package names
- Update compatibility patches
- BR: List::MoreUtils
- BR: Test::Requires where possible, patch it out elsewhere

* Tue Jul 27 2010 Paul Howarth <paul@city-fan.org> - 0.04-2
- Clean up for Fedora submission

* Mon Jul 26 2010 Paul Howarth <paul@city-fan.org> - 0.04-1
- Initial RPM version
