From f317c3edc03e6f6e6024a55e87e83994317acb9ca5781a280fe17be2c0a77deb Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Mark=C3=A9ta=20Machov=C3=A1?= Date: Wed, 4 Jun 2025 10:25:57 +0000 Subject: [PATCH] - Convert to pip-based build - Convert to libalternatives OBS-URL: https://build.opensuse.org/package/show/devel:languages:python/python-pyhcl?expand=0&rev=10 --- python-pyhcl.changes | 6 ++++++ python-pyhcl.spec | 25 ++++++++++++++----------- 2 files changed, 20 insertions(+), 11 deletions(-) diff --git a/python-pyhcl.changes b/python-pyhcl.changes index 0c4ef72..a46c199 100644 --- a/python-pyhcl.changes +++ b/python-pyhcl.changes @@ -1,3 +1,9 @@ +------------------------------------------------------------------- +Wed Jun 4 10:22:31 UTC 2025 - Markéta Machová + +- Convert to pip-based build +- Convert to libalternatives + ------------------------------------------------------------------- Thu Dec 14 21:02:54 UTC 2023 - Dirk Müller diff --git a/python-pyhcl.spec b/python-pyhcl.spec index febdca8..dea15f3 100644 --- a/python-pyhcl.spec +++ b/python-pyhcl.spec @@ -1,7 +1,7 @@ # # spec file for package python-pyhcl # -# Copyright (c) 2023 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,7 @@ # -%{?!python_module:%define python_module() python-%{**} python3-%{**}} +%bcond_without libalternatives Name: python-pyhcl Version: 0.4.5 Release: 0 @@ -24,13 +24,15 @@ Summary: HCL configuration parser for python License: MPL-2.0 URL: https://github.com/virtuald/pyhcl Source: https://files.pythonhosted.org/packages/source/p/pyhcl/pyhcl-%{version}.tar.gz +BuildRequires: %{python_module pip} BuildRequires: %{python_module pytest} BuildRequires: %{python_module setuptools} +BuildRequires: %{python_module wheel} +BuildRequires: alts BuildRequires: fdupes BuildRequires: python-rpm-macros +Requires: alts BuildArch: noarch -Requires(post): update-alternatives -Requires(postun):update-alternatives %python_subpackages %description @@ -40,26 +42,27 @@ HCL configuration parser for python %setup -q -n pyhcl-%{version} %build -%python_build +%pyproject_wheel %install -%python_install +%pyproject_install %python_expand %fdupes %{buildroot}%{$python_sitelib} %python_clone -a %{buildroot}%{_bindir}/hcltool %check %pytest -%post -%python_install_alternative hcltool +%pre +# removing old update-alternatives entries +%python_libalternatives_reset_alternative hcltool -%postun -%python_uninstall_alternative hcltool +# post and postun alternatives calls are not needed with libalternatives %files %{python_files} %doc CHANGELOG.md README.rst %license LICENSE %python_alternative %{_bindir}/hcltool -%{python_sitelib}/* +%{python_sitelib}/hcl +%{python_sitelib}/pyhcl-%{version}*-info %changelog