#9 Override %py_build from RHEL not to use %__python2 but %__python
Merged 22 days ago by tibbs. Opened 22 days ago by churchyard.
rpms/ churchyard/epel-rpm-macros py_build  into  epel7

file modified
+4 -1

@@ -1,6 +1,6 @@ 

  Name:           epel-rpm-macros

  Version:        7

- Release:        22

+ Release:        23

  Summary:        Extra Packages for Enterprise Linux RPM macros

  

  Group:          System Environment/Base

@@ -52,6 +52,9 @@ 

  

  

  %changelog

+ * Tue Oct 22 2019 Miro Hrončok <mhroncok@redhat.com> - 7-23

+ - Override %%py_build from RHEL not to use %%__python2 but %%__python

+ 

  * Mon Sep 30 2019 Miro Hrončok <mhroncok@redhat.com> - 7-22

  - Define %%python2 and %%python3

  

@@ -14,3 +14,10 @@ 

  # This was defined in EPEL's python-srpm-macros

  # But RHEL 7.7+ redefined it to 3

  %python3_pkgversion 36

+ 

+ # There is a mistake in this macro in RHEL 7 and the RHEL Python maintainers asked EPEL to override it as a workaround

+ # See https://bugzilla.redhat.com/show_bug.cgi?id=1757834

+ %py_build() %{expand:\\\

+   CFLAGS="%{optflags}" %{__python} %{py_setup} %{?py_setup_args} build --executable="%{__python} %{py_shbang_opts}" %{?*}

+   sleep 1

+ } 

\ No newline at end of file

The %py_build macro should respect the global definition of %__python,
however it hardcodes --executable="%{__python2} in RHEL 7
and hence it makes it impossible to do the following:

%global __python %__python3
...
%py_build

This should be arguably fixed in RHEL 7, but before it is, it it overridden
in EPEL 7.

See https://bugzilla.redhat.com/show_bug.cgi?id=1757834

cc @pviktori @carlwgeorge

Looks good to me. Will you handle the build and update?

Pull-Request has been merged by tibbs

22 days ago