diff --git a/python-spsdk.changes b/python-spsdk.changes index eb5f065..2f56333 100644 --- a/python-spsdk.changes +++ b/python-spsdk.changes @@ -1,3 +1,8 @@ +------------------------------------------------------------------- +Tue Jun 17 08:03:02 UTC 2025 - Markéta Machová + +- Convert to libalternatives + ------------------------------------------------------------------- Wed Jul 17 19:23:07 UTC 2024 - Johannes Kastl diff --git a/python-spsdk.spec b/python-spsdk.spec index 6e0ff7d..0d90a13 100644 --- a/python-spsdk.spec +++ b/python-spsdk.spec @@ -1,7 +1,7 @@ # # spec file for package python-spsdk # -# Copyright (c) 2024 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,6 +16,7 @@ # +%bcond_without libalternatives %{?sle15_python_module_pythons} Name: python-spsdk Version: 2.1.1 @@ -30,9 +31,11 @@ BuildRequires: %{python_module flit} BuildRequires: %{python_module pip} BuildRequires: %{python_module setuptools} BuildRequires: %{python_module wheel} +BuildRequires: alts BuildRequires: dos2unix BuildRequires: fdupes BuildRequires: python-rpm-macros +Requires: alts Requires: python-asn1crypto Requires: python-astunparse Requires: python-bincopy @@ -63,8 +66,6 @@ Requires: python-typing-extensions # dependency no longer required due to Patch0 # Requires: python-pypemicro BuildArch: noarch -Requires(post): update-alternatives -Requires(postun): update-alternatives %python_subpackages %description @@ -102,16 +103,13 @@ find . -type f -name README.md -exec dos2unix {} + # remove shebangs %python_expand find %{buildroot}%{$python_sitelib} -iname "*.py" -exec sed -i '1{/env python/d;}' {} + # compile all here to avoid python-bytecode-inconsistent-mtime -%python_compileall +%{python_compileall} %python_expand %fdupes %{buildroot}%{$python_sitelib} # remove unneccesary *.c and *.bin files %python_expand rm -vf %{buildroot}%{$python_sitelib}/spsdk/data/cpu_data/*.c %{buildroot}%{$python_sitelib}/spsdk/data/cpu_data/*.bin -%post -%python_install_alternative blhost ifr nxpcrypto nxpdebugmbox nxpdevhsm nxpdevscan nxpele nxpimage pfr sdphost sdpshost shadowregs spsdk tpconfig tphost dk6prog nxpmemcfg nxpwpc - -%postun -%python_uninstall_alternative blhost ifr nxpcrypto nxpdebugmbox nxpdevhsm nxpdevscan nxpele nxpimage pfr sdphost sdpshost shadowregs spsdk tpconfig tphost dk6prog nxpmemcfg nxpwpc +%pre +%python_libalternatives_reset_alternative blhost ifr nxpcrypto nxpdebugmbox nxpdevhsm nxpdevscan nxpele nxpimage pfr sdphost sdpshost shadowregs spsdk tpconfig tphost dk6prog nxpmemcfg nxpwpc %files %{python_files} %doc README.md