From 0d75adf0856c4581e669d2b412355b473bb03c0039fdf3fc0b274b1d79adb90d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Adrian=20Schr=C3=B6ter?= Date: Wed, 23 Apr 2025 23:53:43 +0200 Subject: [PATCH] Sync from SUSE:SLFO:Main python-gcemetadata revision 55c81514af639679ef7077fc65c22c9c --- python-gcemetadata.changes | 13 ++++++++++++ python-gcemetadata.spec | 43 ++++++++++++++++++-------------------- 2 files changed, 33 insertions(+), 23 deletions(-) diff --git a/python-gcemetadata.changes b/python-gcemetadata.changes index 23abb67..0fb95c9 100644 --- a/python-gcemetadata.changes +++ b/python-gcemetadata.changes @@ -1,3 +1,16 @@ +------------------------------------------------------------------- +Tue Apr 8 20:18:43 UTC 2025 - Robert Schweikert + +- Switch te SLE 15 build setup to also use a macro instead of referencing + the Python 3.11 interpreter directly. + +------------------------------------------------------------------- +Mon Apr 7 19:12:27 UTC 2025 - Robert Schweikert + +- Switch to a defined Python interpreter. Use the primary interpreter + in SLE 16 and later distribution and Python 3.11 for SLE 15 SP4 and + later. + ------------------------------------------------------------------- Mon Jul 22 19:08:19 UTC 2024 - Robert Schweikert diff --git a/python-gcemetadata.spec b/python-gcemetadata.spec index 7fa2991..1d358dc 100644 --- a/python-gcemetadata.spec +++ b/python-gcemetadata.spec @@ -1,7 +1,7 @@ # # spec file for package python3-gcemetadata # -# Copyright (c) 2020 SUSE LLC +# Copyright (c) 2025 SUSE LLC # # All modifications and additions to the file contributed by third parties # remain the property of their copyright owners, unless otherwise agreed @@ -16,7 +16,13 @@ # +%if 0%{?suse_version} >= 1600 +%define pythons %{primary_python} +%else %{?sle15_python_module_pythons} +%endif +%global _sitelibdir %{%{pythons}_sitelib} + %define upstream_name gcemetadata Name: python-gcemetadata Version: 1.0.4 @@ -26,17 +32,17 @@ License: GPL-3.0-or-later Group: System/Management URL: https://github.com/SUSE/Enceladus Source0: %{upstream_name}-%{version}.tar.bz2 -Requires: python -BuildRequires: %{python_module setuptools} -BuildRequires: %{python_module pip} -BuildRequires: %{python_module wheel} +BuildRequires: %{pythons}-setuptools +BuildRequires: %{pythons}-pip +BuildRequires: %{pythons}-wheel BuildRequires: python-rpm-macros BuildRequires: fdupes Obsoletes: python3-gcemetadata < %{version} +Obsoletes: python310-gcemetadata < %{version} +Obsoletes: python311-gcemetadata < %{version} +Obsoletes: python312-gcemetadata < %{version} +Obsoletes: python313-gcemetadata < %{version} BuildArch: noarch -Requires(post): update-alternatives -Requires(postun): update-alternatives -%python_subpackages %description A module for collecting instance metadata from Google Compute Engine. @@ -53,23 +59,14 @@ A module for collecting instance metadata from Google Compute Engine. %pyproject_install install -d -m 755 %{buildroot}/%{_mandir}/man1 install -m 644 man/man1/gcemetadata.1 %{buildroot}/%{_mandir}/man1 -%python_clone -a %{buildroot}%{_bindir}/%{upstream_name} -%python_clone -a %{buildroot}%{_mandir}/man1/gcemetadata.1 -%python_expand %fdupes %{buildroot}%{$python_sitelib} +%fdupes %{buildroot}%{_sitelibdir} - -%post -%python_install_alternative gcemetadata gcemetadata.1%{?ext_man} - -%postun -%python_uninstall_alternative gcemetadata - -%files %{python_files} +%files %doc README.md %license LICENSE -%python_alternative %{_bindir}/%{upstream_name} -%{python_sitelib}/%{upstream_name} -%{python_sitelib}/%{upstream_name}-%{version}*-info -%python_alternative %{_mandir}/man1/%{upstream_name}.1%{?ext_man} +%{_bindir}/%{upstream_name} +%{_sitelibdir}/%{upstream_name} +%{_sitelibdir}/%{upstream_name}-%{version}*-info +%{_mandir}/man1/%{upstream_name}.1%{?ext_man} %changelog