From beaa2eec4f426655773cc89eb1331f117757c8a9 Mon Sep 17 00:00:00 2001 From: Tomas Orsava Date: Sep 20 2018 11:36:47 +0000 Subject: Move the __python2/3 macros to the python-srpm-macros subpackage This facilitates using the %%{__python2/3} in Build/Requires --- diff --git a/macros.python-srpm b/macros.python-srpm index c4bdd1c..514a449 100644 --- a/macros.python-srpm +++ b/macros.python-srpm @@ -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 diff --git a/macros.python2 b/macros.python2 index d6c74c2..4b1390c 100644 --- a/macros.python2 +++ b/macros.python2 @@ -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))") diff --git a/macros.python3 b/macros.python3 index 25c6f62..44e2889 100644 --- a/macros.python3 +++ b/macros.python3 @@ -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])") diff --git a/python-rpm-macros.spec b/python-rpm-macros.spec index e3d2d85..649cd30 100644 --- a/python-rpm-macros.spec +++ b/python-rpm-macros.spec @@ -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 @@ RPM macros for building Python source packages. %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 @@ RPM macros for building Python 2 packages. %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 @@ install -m 644 %{SOURCE0} %{SOURCE1} %{SOURCE2} %{SOURCE3} %{SOURCE4} \ %changelog +* Thu Sep 20 2018 Tomas Orsava - 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 - 3-37 - Make %%py_byte_compile terminate build on SyntaxErrors (#1616219)