# Provides/Requires filtering is different from rpm 4.9 onwards
%global rpm49 %(rpm --version | perl -p -e 's/^.* (\\d+)\\.(\\d+).*/sprintf("%d.%03d",$1,$2) ge 4.009 ? 1 : 0/e')
Name: perl-Module-Extract-VERSION
Version: 1.01
Release: 14%{?dist}
Summary: Extract a module version without running code
License: GPL+ or Artistic
Group: Development/Libraries
URL: http://search.cpan.org/dist/Module-Extract-VERSION/
Source0: http://search.cpan.org/CPAN/authors/id/B/BD/BDFOY/Module-Extract-VERSION-%{version}.tar.gz
BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}-root-%(id -nu)
BuildArch: noarch
# Module Build
BuildRequires: coreutils
BuildRequires: findutils
BuildRequires: make
BuildRequires: perl
BuildRequires: perl(ExtUtils::MakeMaker)
# Module Runtime
BuildRequires: perl(Carp)
BuildRequires: perl(strict)
BuildRequires: perl(subs)
BuildRequires: perl(vars)
BuildRequires: perl(warnings)
# Test Suite
BuildRequires: perl(File::Spec)
BuildRequires: perl(Test::More)
# Optional Tests
BuildRequires: perl(Test::Manifest) >= 1.21
BuildRequires: perl(Test::Pod) >= 1.00
BuildRequires: perl(Test::Pod::Coverage) >= 1.00
# Test::Prereq not used in presence of Test::Manifest
# Runtime
Requires: perl(:MODULE_COMPAT_%(eval "`perl -V:version`"; echo $version))
# Filter bogus provide for perl(ExtUtils::MakeMaker::_version) (rpm 4.9 onwards)
%global __provides_exclude ^perl\\(ExtUtils::MakeMaker::_version\\)
%description
This module lets you pull out of module source code the version number for the
module. It assumes that there is only one $VERSION in the file.
%prep
%setup -q -n Module-Extract-VERSION-%{version}
# Filter bogus provide for perl(ExtUtils::MakeMaker::_version) (prior to rpm 4.9)
%if ! %{rpm49}
%global provfilt /bin/sh -c "%{__perl_provides} | grep -Fvx 'perl(ExtUtils::MakeMaker::_version)'"
%global __perl_provides %{provfilt}
%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 {} \;
%{_fixperms} %{buildroot}
%check
make test
%clean
rm -rf %{buildroot}
%files
%if 0%{?_licensedir:1}
%license LICENSE
%else
%doc LICENSE
%endif
%doc Changes README
%{perl_vendorlib}/Module/
%{_mandir}/man3/Module::Extract::VERSION.3*
%changelog
* Sun Jan 3 2016 Paul Howarth <paul@city-fan.org> - 1.01-14
- Get rid of %%define
- Drop %%defattr, redundant since rpm 4.4
- Use %%license where possible
- Classify buildreqs by usage
- Don't need to remove empty directories from the buildroot
- Use DESTDIR rather than PERL_INSTALL_ROOT
* Thu Jun 18 2015 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 1.01-13
- Rebuilt for https://fedoraproject.org/wiki/Fedora_23_Mass_Rebuild
* Fri Jun 12 2015 Jitka Plesnikova <jplesnik@redhat.com> - 1.01-12
- Perl 5.22 rebuild
* Thu Aug 28 2014 Jitka Plesnikova <jplesnik@redhat.com> - 1.01-11
- Perl 5.20 rebuild
* Sat Jun 07 2014 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 1.01-10
- Rebuilt for https://fedoraproject.org/wiki/Fedora_21_Mass_Rebuild
* Sat Aug 03 2013 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 1.01-9
- Rebuilt for https://fedoraproject.org/wiki/Fedora_20_Mass_Rebuild
* Sun Jul 21 2013 Petr Pisar <ppisar@redhat.com> - 1.01-8
- Perl 5.18 rebuild
* Thu Feb 14 2013 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 1.01-7
- Rebuilt for https://fedoraproject.org/wiki/Fedora_19_Mass_Rebuild
* Fri Jul 20 2012 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 1.01-6
- Rebuilt for https://fedoraproject.org/wiki/Fedora_18_Mass_Rebuild
* Wed Jun 13 2012 Petr Pisar <ppisar@redhat.com> - 1.01-5
- Perl 5.16 rebuild
* Thu Jan 12 2012 Paul Howarth <paul@city-fan.org> - 1.01-4
- BR: perl(Carp)
* Fri Aug 12 2011 Paul Howarth <paul@city-fan.org> - 1.01-3
- Filter bogus provide for perl(ExtUtils::MakeMaker::_version) (#728286)
* Thu Aug 4 2011 Paul Howarth <paul@city-fan.org> - 1.01-2
- Sanitize for Fedora submission
* Wed Aug 3 2011 Paul Howarth <paul@city-fan.org> - 1.01-1
- Initial RPM version