Miro Hrončok wrote:
On 27.11.2017 11:38, Richard W.M. Jones wrote:
>
>
https://bugzilla.redhat.com/show_bug.cgi?id=1404631#c4
>
> In this commit:
>
>
https://src.fedoraproject.org/rpms/nbdkit/c/f38f61c339f925928e8cd6e520581...
>
> I accidentally disabled Python 3 support on Fedora.
>
> Is there a better way to write this? What I really need is a pair of
> macros "Python 2 is supported" & "Python 3 is supported"
which I can
> use to conditionalize the spec file. Maybe checking if %{__python2}
> and %{__python3} are non-empty?
In case you are still interested:
%{__python3} is defined on Fedora, but not EPEL. However, python3 is
available in EPEL. If you only consider Fedora vs. RHEL (without EPEL),
than relying on %{__python3} would work.
I don't think you can rely on __python3, that's not available to the default
buildroot used to generate src.rpm's
But, these are included in python-srpm-macros, which may be usable:
# python3_pkgversion specifies the version of Python 3 in the distro. It
can be
# a specific version (e.g. 34 in Fedora EPEL7)
%python3_pkgversion 3
# Set to /bin/true to avoid %ifdefs and %{? in specfiles
%__python3_other /bin/true
%py3_other_build /bin/true
%py3_other_install /bin/true