Back in August, the {__python} macro was deprecated in favor of
{__python2}.  This is cool as it paves the way for an eventual python3
takeover.

https://fedoraproject.org/w/index.php?title=Packaging:Python&diff=350838&oldid=350837

However, {__python} is still the expected macro for el6 builds.  Many of us
maintain single spec files that we build for Fedora and EPEL.

- Does anyone have any recommendations about how to handle this?

  I recently started using this blurb at the top of my new spec files.
  Will it do?

    %if 0%{?rhel} && 0%{?rhel} <= 6
    %{!?__python2:        %global __python2 %{__python}}
    %{!?python2_sitelib:  %global python2_sitelib %(%{__python} -c "from 
distutils.sysconfig import get_python_lib; print(get_python_lib())")}
    %{!?python2_sitearch: %global python2_sitearch %(%{__python} -c "from 
distutils.sysconfig import get_python_lib; print(get_python_lib(1))")}
    %endif

- If we decide on a canonical approach, can it be added to the Python
  guidelines as a recommendation?

Cheers-
 -Ralph

Attachment: pgpkx0HdPo62B.pgp
Description: PGP signature

_______________________________________________
python-devel mailing list
python-devel@lists.fedoraproject.org
https://admin.fedoraproject.org/mailman/listinfo/python-devel

Reply via email to