# # spec file for package az-cli-cmd # # 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 # upon. The license for this file, and modifications and additions to the # file, is the same license as for the pristine package itself (unless the # license for the pristine package is not an Open Source License, in which # case the license is the MIT License). An "Open Source License" is a # license that conforms to the Open Source Definition (Version 1.9) # published by the Open Source Initiative. # Please submit bugfixes or comments via https://bugs.opensuse.org/ # %if 0%{?suse_version} >= 1600 %define pythons python313 %else %define pythons python311 %endif %global _sitelibdir %{%{pythons}_sitelib} Name: az-cli-cmd # We want the version to match the az-cli version we ship Version: 1.37.1 Release: 0 Summary: Amazon Web Services Command Line Interface License: Apache-2.0 Group: System/Management URL: some-github-project Provides: azcli = %{version} # Upgrade the system installed azure-cli package in SLE 15 to the new way of # packaging the cli Provides: azure-cli = %{version} Obsoletes: azure-cli < %{version} BuildArch: noarch # Package requirements on the system Requires: ca-certificates Requires: flake-pilot Requires: flake-pilot-podman # Package requirements from runtime container Requires: (%{pythons}-PyYAML >= 3.10 with %{pythons}-PyYAML <= 6.1) Requires: (%{pythons}-colorama >= 0.2.5 with %{pythons}-colorama <= 0.5.0) Requires: (%{pythons}-docutils >= 0.10 with %{pythons}-docutils < 0.30) Requires: (%{pythons}-rsa >= 3.1.2 with %{pythons}-rsa < 5.0.0) Requires: %{pythons}-six Requires: %{pythons}-jmespath Requires: %{pythons}-python-dateutil Requires: %{pythons}-requests Requires: %{pythons}-Fabric Requires: %{pythons}-PyGithub Requires: %{pythons}-antlr4-python3-runtime Requires: %{pythons}-avro Requires: %{pythons}-capturer Requires: %{pythons}-coloredlogs Requires: %{pythons}-fixedint Requires: %{pythons}-humanfriendly Requires: %{pythons}-javaproperties Requires: %{pythons}-jsondiff Requires: %{pythons}-knack Requires: %{pythons}-pycomposefile Requires: %{pythons}-pydash Requires: %{pythons}-retrying Requires: %{pythons}-scp Requires: %{pythons}-semver Requires: %{pythons}-sshtunnel Requires: %{pythons}-strictyaml Requires: %{pythons}-verboselogs Requires: %{pythons}-zipp Requires: %{pythons}-py-deviceid Requires: %{pythons}-pluggy Requires: %{pythons}-mmh3 Requires: %{pythons}-iniconfig Requires: %{pythons}-dill Requires: %{pythons}-importlib-metadata Requires: %{pythons}-pytest Requires: %{pythons}-isort Requires: %{pythons}-syrupy Requires: %{pythons}-yarg # Dependent containers Requires: az-cli-image Requires: az-sdk-image >= 0.1.9 %description The Azure Command Line Interface (CLI) is a unified tool to manage Azure services. With this tool, multiple Azure services can be controlled from the command line and automated through scripts. %prep %build %post # The flake-ctl command comlains if the script to be created already exists. # Remove the script from previous installations if [ -L /usr/bin/az ] ; then rm /usr/bin/az fi if [ "$YAST_IS_RUNNING" != "instsys" ] ; then flake-ctl podman register \ --app /usr/bin/az \ --container localhost/az-cli \ --base localhost/az-sdk \ --check-host-dependencies \ --opt "\--interactive" \ --opt "\--security-opt label=disable" \ --opt "\--volume %HOME:/root" \ --opt "\--volume /var/lib/ca-certificates:/var/lib/ca-certificates" \ --opt "\-e HOME=/root" # bsc#1253743 older packages did not differentiate between upgrade # and package removal as such on upgrade the command disappeared. # Save the newly registered flake and restore it posttrans if it was # deleted by the postun in th eold package. # Remove this hack on or after 2026-11-30 if [ "$1" -ge 2 ]; then cp -P /usr/bin/az /usr/bin/az.bck cp /usr/share/flakes/az.yaml /usr/share/flakes/az.yaml.bck fi fi %postun if [ "$YAST_IS_RUNNING" != "instsys" ] ; then if [ "$1" -eq 0 ]; then flake-ctl podman remove --app /usr/bin/az fi fi %posttrans # bsc#1253743 older packages did not differentiate between upgrade # and package removal as such on upgrade the command disappeared. # Restore the command set up in post of this package if it got wiped # out by the postun of the old package. # The posttrans can be removed on or after 2026-11-30 if [ ! -f /usr/bin/az ] && [ -f /usr/bin/az.bck ]; then echo "Restoring az command" cp -P /usr/bin/az.bck /usr/bin/az mv /usr/share/flakes/az.yaml.bck /usr/share/flakes/az.yaml rm /usr/bin/az.bck fi %files %ghost %{_bindir}/az