#13 Move the __python2/3 macros to the python-srpm-macros subpackage
Merged 5 years ago by torsava. Opened 5 years ago by torsava.
rpms/ torsava/python-rpm-macros master  into  master

file modified
+7
@@ -1,3 +1,10 @@ 

+ # Define the Python interpreter paths in the SRPM macros so that

+ # - they can be used in Build/Requires

+ # - they can be used in non-Python packages where requiring pythonX-devel would

+ #   be an overkill

+ %__python2 /usr/bin/python2

+ %__python3 /usr/bin/python3

+ 

  # 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

file modified
-1
@@ -1,4 +1,3 @@ 

- %__python2 /usr/bin/python2

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

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

  %python2_version %(%{__python2} -Esc "import sys; sys.stdout.write('{0.major}.{0.minor}'.format(sys.version_info))")

file modified
-1
@@ -1,4 +1,3 @@ 

- %__python3 /usr/bin/python3

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

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

  %python3_version %(%{__python3} -Ic "import sys; sys.stdout.write(sys.version[:3])")

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

  Name:           python-rpm-macros

  Version:        3

- Release:        37%{?dist}

+ Release:        38%{?dist}

  Summary:        The unversioned Python RPM macros

  

  License:        MIT
@@ -31,6 +31,7 @@ 

  

  %package -n python2-rpm-macros

  Summary:        RPM macros for building Python 2 packages

+ Requires:       python-srpm-macros >= 3-38

  # Would need to be different for each release - worth it?

  #Conflicts:      python2-devel < 2.7.11-3

  
@@ -39,6 +40,7 @@ 

  

  %package -n python3-rpm-macros

  Summary:        RPM macros for building Python 3 packages

+ Requires:       python-srpm-macros >= 3-38

  # Would need to be different for each release - worth it?

  #Conflicts:      python3-devel < 3.5.1-3

  
@@ -71,6 +73,10 @@ 

  

  

  %changelog

+ * Thu Sep 20 2018 Tomas Orsava <torsava@redhat.com> - 3-38

+ - Move the __python2/3 macros to the python-srpm-macros subpackage

+ - This facilitates using the %%{__python2/3} in Build/Requires

+ 

  * Wed Aug 15 2018 Miro Hrončok <mhroncok@redhat.com> - 3-37

  - Make %%py_byte_compile terminate build on SyntaxErrors (#1616219)

  

This change has multiple benefits:
- It allows using the %%{__python2/3} macros in Build/Requires, which is better than relying on a fixed path or a package name
- It allows using these macros in packages that are not primarily building Python, where requiring pythonX-devel would be an overkill (and we don't wan people to depend directly on pythonX-rpm-macros, as we consider that an implementation detail)

should we get the version fixed?

at least >= is a must here, otherwise the dependency bring nothing useful

rebased onto beaa2ee

5 years ago

LGTM. Should we get some packaging experts to review as well. @tibbs, @ngompa, @pmatilai?

What do you think, Miro?

Pull-Request has been merged by torsava

5 years ago