File aws-cli.spec of Package aws-cli

# spec file for package aws-cli
# Copyright (c) 2020 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

Name:           aws-cli
Version:        1.18.38
Release:        0
Summary:        Amazon Web Services Command Line Interface
License:        Apache-2.0
Group:          System/Management
Source0:        %{name}-%{version}.tar.gz
Patch0:         hide_py_pckgmgmt.patch
BuildRequires:  fdupes
Requires:       groff
Provides:       awscli = %{version}
BuildArch:      noarch
%if 0%{?suse_version} && 0%{?suse_version} > 1315
BuildRequires:  python3-devel
BuildRequires:  python3-setuptools
Requires:       python3
Requires:       python3-PyYAML <= 6.0.0
Requires:       python3-PyYAML >= 3.10
Requires:       python3-botocore >= 1.15.38
Requires:       python3-colorama <= 0.4.4
Requires:       python3-colorama >= 0.2.5
Requires:       python3-docutils >= 0.10
Requires:       python3-rsa < 5.0.0
Requires:       python3-rsa >= 3.1.2
Requires:       python3-s3transfer < 0.4.0
Requires:       python3-s3transfer >= 0.3.0
Requires:       python3-six
BuildRequires:  bash-completion
BuildRequires:  python-devel
BuildRequires:  python-setuptools
Requires:       python
Requires:       python-PyYAML <= 3.13
Requires:       python-PyYAML >= 3.10
Requires:       python-botocore >= 1.12.93
Requires:       python-colorama <= 0.3.9
Requires:       python-colorama >= 0.2.5
Requires:       python-docutils >= 0.10
Requires:       python-rsa <= 3.5.0
Requires:       python-rsa >= 3.1.2
Requires:       python-s3transfer < 0.4.0
Requires:       python-s3transfer >= 0.3.0
Requires:       python-six

The AWS Command Line Interface (CLI) is a unified tool to manage AWS
services. With this tool, multiple AWS services can be controlled
from the command line and automated through scripts.

%setup -q
sed -i 's/from botocore\.vendored //' awscli/customizations/
sed -i 's/botocore\.vendored\.//' awscli/customizations/configure/

%if 0%{?suse_version} && 0%{?suse_version} > 1315
python3 build
python build

%if 0%{?suse_version} && 0%{?suse_version} > 1315
python3 install --prefix=%{_prefix} --root=%{buildroot} --install-scripts=%{_bindir}
%fdupes %{buildroot}%{python3_sitelib}
find %{buildroot}%{python3_sitelib}/awscli/examples -type f -exec chmod 644 {} \;
python install --prefix=%{_prefix} --root=%{buildroot} --install-scripts=%{_bindir}
%fdupes %{buildroot}%{python_sitelib}
find %{buildroot}%{python_sitelib}/awscli/examples -type f -exec chmod 644 {} \;
# 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}/ %{buildroot}%{_sysconfdir}/zsh_completion.d/_aws

%license LICENSE.txt
%if 0%{?suse_version} && 0%{?suse_version} > 1315
%dir %{python3_sitelib}/awscli
%dir %{python3_sitelib}/awscli-%{version}-py%{py3_ver}.egg-info
%dir %{python_sitelib}/awscli
%dir %{python_sitelib}/awscli-%{version}-py%{py_ver}.egg-info
%exclude %{_bindir}/aws_bash_completer
%exclude %{_bindir}/

openSUSE Build Service is sponsored by