#33 EPEL 6: Define %python2 and %python3, drop hardcoded python2 from %py_build
Merged 4 years ago by churchyard. Opened 4 years ago by churchyard.
rpms/ churchyard/python-rpm-macros el6-nodunders  into  el6

file modified
+1 -1
@@ -2,7 +2,7 @@ 

  %py_shbang_opts -s

  

  %py_build() %{expand:\

- CFLAGS="%{optflags}" %{__python} %{py_setup} %{?py_setup_args} build --executable="%{__python2} %{py_shbang_opts}" %{?1}\

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

  }

  

  %py_install() %{expand:\

file modified
+5
@@ -1,4 +1,9 @@ 

+ # use the underscored macros to redefine the behavior of %%python2_version etc.

  %__python2 /usr/bin/python2.6

+ 

+ # use the non-underscored macros to refer to Python in spec, etc.

+ %python2 %__python2

+ 

  %python2_sitelib %(%{__python2} -c "from distutils.sysconfig import get_python_lib; print(get_python_lib())")

  %python2_sitearch %(%{__python2} -c "from distutils.sysconfig import get_python_lib; print(get_python_lib(1))")

  %python2_version %(%{__python2} -c "import sys; sys.stdout.write(sys.version[:3])")

file modified
+6
@@ -1,5 +1,11 @@ 

+ # use the underscored macros to redefine the behavior of %%python3_version etc.

  %__python3 /usr/bin/python3.4

+ 

+ # use the non-underscored macros to refer to Python in spec, etc.

+ %python3 %__python3

+ 

  #__python3_other /usr/bin/python3.5

+ #python3_other %%__python3_other

  

  %python3_sitelib %(%{__python3} -c "from distutils.sysconfig import get_python_lib; print(get_python_lib())")

  %python3_sitearch %(%{__python3} -c "from distutils.sysconfig import get_python_lib; print(get_python_lib(1))")

file modified
+5 -1
@@ -1,6 +1,6 @@ 

  Name:           python-rpm-macros

  Version:        3

- Release:        14%{?dist}

+ Release:        15%{?dist}

  Summary:        The unversioned Python RPM macros

  

  License:        MIT
@@ -65,6 +65,10 @@ 

  

  

  %changelog

+ * Fri Sep 27 2019 Miro Hrončok <mhroncok@redhat.com> - 3-15

+ - Define %%python2 and %%python3

+ - Drop hardcoded python2 from %%py_build

+ 

  * Wed Mar 06 2019 Carl George <carl@george.computer> - 3-14

  - Move macros.pybytecompile in here from python3X-devel

  - macros.pybytecompile: Detect Python version through sys.version_info instead

See https://pagure.io/packaging-committee/issue/907

Redefine %__pythonX to change the behavior of %pythonX, %pythonX_version, etc.
Use %pythonX in spec.

1 new commit added

  • Drop hardcoded python2 from %py_build
4 years ago

LGTM, thanks for including that %py_build fix.

Pull-Request has been merged by churchyard

4 years ago