%global srcname aws-cli %global ptver 2.0.10 %bcond_with examples Name: %{srcname}-2 Version: 2.1.28 Release: 1%{?dist} Summary: Universal Command Line Environment for AWS, Version 2 # prompt_toolkit is BSD License: ASL 2.0 and MIT and BSD URL: https://github.com/aws/aws-cli Source0: %{url}/archive/v2/%{version}/%{name}-%{version}.tar.gz # This code hardcodes ranges of versions for what seems to be no good reason whatsoever # ... except for prompt_toolkit... aws-cli really needs v2 and nothing newer. Source1: %pypi_source prompt_toolkit %{ptver} Patch0: aws-cli-2-2.1.28-sane-versions.patch Patch1: aws-cli-2-2.1.26-prompt_toolkit2-vendored.patch BuildArch: noarch Requires: python3-botocore-2 Requires: python3-cryptography Requires: python3-s3transfer BuildRequires: python3-devel BuildRequires: python3-setuptools Recommends: groff Obsoletes: awscli <= 1 Provides: bundled(python3-prompt_toolkit) = 2.0.10 %{?python_provide:%python_provide python3-%{name}} %description This package provides version 2 of the unified command line interface to Amazon Web Services. %prep %setup -q -c -n %{name}-%{version} -a1 %patch0 -p1 -b .sane-versions %patch1 -p1 -b .pt2-vendor cd %{name} %if %{with examples} find awscli/examples/ -type f -name '*.rst' -executable -exec chmod -x '{}' + %else rm -vr awscli/examples %endif %build pushd prompt_toolkit-%{ptver} %py3_build popd cd %{name} %py3_build %install pushd prompt_toolkit-%{ptver} %py3_install popd cd %{name} %py3_install rm -vf %{buildroot}%{_bindir}/{aws_bash_completer,aws_zsh_completer.sh,aws.cmd} install -Dpm0644 bin/aws_bash_completer \ %{buildroot}%{_datadir}/bash-completion/completions/aws install -Dpm0644 bin/aws_zsh_completer.sh \ %{buildroot}%{_datadir}/zsh/site-functions/_awscli # move prompt_toolkit to the vendored dir mkdir %{buildroot}%{python3_sitelib}/awscli/vendored mv %{buildroot}%{python3_sitelib}/prompt_toolkit %{buildroot}%{python3_sitelib}/awscli/vendored/ touch %{buildroot}%{python3_sitelib}/awscli/vendored/__init__.py # nuke the pt2 egg rm -rf %{buildroot}%{python3_sitelib}/prompt_toolkit*.egg-info %files %doc %{name}/README.rst %license %{name}/LICENSE.txt %{_bindir}/aws %{_bindir}/aws_completer %{_bindir}/aws_legacy_completer %{python3_sitelib}/awscli/ %{python3_sitelib}/awscli-%{version}-*.egg-info/ %dir %{_datadir}/bash-completion %dir %{_datadir}/bash-completion/completions %{_datadir}/bash-completion/completions/aws %dir %{_datadir}/zsh %dir %{_datadir}/zsh/site-functions %{_datadir}/zsh/site-functions/_awscli %changelog * Wed Feb 24 2021 Tom Callaway - 2.1.28-1 - update to 2.1.28 * Mon Feb 15 2021 Tom Callaway - 2.1.26-2 - fix one stray prompt_toolkit reference * Mon Feb 15 2021 Tom Callaway - 2.1.26-1 - update to 2.1.26 * Fri Mar 13 2020 David Duncan - 2.0.3-2 - Modify python3-botocore dependency to python3-botocore-2 * Fri Mar 13 2020 David Duncan - 2.0.3-1 - Initial Commit for awscli version 2