From 1ea9947b6fd6e4d049416cd8c67b59e2cff8cf75 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Miro=20Hron=C4=8Dok?= Date: Tue, 3 Jul 2018 14:17:33 +0200 Subject: [PATCH] Add %python3_platform useful for PYTHONPATH on arched builds This is mostly used when building Sphinx docs on arched build. Previously: PLATFORM=$(python3 -c "import sysconfig; print(sysconfig.get_platform())") export PYTHONPATH=../build/lib.${PLATFORM}-%{python3_version} make man Or: PYTHONPATH=`realpath ../build/lib.linux*` make Or: PYTHONPATH=$(echo $PWD/build/lib.linux-*) make html Now: PYTHONPATH=../build/lib.%{python3_platform}-%{python3_version} --- macros.python3 | 1 + python-rpm-macros.spec | 5 ++++- 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/macros.python3 b/macros.python3 index 79c33f1..25c6f62 100644 --- a/macros.python3 +++ b/macros.python3 @@ -3,6 +3,7 @@ %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])") %python3_version_nodots %(%{__python3} -Ic "import sys; sys.stdout.write(sys.version[:3].replace('.',''))") +%python3_platform %(%{__python3} -Ic "import sysconfig; print(sysconfig.get_platform())") %py3dir %{_builddir}/python3-%{name}-%{version}-%{release} %py3_shbang_opts -s diff --git a/python-rpm-macros.spec b/python-rpm-macros.spec index fb4e8d3..413bbc1 100644 --- a/python-rpm-macros.spec +++ b/python-rpm-macros.spec @@ -1,6 +1,6 @@ Name: python-rpm-macros Version: 3 -Release: 30%{?dist} +Release: 31%{?dist} Summary: The unversioned Python RPM macros License: MIT @@ -71,6 +71,9 @@ install -m 644 %{SOURCE0} %{SOURCE1} %{SOURCE2} %{SOURCE3} %{SOURCE4} \ %changelog +* Tue Jul 03 2018 Miro HronĨok - 3-31 +- Add %%python3_platform useful for PYTHONPATH on arched builds + * Mon Jun 18 2018 Jason L Tibbitts III - 3-30 - Add %%pypi_source macro, as well as %%__pypi_url and %%_pypi_default_extension.