0

I have developed a python script and want to put it in a RPM package. The only problem is that this script uses ovirtsdk4 module, which is not one of the builtin python modules. That being said, I would have to install this module within the RPM package. I can think of two ways to approach this:

1 - Using pip3 in the %post section.

2 - Putting the python3-ovirt-engine-sdk4 in the "Requires: package " section.

However, first way does not seem quite reliable and the second doesn't seem to work properly since this package is not available on the CentOS-XXX repositories. (It belong to the ovirt repo).

Can you think of a better way to approach this or am I missing anything?

Many thanks.

1 Answers1

0

The fact that the package is not in the CentOS repositories should not cause any problem, just make sure that you can download from the ovirt repository, then the update should run normally.

Test first manually if you can yum install python3-ovirt-engine-sdk4.

EDIT: don't install using pip3, because then you cannot manage the dependencies with rpm. You had the right intuition trying to use the rpm dependencies.

Chris Maes
  • 35,025
  • 12
  • 111
  • 136
  • I can only install it manually if I have the oVirt repository installed, which I don't in many of the servers on which this RPM will be installed. – Vitor Carvalho Jul 03 '20 at 11:23
  • ... which is quite logically, what do you expect to obtain then? You must think of a means of getting this package and its dependencies onto your servers. So either you download and start copying this package (and all its dependencies) to all your servers, either you just configure the ovirt repository on your servers. – Chris Maes Jul 03 '20 at 11:25
  • That's exactly what I am asking here. Is there a way of configuring the ovirt repository within the RPM package? There would be no logic in manually configuring it. – Vitor Carvalho Jul 03 '20 at 11:34
  • No that is not possible, that would be a chicken/egg problem. When `yum`tries to determine if your package is installable, it uses the repositories available on the system, so while you could add the repository (ideally by packaging a .repo file) upon installation, that would be too late for `yum` to work through the dependencies. – Chris Maes Jul 03 '20 at 11:38