From 5c8138e56bc68448e658996461a48da88a4e60f25bc48ee0f865586d60c874ac Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Tom=C3=A1=C5=A1=20Chv=C3=A1tal?= Date: Fri, 10 Jul 2020 09:56:59 +0000 Subject: [PATCH] - Remove main python3 files from -base based whether we are primary interpreter or not OBS-URL: https://build.opensuse.org/package/show/devel:languages:python:Factory/python38?expand=0&rev=9 --- python38.changes | 6 ++++++ python38.spec | 21 ++++++++++++++++++++- 2 files changed, 26 insertions(+), 1 deletion(-) diff --git a/python38.changes b/python38.changes index 7b25067..f9a3923 100644 --- a/python38.changes +++ b/python38.changes @@ -1,3 +1,9 @@ +------------------------------------------------------------------- +Fri Jul 10 09:56:28 UTC 2020 - Tomáš Chvátal + +- Remove main python3 files from -base based whether we are + primary interpreter or not + ------------------------------------------------------------------- Fri Jul 10 09:35:29 UTC 2020 - Tomáš Chvátal diff --git a/python38.spec b/python38.spec index 7191dc8..ccf6681 100644 --- a/python38.spec +++ b/python38.spec @@ -641,12 +641,24 @@ rm -fv %{buildroot}%{dynlib nis} # overwrite the copied binary with a link ln -sf python%{python_version} %{buildroot}%{_bindir}/python3 +# decide to ship python3 or just python3.X +%if !%{primary_interpreter} +rm %{buildroot}%{_bindir}/python3 +rm %{buildroot}%{_bindir}/pydocs3 +rm %{buildroot}%{_mandir}/man1/python3.1 +%endif + # link shared library instead of static library that tools expect ln -s ../../libpython%{python_abi}.so %{buildroot}%{_libdir}/python%{python_version}/config-%{python_abi}-%{archname}-%{_os}%{?_gnu}%{?armsuffix}/libpython%{python_abi}.so # delete idle3, which has to many packaging dependencies for base rm %{buildroot}%{_bindir}/idle3* +# delete the generic 2to3 binary if we are not primary +%if !%{primary_interpreter} +rm %{buildroot}%{_bindir}2to3 +%endif + # replace duplicate .pyo/.pyc with hardlinks %fdupes %{buildroot}/%{sitedir} @@ -673,8 +685,10 @@ install -m 755 -D Tools/gdb/libpython.py %{buildroot}%{_datadir}/gdb/auto-load/% #cp Makefile Makefile.pre.in Makefile.pre $RPM_BUILD_ROOT%{sitedir}/config-%{python_abi}/ # RPM macros +%if %{primary_interpreter} mkdir -p %{buildroot}%{_rpmconfigdir}/macros.d/ install -m 644 %{SOURCE7} %{buildroot}%{_rpmconfigdir}/macros.d/ # macros.python3 +%endif # import_failed hooks FAILDIR=%{buildroot}/%{sitedir}/_import_failed @@ -773,7 +787,9 @@ echo %{sitedir}/_import_failed > %{buildroot}/%{sitedir}/site-packages/zzzz-impo %files -n %{python_pkg_name}-tools %defattr(644, root, root, 755) %{sitedir}/turtledemo +%if %{primary_interpreter} %{_bindir}/2to3 +%endif %attr(755, root, root)%{_bindir}/2to3-%{python_version} %doc %{_docdir}/%{name}/Tools @@ -818,13 +834,16 @@ echo %{sitedir}/_import_failed > %{buildroot}/%{sitedir}/site-packages/zzzz-impo %doc %{_docdir}/%{name}/README.rst %license LICENSE %doc %{_docdir}/%{name}/README.SUSE +%if %{primary_interpreter} %{_mandir}/man1/python3.1%{?ext_man} +%endif %{_mandir}/man1/python%{python_version}.1%{?ext_man} # license text, not a doc because the code can use it at run-time %{sitedir}/LICENSE.txt # RPM macros +%if %{primary_interpreter} %{_rpmconfigdir}/macros.d/macros.python3 - +%endif # binary parts %dir %{sitedir}/lib-dynload %{dynlib array}