- 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
This commit is contained in:
Tomáš Chvátal 2020-07-10 09:56:59 +00:00 committed by Git OBS Bridge
parent 1553080af8
commit 5c8138e56b
2 changed files with 26 additions and 1 deletions

View File

@ -1,3 +1,9 @@
-------------------------------------------------------------------
Fri Jul 10 09:56:28 UTC 2020 - Tomáš Chvátal <tchvatal@suse.com>
- 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 <tchvatal@suse.com>

View File

@ -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}