From ecad68c12f58cd72b702e0c300938ad70167d824 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Marcus=20Sch=C3=A4fer?= Date: Thu, 10 Oct 2024 19:28:04 +0200 Subject: [PATCH] Fix packaging for Leap Use the right python interpreter for Leap --- .virtualenv.dev-requirements.txt | 2 +- doc/source/conf.py | 2 +- ...ython-kiwi_stackbuild_plugin-spec-template | 21 +++++++++++++------ 3 files changed, 17 insertions(+), 8 deletions(-) diff --git a/.virtualenv.dev-requirements.txt b/.virtualenv.dev-requirements.txt index fa66fd4..082692b 100644 --- a/.virtualenv.dev-requirements.txt +++ b/.virtualenv.dev-requirements.txt @@ -27,7 +27,7 @@ wheel flake8 # for building documentation -sphinx +sphinx>=5.0.0 sphinx_rtd_theme # for release diff --git a/doc/source/conf.py b/doc/source/conf.py index b72a5b3..7cc2062 100644 --- a/doc/source/conf.py +++ b/doc/source/conf.py @@ -90,7 +90,7 @@ html_theme = "sphinx_rtd_theme" -html_theme_path = [sphinx_rtd_theme.get_html_theme_path()] +# html_theme_path = [sphinx_rtd_theme.get_html_theme_path()] html_theme_options = { 'collapse_navigation': False, diff --git a/package/python-kiwi_stackbuild_plugin-spec-template b/package/python-kiwi_stackbuild_plugin-spec-template index b5c3a54..af0f61d 100644 --- a/package/python-kiwi_stackbuild_plugin-spec-template +++ b/package/python-kiwi_stackbuild_plugin-spec-template @@ -19,16 +19,25 @@ # If they aren't provided by a system installed macro, define them %{!?_defaultdocdir: %global _defaultdocdir %{_datadir}/doc} + +%if 0%{?suse_version} && 0%{?suse_version} < 1600 +%global __python3 /usr/bin/python3.11 +%global python3_pkgversion 311 +%else %{!?__python3: %global __python3 /usr/bin/python3} +%{!?python3_pkgversion:%global python3_pkgversion 3} +%endif %if %{undefined python3_sitelib} %global python3_sitelib %(%{__python3} -c "from distutils.sysconfig import get_python_lib; print(get_python_lib())") %endif -%if 0%{?el7} -%global python3_pkgversion 36 -%else -%{!?python3_pkgversion:%global python3_pkgversion 3} +%if %{undefined python3_version} +%global python3_version %(%{__python3} -Esc "import sys; sys.stdout.write('{0.major}.{0.minor}'.format(sys.version_info))") +%endif + +%if %{undefined python3_version_nodots} +%global python3_version_nodots %(%{__python3} -Esc "import sys; sys.stdout.write('{0.major}{0.minor}'.format(sys.version_info))") %endif %if 0%{?debian} || 0%{?ubuntu} @@ -85,11 +94,11 @@ image root directory %build # Build Python 3 version -python3 setup.py build +%{__python3} setup.py build %install # Install Python 3 version -python3 setup.py install --prefix=%{_prefix} --root=%{buildroot} %{?is_deb:--install-layout=deb} +%{__python3} setup.py install --prefix=%{_prefix} --root=%{buildroot} %{?is_deb:--install-layout=deb} # Install man pages and package documentation make buildroot=%{buildroot}/ docdir=%{_defaultdocdir}/ install