From 40e4f86b26a6f8151a1f11050b536c4ad9810809297a5cf2f388089fe992d3bb Mon Sep 17 00:00:00 2001 From: Robert Schweikert Date: Mon, 7 Apr 2025 19:14:15 +0000 Subject: [PATCH 1/4] - 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. OBS-URL: https://build.opensuse.org/package/show/Cloud:Tools/python-gcemetadata?expand=0&rev=11 --- python-gcemetadata.changes | 7 +++++++ python-gcemetadata.spec | 42 +++++++++++++++----------------------- 2 files changed, 24 insertions(+), 25 deletions(-) diff --git a/python-gcemetadata.changes b/python-gcemetadata.changes index 23abb67..66e9782 100644 --- a/python-gcemetadata.changes +++ b/python-gcemetadata.changes @@ -1,3 +1,10 @@ +------------------------------------------------------------------- +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..2829500 100644 --- a/python-gcemetadata.spec +++ b/python-gcemetadata.spec @@ -1,7 +1,7 @@ # -# spec file for package python3-gcemetadata +# spec file for package python-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 @@ # -%{?sle15_python_module_pythons} +%if 0%{?suse_version} >= 1600 +%define pythons %{primary_python} +%else +%define pythons python311 +%endif +%global _sitelibdir %{%{pythons}_sitelib} + %define upstream_name gcemetadata Name: python-gcemetadata Version: 1.0.4 @@ -27,16 +33,13 @@ 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: python-rpm-macros +BuildRequires: %{pythons}-pip +BuildRequires: %{pythons}-setuptools +BuildRequires: %{pythons}-wheel BuildRequires: fdupes +BuildRequires: python-rpm-macros Obsoletes: python3-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. @@ -44,32 +47,21 @@ A module for collecting instance metadata from Google Compute Engine. %prep %autosetup -p1 -n %{upstream_name}-%{version} - %build %pyproject_wheel - %install %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}%{$python_sitelib} - -%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} +%{_bindir}/%{upstream_name} %{python_sitelib}/%{upstream_name} %{python_sitelib}/%{upstream_name}-%{version}*-info -%python_alternative %{_mandir}/man1/%{upstream_name}.1%{?ext_man} +%{_mandir}/man1/%{upstream_name}.1%{?ext_man} %changelog From b50412bd2b4203e0d38ce3ed28d6a970e00ca71631e975fea105153515cf3b04 Mon Sep 17 00:00:00 2001 From: Robert Schweikert Date: Tue, 8 Apr 2025 20:19:55 +0000 Subject: [PATCH 2/4] - Switch te SLE 15 build setup to also use a macro instead of referencing the Python 3.11 interpreter directly. OBS-URL: https://build.opensuse.org/package/show/Cloud:Tools/python-gcemetadata?expand=0&rev=12 --- python-gcemetadata.changes | 6 ++++++ python-gcemetadata.spec | 2 +- 2 files changed, 7 insertions(+), 1 deletion(-) diff --git a/python-gcemetadata.changes b/python-gcemetadata.changes index 66e9782..0fb95c9 100644 --- a/python-gcemetadata.changes +++ b/python-gcemetadata.changes @@ -1,3 +1,9 @@ +------------------------------------------------------------------- +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 diff --git a/python-gcemetadata.spec b/python-gcemetadata.spec index 2829500..0e71ff1 100644 --- a/python-gcemetadata.spec +++ b/python-gcemetadata.spec @@ -19,7 +19,7 @@ %if 0%{?suse_version} >= 1600 %define pythons %{primary_python} %else -%define pythons python311 +%{?sle15_python_module_pythons} %endif %global _sitelibdir %{%{pythons}_sitelib} From 8d1bb4eea2863a2d7731c7766a30f84630f6200a668cf120a6ab1bf2239a2e92 Mon Sep 17 00:00:00 2001 From: Robert Schweikert Date: Thu, 17 Apr 2025 14:33:26 +0000 Subject: [PATCH 3/4] use the defined sitelibdir to get th eproper python location OBS-URL: https://build.opensuse.org/package/show/Cloud:Tools/python-gcemetadata?expand=0&rev=13 --- python-gcemetadata.spec | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/python-gcemetadata.spec b/python-gcemetadata.spec index 0e71ff1..98b56b7 100644 --- a/python-gcemetadata.spec +++ b/python-gcemetadata.spec @@ -32,7 +32,6 @@ License: GPL-3.0-or-later Group: System/Management URL: https://github.com/SUSE/Enceladus Source0: %{upstream_name}-%{version}.tar.bz2 -Requires: python BuildRequires: %{pythons}-pip BuildRequires: %{pythons}-setuptools BuildRequires: %{pythons}-wheel @@ -54,14 +53,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 -%fdupes %{buildroot}%{$python_sitelib} +%fdupes %{buildroot}%{_sitelibdir} %files %doc README.md %license LICENSE %{_bindir}/%{upstream_name} -%{python_sitelib}/%{upstream_name} -%{python_sitelib}/%{upstream_name}-%{version}*-info +%{_sitelibdir}/%{upstream_name} +%{_sitelibdir}/%{upstream_name}-%{version}*-info %{_mandir}/man1/%{upstream_name}.1%{?ext_man} %changelog From 3b74aafdcd2b9e320681b4ad299f1af6d7a243bc7ed54810f3a212d18864bf2f Mon Sep 17 00:00:00 2001 From: Robert Schweikert Date: Fri, 18 Apr 2025 11:55:00 +0000 Subject: [PATCH 4/4] deal with the complications in Factory OBS-URL: https://build.opensuse.org/package/show/Cloud:Tools/python-gcemetadata?expand=0&rev=14 --- python-gcemetadata.spec | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/python-gcemetadata.spec b/python-gcemetadata.spec index 98b56b7..d60e906 100644 --- a/python-gcemetadata.spec +++ b/python-gcemetadata.spec @@ -38,6 +38,10 @@ BuildRequires: %{pythons}-wheel BuildRequires: fdupes BuildRequires: python-rpm-macros Obsoletes: python3-gcemetadata < %{version} +Obsoletes: python310-gcemetadata < %{version} +Obsoletes: python311-gcemetadata < %{version} +Obsoletes: python312-gcemetadata < %{version} +Obsoletes: python313-gcemetadata < %{version} BuildArch: noarch %description