#7 EPEL7: Add %python3_platform useful for PYTHONPATH on arched builds
Closed 3 years ago by churchyard. Opened 3 years ago by churchyard.
rpms/ churchyard/python-rpm-macros epel7-python3_platform  into  epel7

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

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

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

  %python3_version_nodots %(%{__python3} -c "import sys; sys.stdout.write(sys.version[:3].replace('.',''))")

+ %python3_platform %(%{__python3} -c "import sysconfig; print(sysconfig.get_platform())")

  %py3dir %{_builddir}/python3-%{name}-%{version}-%{release}

  

  %py3_shbang_opts -s

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

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

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

  %python3_other_version_nodots %(%{__python3_other} -c "import sys; sys.stdout.write(sys.version[:3].replace('.',''))")

+ %python3_other_platform %(%{__python3_other} -c "import sysconfig; print(sysconfig.get_platform())")

  

  %py3_other_shbang_opts -s

  

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

  Name:           python-rpm-macros

  Version:        3

- Release:        20%{?dist}

+ Release:        21%{?dist}

  Summary:        The unversioned Python RPM macros

  

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

  

  

  %changelog

+ * Mon Jul 09 2018 Miro Hrončok <mhroncok@redhat.com> - 3-21

+ - Add %%python3_platform useful for PYTHONPATH on arched builds

+ 

  * Thu Jun 21 2018 Tadej Janež <tadej.j@nez.si> - 3-20

  - Add %%python3_other_* counterparts for %%python3_* macros in EPEL 7

  

And %python3_other_platform as well.

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}

Pull-Request has been closed by churchyard

3 years ago