From 713323647bec2bf81cb5c559645f58570deeb05f Mon Sep 17 00:00:00 2001 From: Silvan Calarco Date: Fri, 5 Jan 2024 16:58:30 +0100 Subject: [PATCH] macros.python3: use sysconfig instead of distutils [release 3.7.12-2mamba;Wed Feb 02 2022] --- python-3.2-macros.python => macros.python3 | 8 ++++---- python3.spec | 17 +++++++++-------- 2 files changed, 13 insertions(+), 12 deletions(-) rename python-3.2-macros.python => macros.python3 (77%) diff --git a/python-3.2-macros.python b/macros.python3 similarity index 77% rename from python-3.2-macros.python rename to macros.python3 index 95debf2..30e3af0 100644 --- a/python-3.2-macros.python +++ b/macros.python3 @@ -10,10 +10,10 @@ %__python3_requires %{_usrlibrpm}/pythondeps3.sh --requires # Useful macros for building *.rpm python packages (for python > 1.6). -# -%python3_sitearch %(%{__python3} -c "from distutils.sysconfig import get_python_lib; print(get_python_lib(True));") -%python3_sitelib %(%{__python3} -c "from distutils.sysconfig import get_python_lib; print(get_python_lib())") -%python3_inc %(%{__python3} -c "from distutils.sysconfig import get_python_inc; print(get_python_inc())") + +%python3_sitearch %(%{__python3} -c "from sysconfig import get_paths; print(get_paths()['platlib'])") +%python3_sitelib %(%{__python3} -c "from sysconfig import get_paths; print(get_paths()['purelib'])") +%python3_inc %(%{__python3} -c "from sysconfig import get_paths; print(get_paths()['include'])") %python3_version %(%{__python3} -c "import sys; print(sys.version[0:3])") %py3_compile(O) \ diff --git a/python3.spec b/python3.spec index b7b896b..ed46a9a 100644 --- a/python3.spec +++ b/python3.spec @@ -2,7 +2,7 @@ %define libname libpython3 Name: python3 Version: 3.7.12 -Release: 1mamba +Release: 2mamba Summary: An interpreted, interactive, object-oriented programming language Group: Applications/Development Vendor: openmamba @@ -10,7 +10,7 @@ Distribution: openmamba Packager: Silvan Calarco URL: https://www.python.org/ Source: https://www.python.org/ftp/python/%{version}/Python-%{version}.tar.xz -Source1: python-3.2-macros.python +Source1: macros.python3 Source2: pythondeps3.sh Source3: python-rpm-macros.pyver Patch0: python-2.4.2-tex3-fix.patch @@ -86,7 +86,6 @@ Python combines remarkable power with very clear syntax. It has modules, classes There are interfaces to many system calls and libraries, as well as to various windowing systems (X11, Motif, Tk, Mac, MFC). New built-in modules are easily written in C or C++. Python is also usable as an extension language for applications that need a programmable interface. The Python implementation is portable: it runs on many brands of UNIX, on Windows, DOS, OS/2, Mac, Amiga... - This package contains the development files for Python. %package doc @@ -100,7 +99,6 @@ Python combines remarkable power with very clear syntax. It has modules, classes There are interfaces to many system calls and libraries, as well as to various windowing systems (X11, Motif, Tk, Mac, MFC). New built-in modules are easily written in C or C++. Python is also usable as an extension language for applications that need a programmable interface. The Python implementation is portable: it runs on many brands of UNIX, on Windows, DOS, OS/2, Mac, Amiga... - This package contains the documentation files for Python in HTML format. %package tk @@ -171,9 +169,9 @@ cd Doc #make PAPER=a4 pdf %endif rm -f `find %{buildroot}%{_docdir}/%{name}-%{version}/html/.buildinfo` -install -D -m0644 %{SOURCE1} %{buildroot}%{_sysconfdir}/rpm/macros.python3 +install -D -m0644 %{SOURCE1} %{buildroot}%{_rpmmacrodir}/macros.python3 install -D -m0644 %{SOURCE2} %{buildroot}%{_prefix}/lib/rpm/pythondeps3.sh -install -D -m0644 %{SOURCE3} %{buildroot}%{_sysconfdir}/rpm/macros.pyver +install -D -m0644 %{SOURCE3} %{buildroot}%{_rpmmacrodir}/macros.pyver rm %{buildroot}%{_includedir}/python rm %{buildroot}%{_bindir}/2to3 @@ -250,8 +248,8 @@ find %{_prefix}/lib/python%{majversion}/site-packages/*.egg-info -type d -empty %files -n %{libname}-devel %defattr(-,root,root) -%{_sysconfdir}/rpm/macros.pyver -%{_sysconfdir}/rpm/macros.python3 +%{_rpmmacrodir}/macros.pyver +%{_rpmmacrodir}/macros.python3 %{_bindir}/python3-config %{_bindir}/python%{majversion}-config %{_bindir}/python%{majversion}m-config @@ -277,6 +275,9 @@ find %{_prefix}/lib/python%{majversion}/site-packages/*.egg-info -type d -empty %endif %changelog +* Wed Feb 02 2022 Silvan Calarco 3.7.12-2mamba +- macros.python3: use sysconfig instead of distutils + * Sun Dec 26 2021 Silvan Calarco 3.7.12-1mamba - update to 3.7.12