Perl RPM Requires/Provides

Chris Weyl cweyl at alumni.drew.edu
Sat Oct 17 06:03:59 UTC 2009


On Fri, Oct 16, 2009 at 12:51 PM, Dave Cross <dave at dave.org.uk> wrote:
>
> As I understand it, the current version of rpmbuild works generates the
> Requires and Provides definitions for an RPM by parsing the Perl code and
> working out which modules are used (for Requires) or defined (for Provides).

Yep.  It's not a very sophisticated approach, but works.  (mostly.)

> Can someone please confirm that these are the files that I need to work on
> and (even better) point me at some documentation for how these programs are
> called - what inputs and outputs are expected, stuff like that.
>
> Also, is there a way to provide my own replacement for these files without
> just overwriting them. I'd rather not fiddle directly with system supplied
> code.

As tibbs pointed out (obliquely :)), take a look at the
%__perl_provides and %__perl_requires macros.  You can override them
either in the specs themselves, or in $HOME/.rpmmacros.  The inputs
and outputs can be seen from the filtering page: files are passed to
the scripts, scanned, and deps emitted on stdout.  Note that these
scripts are only ever passed files that 'file' thinks is Perl, and
META.yml is never passed in any case (as it's never installed anywhere
in the %buildroot)... Not that it matters if you're rewriting it.  If
you're using a different mechanism, setting those macros to %{nil}
should be enough to disable the Perl dependency generation w/o
impacting the rest of the system.

I've fiddled with this a bit, mainly with trying to get RPM itself to
parse and pull from META.yml via a lua scriptlet -- nothing serious
has come of it so far.  I've lately abandoned it largely in favor of
automatically updating spec file dependencies based off META.yml as
part of an upgrade process.  It's not perfect, but it's been working
well so far.

Good luck!  :)

                                       -Chris
-- 
Chris Weyl
Ex astris, scientia




More information about the Fedora-perl-devel-list mailing list