16
0

Accepting request 1270818 from Cloud:Tools

- Switch te SLE 15 build setup to also use a macro instead of referencing
  the Python 3.11 interpreter directly.

- 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/request/show/1270818
OBS-URL: https://build.opensuse.org/package/show/openSUSE:Factory/python-gcemetadata?expand=0&rev=2
This commit is contained in:
2025-04-20 07:34:57 +00:00
committed by Git OBS Bridge
2 changed files with 35 additions and 27 deletions

View File

@@ -1,3 +1,16 @@
-------------------------------------------------------------------
Tue Apr 8 20:18:43 UTC 2025 - Robert Schweikert <rjschwei@suse.com>
- 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 <rjschwei@suse.com>
- 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 <rjschwei@suse.com>

View File

@@ -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 @@
#
%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: python-rpm-macros
BuildRequires: %{pythons}-pip
BuildRequires: %{pythons}-setuptools
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
Requires(post): update-alternatives
Requires(postun): update-alternatives
%python_subpackages
%description
A module for collecting instance metadata from Google Compute Engine.
@@ -44,32 +50,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}%{_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