user1382278
user1382278

Reputation: 421

Enable rpmbuild automatic detection of dependencies for python

The dependencies of an RPM are specified in its .spec file on the "Requires:" lines, but rpmbuild is able to detect automatically dependencies for Perl files with CentOS. I guess that such detection is supported by /usr/lib/rpm/find-requires which uses /usr/lib/rpm/perl.req.

I would like to detect automatically dependencies also for python files, but, although /usr/lib/rpm/find-requires seems to implement the logic similar to the Perl case, /usr/lib/rpm/python.req does not exist. Is something else needed?

Any other methods to enable the automatic detection of dependencies for python while building a RPM?

Upvotes: 0

Views: 807

Answers (2)

iamauser
iamauser

Reputation: 11479

For a CentOS-7 box, python dependencies are generated by this script:

/usr/lib/rpm/pythondeps.sh

which is used in /usr/lib/rpm/fileattrs/python.attr like this,

 %__python_provides /usr/lib/rpm/pythondeps.sh --provides
 %__python_requires /usr/lib/rpm/pythondeps.sh --requires

You can do it automatically by calling the above two predefined vars in your spec file

Upvotes: 1

Related Questions