SHA256
1
0
forked from pool/python38

- Add condition to be primary to provide/obsolete python3-*

- Fix doc to build in versioned folder so the pythons can be
  installed next to each other

OBS-URL: https://build.opensuse.org/package/show/devel:languages:python:Factory/python38?expand=0&rev=7
This commit is contained in:
Tomáš Chvátal 2020-07-10 08:45:45 +00:00 committed by Git OBS Bridge
parent b7173901d3
commit 1c51f99915
2 changed files with 33 additions and 9 deletions

View File

@ -1,3 +1,10 @@
-------------------------------------------------------------------
Fri Jul 10 08:44:54 UTC 2020 - Tomáš Chvátal <tchvatal@suse.com>
- Add condition to be primary to provide/obsolete python3-*
- Fix doc to build in versioned folder so the pythons can be
installed next to each other
------------------------------------------------------------------- -------------------------------------------------------------------
Fri Jul 10 07:57:10 UTC 2020 - Tomáš Chvátal <tchvatal@suse.com> Fri Jul 10 07:57:10 UTC 2020 - Tomáš Chvátal <tchvatal@suse.com>

View File

@ -50,6 +50,9 @@
%define tarversion %{version} %define tarversion %{version}
%endif %endif
%define python_pkg_name python38 %define python_pkg_name python38
# Will provide the pyton3-* provides
# Will do the /usr/bin/python3 and all the core links
%define primary_interpreter 1
%define folderversion %{tarversion} %define folderversion %{tarversion}
%define tarname Python-%{tarversion} %define tarname Python-%{tarversion}
%define sitedir %{_libdir}/python%{python_version} %define sitedir %{_libdir}/python%{python_version}
@ -282,24 +285,34 @@ Obsoletes: python3 < 3.2
# no Provides, because python3 is obviously provided by package python3 # no Provides, because python3 is obviously provided by package python3
# python 3.4 provides asyncio # python 3.4 provides asyncio
Provides: %{python_pkg_name}-asyncio = %{version} Provides: %{python_pkg_name}-asyncio = %{version}
%if %{primary_interpreter}
Provides: python3-asyncio = %{version} Provides: python3-asyncio = %{version}
Obsoletes: python3-asyncio < %{version} Obsoletes: python3-asyncio < %{version}
%endif
# python 3.6 provides typing # python 3.6 provides typing
Provides: %{python_pkg_name}-typing = %{version} Provides: %{python_pkg_name}-typing = %{version}
%if %{primary_interpreter}
Provides: python3-typing = %{version} Provides: python3-typing = %{version}
Obsoletes: python3-typing < %{version} Obsoletes: python3-typing < %{version}
%endif
# python3-xml was merged into python3, now moved into -base # python3-xml was merged into python3, now moved into -base
Provides: %{python_pkg_name}-xml = %{version} Provides: %{python_pkg_name}-xml = %{version}
%if %{primary_interpreter}
Provides: python3-xml = %{version} Provides: python3-xml = %{version}
Obsoletes: python3-xml < %{version} Obsoletes: python3-xml < %{version}
%endif
# python-importlib-metadata was specifical project which was merged into 3.8 # python-importlib-metadata was specifical project which was merged into 3.8
Provides: %{python_pkg_name}-importlib-metadata = %{version} Provides: %{python_pkg_name}-importlib-metadata = %{version}
%if %{primary_interpreter}
Provides: python3-importlib-metadata = %{version} Provides: python3-importlib-metadata = %{version}
Obsoletes: python3-importlib-metadata < %{version} Obsoletes: python3-importlib-metadata < %{version}
%endif
# python-importlib_resources is a backport of 3.7 behaviour into older pythons # python-importlib_resources is a backport of 3.7 behaviour into older pythons
Provides: %{python_pkg_name}-importlib_resources = %{version} Provides: %{python_pkg_name}-importlib_resources = %{version}
%if %{primary_interpreter}
Provides: python3-importlib_resources = %{version} Provides: python3-importlib_resources = %{version}
Obsoletes: python3-importlib_resources < %{version} Obsoletes: python3-importlib_resources < %{version}
%endif
%description -n %{python_pkg_name}-base %description -n %{python_pkg_name}-base
Python is an interpreted, object-oriented programming language, and is Python is an interpreted, object-oriented programming language, and is
@ -315,9 +328,13 @@ database and UI toolkits support.
%package -n %{python_pkg_name}-tools %package -n %{python_pkg_name}-tools
Summary: Python Utility and Demonstration Scripts Summary: Python Utility and Demonstration Scripts
Requires: %{python_pkg_name}-base = %{version} Requires: %{python_pkg_name}-base = %{version}
%if %{primary_interpreter}
Provides: python3-demo = %{version}
Provides: python3-2to3 = %{version}
Obsoletes: python3-demo < %{version} Obsoletes: python3-demo < %{version}
Provides: %{python_pkg_name}-demo = %{version}
Obsoletes: python3-2to3 < %{version} Obsoletes: python3-2to3 < %{version}
%endif
Provides: %{python_pkg_name}-demo = %{version}
Provides: %{python_pkg_name}-2to3 = %{version} Provides: %{python_pkg_name}-2to3 = %{version}
%description -n %{python_pkg_name}-tools %description -n %{python_pkg_name}-tools
@ -513,7 +530,7 @@ export PYTHONPATH="$(pwd -P)/Lib"
%install %install
%if %{with doc} %if %{with doc}
export PDOCS=%{buildroot}%{_docdir}/python3 export PDOCS=%{buildroot}%{_docdir}/python%{python_version}
mkdir -p $PDOCS mkdir -p $PDOCS
# generated docs # generated docs
rm Doc/build/*/.buildinfo rm Doc/build/*/.buildinfo
@ -525,9 +542,9 @@ for i in Misc/* ; do
[ -f $i ] && install -c -m 644 $i $PDOCS/Misc/ [ -f $i ] && install -c -m 644 $i $PDOCS/Misc/
done done
# devhelp # devhelp
mkdir -p %{buildroot}%{_datadir}/gtk-doc/html/python3 mkdir -p %{buildroot}%{_datadir}/gtk-doc/html
cp -r Doc/build/devhelp %{buildroot}%{_datadir}/gtk-doc/html/Python cp -r Doc/build/devhelp %{buildroot}%{_datadir}/gtk-doc/html/Python%{python_version}
rm -rf %{buildroot}%{_datadir}/gtk-doc/html/Python/.doctrees rm -rf %{buildroot}%{_datadir}/gtk-doc/html/Python%{python_version}/.doctrees
%endif %endif
%if %{with general} %if %{with general}
%make_install %make_install
@ -728,14 +745,14 @@ echo %{sitedir}/_import_failed > %{buildroot}/%{sitedir}/site-packages/zzzz-impo
%if %{with doc} %if %{with doc}
%files -n %{python_pkg_name}-doc %files -n %{python_pkg_name}-doc
%dir %{_docdir}/python3 %dir %{_docdir}/python%{python_version}
%doc %{_docdir}/python3/Misc %doc %{_docdir}/python%{python_version}/Misc
%doc %{_docdir}/python3/html %doc %{_docdir}/python%{python_version}/html
%files -n %{python_pkg_name}-doc-devhelp %files -n %{python_pkg_name}-doc-devhelp
%dir %{_datadir}/gtk-doc %dir %{_datadir}/gtk-doc
%dir %{_datadir}/gtk-doc/html %dir %{_datadir}/gtk-doc/html
%doc %{_datadir}/gtk-doc/html/Python %doc %{_datadir}/gtk-doc/html/Python%{python_version}
%endif %endif
%if %{with base} %if %{with base}