PaulHowarth/Blog/2010-02-18

Thursday 18th February 2010

Fedora Project

  • Updated perl-Unicode-String in devel, EL-4, and EL-5 branches to carefully convert the documentation from ISO-8859-1 to UTF-8 encoding and add the perl(:MODULE_COMPAT_*) dependency; the documentation recoding wasn't simply a matter of the usual run through iconv because the documentation contains an example of converting strings between encodings, which would have been wrong with a blanket recoding so I used a patch to do the job more surgically instead

Local Packages

There were big changes in Rawhide today as the No Frozen Rawhide scheme hit the mirrors, resulting in builds done against the existing development tree targeting Fedora 14 rather than Fedora 13. So, I bit the bullet and re-jigged my build system (mock configs, repoclosure scripts, build scripts etc.) to support separate branched (for F-13) and rawhide (for F-14) targets, and created an fc13 repository (which still contains a number of fc12 packages as I'm part way through a mass rebuild that I need to do due to changes in dist tag macros).

  • Updated perl-FileHandle-Unget to fix versioned provide for perl(FileHandle::Unget) and add buildreq perl(Devel::Leak) for additional test coverage

  • Updated perl-Unicode-String to properly convert its documentation to UTF-8 encoding as per Fedora version

  • Rebuilt perl-Clone and perl-Unicode-Map for perl 5.10.1 in devel branches

  • Updated perl-Mail-Mbox-MessageParser to fix the versioned provides for its perl modules, i.e. provides like:

  • perl(Mail::Mbox::MessageParser) = 1.5002
  • Normally, rpm will automatically extract these from lines like this in the perl code:

  • package Mail::Mbox::MessageParser;
    
    $VERSION = 1.5002;
  • However, Mail::Mbox::MessageParser, for reasons best known to its author, codes it like this:

  • package Mail::Mbox::MessageParser;
    
    $VERSION = sprintf "%d.%02d%02d", q/1.50.2/ =~ /(\d+)/g;
  • When rpm tries to figure out the version for the provide, it comes out with:

  • perl(Mail::Mbox::MessageParser) = 02
  • There was a similar issue with perl-FileHandle-Unget but there is only one module in that package and its version number is the same as the package version number, so that could easily be handled by filtering out the auto-detected provide and adding a hard-coded provide in the spec file:

  • Provides: perl(FileHandle::Unget) = %{version}
  • That approach is no good for Mail::Mbox::MessageParser because it contains a number of sub-modules, all with different versioning. The approach I decided to take was to get perl to tell me the version number for each module when it came time to evaluate the provides for the package. I wrote this script, which takes the auto-detected provides as input, extracts the module names from them and then loads each module in turn to read its VERSION string and then write out a correctly versioned provide string to replace the auto-detected one:

  • #!/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;
    }
    
  • The $lib variable is set when the script is called using perl's -s switch, and is the directory where the modules can be found (since they're not installed on the build system itself). I called this script perl-module-version-filter and added it to the package as %{SOURCE1}. I then hooked it into the package build by adding these lines to the end of the %prep section of the spec:

  • # 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}
  • The resulting package now has the correct provides:
  • perl(Mail::Mbox::MessageParser) = 1.5002
    perl(Mail::Mbox::MessageParser::Cache) = 1.3002
    perl(Mail::Mbox::MessageParser::Config) = 0.0102
    perl(Mail::Mbox::MessageParser::Grep) = 1.7005
    perl(Mail::Mbox::MessageParser::MetaInfo) = 0.0200
    perl(Mail::Mbox::MessageParser::Perl) = 1.6005
    perl-Mail-Mbox-MessageParser = 1.5002-2.fc14


Recent