From ac4ad75610007bd19571075872600cee66f7e6a0 Mon Sep 17 00:00:00 2001 From: Mikhail Novosyolov Date: Tue, 19 May 2020 15:22:48 +0300 Subject: [PATCH] Macros to py38 --- python3.macros | 34 +++++++++++++++++----------------- python3.spec | 4 +--- 2 files changed, 18 insertions(+), 20 deletions(-) diff --git a/python3.macros b/python3.macros index a52dc93..88b1649 100644 --- a/python3.macros +++ b/python3.macros @@ -1,25 +1,25 @@ -%__python3 /usr/bin/python3 -%python3_sitelib %(%{__python3} -c "from distutils.sysconfig import get_python_lib; print(get_python_lib())") -%python3_sitearch %(%{__python3} -c "from distutils.sysconfig import get_python_lib; print(get_python_lib(1))") -%python3_version %(%{__python3} -c "import sys; print(sys.version[0:3])") -%py3_ver %(%{__python3} -c "import sys; v=sys.version_info[:2]; print('%%d.%%d'%%v)" 2>/dev/null || echo PYTHON-NOT-FOUND) -%py3_prefix %(%{__python3} -c "import sys; print(sys.prefix)" 2>/dev/null || echo PYTHON-NOT-FOUND) -%py3_platsitedir %python3_sitearch -%py3_puresitedir %python3_sitelib -%py3_incdir %(%{__python3} -c 'from distutils.sysconfig import get_python_inc; print(get_python_inc())' 2>/dev/null || echo PYTHON-INCLUDEDIR-NOT-FOUND) -%py3dir %{_builddir}/python3-%{name}-%{version}-%{release} +%__python38 /usr/bin/python38 +%python38_sitelib %(%{__python38} -c "from distutils.sysconfig import get_python_lib; print(get_python_lib())") +%python38_sitearch %(%{__python38} -c "from distutils.sysconfig import get_python_lib; print(get_python_lib(1))") +%python38_version %(%{__python38} -c "import sys; print(sys.version[0:3])") +%py38_ver %(%{__python38} -c "import sys; v=sys.version_info[:2]; print('%%d.%%d'%%v)" 2>/dev/null || echo PYTHON38-NOT-FOUND) +%py38_prefix %(%{__python38} -c "import sys; print(sys.prefix)" 2>/dev/null || echo PYTHON38-NOT-FOUND) +%py38_platsitedir %python38_sitearch +%py38_puresitedir %python38_sitelib +%py38_incdir %(%{__python38} -c 'from distutils.sysconfig import get_python_inc; print(get_python_inc())' 2>/dev/null || echo PYTHON38-INCLUDEDIR-NOT-FOUND) +%py38dir %{_builddir}/python38-%{name}-%{version}-%{release} # %%py_setup setup.py # in rpm-openmandriva-setup -%py3_shbang_opts -s +%py38_shbang_opts -s -%py3_build() %{expand:\ -CFLAGS="%{optflags}" %{__python3} %{py_setup} %{?py_setup_args} build --executable="%{__python3} %{py3_shbang_opts}" %{?*}\ +%py38_build() %{expand:\ +CFLAGS="%{optflags}" %{__python38} %{py_setup} %{?py_setup_args} build --executable="%{__python38} %{py3_shbang_opts}" %{?*}\ } -%py3_install() %{expand:\ -CFLAGS="%{optflags}" %{__python3} %{py_setup} %{?py_setup_args} install -O1 --skip-build --root %{buildroot} %{?*}\ +%py38_install() %{expand:\ +CFLAGS="%{optflags}" %{__python38} %{py_setup} %{?py_setup_args} install -O1 --skip-build --root %{buildroot} %{?*}\ } -%py3_test() %{expand:\ -%{__python3} %{py_setup} %{?py_setup_args} test %{?1}\ +%py38_test() %{expand:\ +%{__python38} %{py_setup} %{?py_setup_args} test %{?1}\ } diff --git a/python3.spec b/python3.spec index df0aa7b..781db80 100644 --- a/python3.spec +++ b/python3.spec @@ -51,7 +51,7 @@ Summary: An interpreted, interactive object-oriented programming language Name: %{py3_name} Version: 3.8.2 -Release: 1 +Release: 2 License: Modified CNRI Open Source License Group: Development/Python @@ -425,7 +425,6 @@ find %{buildroot} -type f -print | while read -r line ; do fi done -### warning!!! replaced only python3 with python3.8, macros are still the same ### %if %rpm4 cp -fr %{S:2} %{buildroot}%{_rpmmacrodir}/python38.macros %else @@ -434,7 +433,6 @@ rm -fr %{buildroot}%{_bindir}/{2to3,idle3,pydoc,pydoc3,python,python3,python3-co rm -fr %{buildroot}%{_libdir}/libpython3.so rm -fr %{buildroot}%{_libdir}/pkgconfig/python3.pc %endif - sed -i -e "1s|/usr/bin/python3|/usr/bin/python3.8|" %{buildroot}%{_rpmmacrodir}/*python38* %endif %check