File project.diff of Package aws-cli

--- aws-cli.spec.orig
+++ aws-cli.spec
@@ -1,7 +1,7 @@
 #
 # spec file for package aws-cli
 #
-# 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,11 +16,20 @@
 #
 
 
+%bcond_without venv
+
 %if 0%{?suse_version} >= 1600
 %define pythons %{primary_python}
 %else
 %define pythons python311
 %endif
+
+%if %{with venv}
+%define pythons python3
+%define _venv %{_libexecdir}/python-isolated
+%define __python3 %{_venv}/bin/python3
+%endif
+
 %global _sitelibdir %{%{pythons}_sitelib}
 
 Name:           aws-cli
@@ -50,6 +59,11 @@ Requires:       (%{pythons}-docutils >=
 Requires:       (%{pythons}-rsa >= 3.1.2 with %{pythons}-rsa < 5.0.0)
 Requires:       (%{pythons}-s3transfer >= 0.10.0 with %{pythons}-s3transfer < 0.11.0)
 
+%if %{with venv}
+BuildRequires:  python-obs-build-env
+Requires:       python-obs-build-env
+%endif
+
 %description
 The AWS Command Line Interface (CLI) is a unified tool to manage AWS
 services. With this tool, multiple AWS services can be controlled
@@ -67,11 +81,21 @@ sed -i 's/botocore\.vendored\.//' awscli
 %pyproject_install
 %python_expand %fdupes %{buildroot}%{$python_sitelib}
 find %{buildroot}%{_sitelibdir}/awscli/examples -type f -exec chmod 644 {} \;
+
+%if %{with venv}
+rm %{buildroot}/%{_venv}/bin/aws.cmd
+install -DTm644 %{buildroot}/%{_venv}/bin/aws_bash_completer %{buildroot}%{_datadir}/bash-completion/completions/aws
+install -DTm644 %{buildroot}/%{_venv}/bin/aws_zsh_completer.sh %{buildroot}%{_sysconfdir}/zsh_completion.d/_aws
+
+install -DTm755 %{buildroot}/%{_venv}/bin/aws %{buildroot}%{_bindir}/aws
+install -DTm755 %{buildroot}/%{_venv}/bin/aws_completer %{buildroot}%{_bindir}/aws_completer
+%else
 # No DOS crap
 rm %{buildroot}/%{_bindir}/aws.cmd
 # Shell completion
 install -DTm644 %{buildroot}%{_bindir}/aws_bash_completer %{buildroot}%{_datadir}/bash-completion/completions/aws
 install -DTm644 %{buildroot}%{_bindir}/aws_zsh_completer.sh %{buildroot}%{_sysconfdir}/zsh_completion.d/_aws
+%endif
 
 %files
 %defattr(-, root, root)
@@ -83,8 +107,12 @@ install -DTm644 %{buildroot}%{_bindir}/a
 %{_sitelibdir}/awscli-%{version}*-info/*
 %{_bindir}/aws
 %{_bindir}/aws_completer
+%if %{with venv}
+%exclude %{_venv}/bin/*
+%else
 %exclude %{_bindir}/aws_bash_completer
 %exclude %{_bindir}/aws_zsh_completer.sh
+%endif
 %{_datadir}/bash-completion/completions/aws
 %dir %{_sysconfdir}/zsh_completion.d
 %config %attr(644,root,root) %{_sysconfdir}/zsh_completion.d/_aws
openSUSE Build Service is sponsored by