diff --git a/perl-Mail-Mbox-MessageParser.spec b/perl-Mail-Mbox-MessageParser.spec index fd670f8..54aac37 100644 --- a/perl-Mail-Mbox-MessageParser.spec +++ b/perl-Mail-Mbox-MessageParser.spec @@ -1,11 +1,12 @@ Summary: A fast and simple mbox folder reader Name: perl-Mail-Mbox-MessageParser Version: 1.5002 -Release: 2%{?dist} +Release: 3%{?dist} License: GPL+ Group: Development/Libraries Url: http://search.cpan.org/dist/Mail-Mbox-MessageParser/ Source0: http://search.cpan.org/CPAN/authors/id/D/DC/DCOPPIT/Mail-Mbox-MessageParser-%{version}.tar.gz +Source1: perl-module-version-filter BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}-root-%(%{__id_u} -n) BuildArch: noarch Requires: grep, gzip, bzip2, /usr/bin/diff @@ -22,6 +23,10 @@ information, GNU grep, or highly optimized Perl. %prep %setup -q -n Mail-Mbox-MessageParser-%{version} +# Auto provides aren't clever enough for what Mail::Mbox::MessageParser does +%global provfilt /bin/sh -c "%{__perl_provides} | %{__perl} -n -s %{SOURCE1} -lib=%{_builddir}/%{buildsubdir}/lib" +%define __perl_provides %{provfilt} + %build %{__perl} Makefile.PL INSTALLDIRS=vendor \ DIFF=/usr/bin/diff \ @@ -32,15 +37,15 @@ information, GNU grep, or highly optimized Perl. --default %{__make} %{?_smp_mflags} -%check -%{__make} test - %install %{__rm} -rf %{buildroot} %{__make} pure_install PERL_INSTALL_ROOT=%{buildroot} /usr/bin/find %{buildroot} -type f -name .packlist -exec %{__rm} -f {} ';' /usr/bin/find %{buildroot} -depth -type d -exec /bin/rmdir {} ';' 2>/dev/null -%{__chmod} -R u+w %{buildroot}/* +%{_fixperms} %{buildroot} + +%check +%{__make} test %clean %{__rm} -rf %{buildroot} @@ -56,8 +61,12 @@ information, GNU grep, or highly optimized Perl. %{_mandir}/man3/Mail::Mbox::MessageParser::Perl.3pm* %changelog -* Mon Dec 7 2009 Stepan Kasal - 1.5002-2 -- rebuild against perl 5.10.1 +* Fri Feb 19 2010 Paul Howarth 1.5002-3 +- Fix versioned provides for perl modules +- Use %%{_fixperms} macro instead of our own %%{__chmod} incantation + +* Mon Dec 7 2009 Stepan Kasal 1.5002-2 +- Rebuild against perl 5.10.1 * Wed Sep 2 2009 Paul Howarth 1.5002-1 - Update to 1.5002 diff --git a/perl-module-version-filter b/perl-module-version-filter new file mode 100644 index 0000000..6debf33 --- /dev/null +++ b/perl-module-version-filter @@ -0,0 +1,20 @@ +#!/usr/bin/perl + +use lib $lib; + +# Extract module name from perl(Module::Name) = blah +if (/^perl\((.*)\).*$/) { + my $module = $1; + + # Require the module so we can get at its version number + eval "require $module"; + + # Grok the module's version + my $modver = eval "\$${module}::VERSION"; + + # Rewrite the output with the right version number + print "perl($module) = $modver\n"; +} else { + # Not a perl module reference, pass through unchanged + print; +}