summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorCoprDistGit <infra@openeuler.org>2024-08-01 12:54:59 +0000
committerCoprDistGit <infra@openeuler.org>2024-08-01 12:54:59 +0000
commitd6c40274229b628f21b1e3e1da28fae422839d27 (patch)
tree634507cc8a092ac7755b1c2d1246b46519c0828a
parent7752cf16e160191cee4a03c74ea31bbfd8002357 (diff)
automatic import of awscli2openeuler24.03_LTSopeneuler23.09
-rw-r--r--.gitignore1
-rw-r--r--awscli2.spec134
-rw-r--r--sources1
3 files changed, 136 insertions, 0 deletions
diff --git a/.gitignore b/.gitignore
index e69de29..04b91d1 100644
--- a/.gitignore
+++ b/.gitignore
@@ -0,0 +1 @@
+/aws-cli-2.15.31.tar.gz
diff --git a/awscli2.spec b/awscli2.spec
new file mode 100644
index 0000000..73a655f
--- /dev/null
+++ b/awscli2.spec
@@ -0,0 +1,134 @@
+%bcond tests 1
+
+%global pkgname aws-cli
+
+Name: awscli2
+Version: 2.15.31
+Release: 3%{?dist}
+
+Summary: Universal Command Line Environment for AWS, version 2
+# all files are licensed under Apache-2.0, except:
+# - awscli/topictags.py is MIT
+# - awscli/botocore/vendored/six.py is MIT
+License: Apache-2.0 AND MIT
+URL: https://github.com/aws/aws-cli/tree/v2
+Source0: https://github.com/aws/aws-cli/archive/%{version}/%{pkgname}-%{version}.tar.gz
+
+BuildArch: noarch
+
+BuildRequires: python3-devel
+BuildRequires: python-unversioned-command
+BuildRequires: procps-ng
+
+# Needed for paging output from awscli2. See RHEL-14523.
+Requires: less
+
+Recommends: groff
+
+Provides: bundled(python3dist(botocore)) = 2.0.0
+Provides: bundled(python3dist(s3transfer)) = 0.5.1
+
+Provides: awscli = %{version}-%{release}
+Obsoletes: awscli < 2
+
+# provide an upgrade path from awscli-2 (Amazon Linux)
+Provides: awscli-2 = %{version}-%{release}
+Obsoletes: awscli-2 < %{version}-%{release}
+
+# python-awscrt does not build on s390x
+ExcludeArch: s390x
+
+
+%description
+This package provides version 2 of the unified command line
+interface to Amazon Web Services.
+
+
+%prep
+%autosetup -p1 -n %{pkgname}-%{version}
+
+# fix permissions
+find awscli/examples/ -type f -name '*.rst' -executable -exec chmod -x '{}' +
+
+# remove version caps on dependencies
+sed -i 's/,<=\?[^"]*"/"/' pyproject.toml
+
+# use unittest.mock
+find -type f -name '*.py' -exec sed \
+ -e 's/^\( *\)import mock$/\1from unittest import mock/' \
+ -e 's/^\( *\)from mock import mock/\1from unittest import mock/' \
+ -e 's/^\( *\)from mock import/\1from unittest.mock import/' \
+ -i '{}' +
+
+# RHEL does not run coverage tests.
+# mock is deprecated in RHEL. We use unittest.mock.
+# pip-tools is not used directly by the unit tests.
+# pytest-xdist is unwanted in RHEL.
+sed \
+ -e 's|==.*||' \
+ -e '/coverage/d' \
+ -e '/mock/d' \
+ -e '/pip-tools/d' \
+ -e '/pytest-cov/d' \
+ %{?rhel:-e '/pytest-xdist/d'} \
+ requirements-test.txt > _requirements-test.txt
+
+
+%generate_buildrequires
+%pyproject_buildrequires _requirements-test.txt
+
+
+%build
+%pyproject_wheel
+
+
+%install
+%pyproject_install
+%pyproject_save_files awscli
+
+# remove unnecessary scripts
+rm -vf %{buildroot}%{_bindir}/{aws_bash_completer,aws_zsh_completer.sh,aws.cmd}
+
+# install shell completion
+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
+
+
+%check
+# it appears that some tests modify the environment and remove PYTHONPATH
+# so it's not passed to botocore cmd-runner, inject it here
+sed -i '/self.driver.start(env=env)/i \ \ \ \ \ \ \ \ env["PYTHONPATH"] = "%{buildroot}%{python3_sitelib}"' \
+ tests/utils/botocore/__init__.py
+
+export TESTS_REMOVE_REPO_ROOT_FROM_PATH=1 TZ=UTC
+%if 0%{?rhel}
+export OPENSSL_ENABLE_SHA1_SIGNATURES=yes
+%endif
+%pytest --verbose %{!?rhel:--numprocesses=auto --dist=loadfile --maxprocesses=4} \
+ --disable-pytest-warnings -Wd \
+ tests/unit tests/functional \
+ --ignore tests/functional/autocomplete/test_completion_files.py \
+ --ignore tests/functional/botocore/test_waiter_config.py
+
+
+%files -f %{pyproject_files}
+%license LICENSE.txt
+%doc README.rst
+%{_bindir}/aws
+%{_bindir}/aws_completer
+%{_datadir}/bash-completion/completions/aws
+%{_datadir}/zsh/site-functions/_awscli
+
+
+%changelog
+* Fri May 31 2024 Major Hayden <major@redhat.com> - 2.15.31-3
+- Add less to install requirements for paging output. Resolves RHEL-14523.
+
+* Thu May 09 2024 Major Hayden <major@redhat.com> - 2.15.31-2
+- Remove colorama patches
+- Bring in the latest updates from Fedora
+
+* Wed Jan 31 2024 Major Hayden <major@redhat.com> - 2.15.31-1
+- Initial RHEL 9 package.
diff --git a/sources b/sources
new file mode 100644
index 0000000..ac6290a
--- /dev/null
+++ b/sources
@@ -0,0 +1 @@
+9a9b2800c5fa73dbfb76aa1635a1d205 aws-cli-2.15.31.tar.gz