Packaging for python2/3 compatibility

Gal Zaidman gzaidman at redhat.com
Sun Aug 12 11:42:17 EDT 2018


Hello all,

I'm a member of the RHEV integration team  and for the past few weeks I've
been working on packaging Ovirt for python3 compatibility for Fedora, and
we have very clear guidelines for packaging python packages for Fedora:
https://fedoraproject.org/wiki/Packaging:Python#Byte_compiling
and that is basically a package name starts with python2/3-*package-name*.

But in RHEL or Centos, we have some packages named:
python-*package-name*, *package-name*-python and so on,

one example is libselinux, which in Fedora is:
python2/3-libselinux and on Centos\RHEL is libselinux-python

When I re-write the spec file I want to avoid (as much as possible) from
if/else like if rhel require and if fedora require, I want to know if there
is a correct way of doing so without using if/else everywhere in the spec
file?

BTW I thought of creating a macro function that gets the package name and
an argument for the location of python for rhel and returns the correct
python package name, and if that is the best way, I had trouble in finding
examples of spec macro functions with conditions within them
so I would love to get a good example of such macro function.

Thanks,
Gal



More information about the Python-list mailing list