117 lines
5.0 KiB
Ruby
117 lines
5.0 KiB
Ruby
class AwscliAT1 < Formula
|
|
include Language::Python::Virtualenv
|
|
|
|
desc "Official Amazon AWS command-line interface"
|
|
homepage "https://aws.amazon.com/cli/"
|
|
# awscli should only be updated every 10 releases on multiples of 10
|
|
url "https://files.pythonhosted.org/packages/cf/1d/340d779a0696f1a6e4a8fbfd2e1b2fa2b1752743d603b6977595fdb48c72/awscli-1.25.30.tar.gz"
|
|
sha256 "9a049a0bde495954c14676ec2750a1acaf00240e4bc53282acc6db0a40ee748b"
|
|
license "Apache-2.0"
|
|
|
|
livecheck do
|
|
url "https://github.com/aws/aws-cli.git"
|
|
regex(/^v?(1(?:\.\d+)+)$/i)
|
|
end
|
|
|
|
bottle do
|
|
sha256 cellar: :any, arm64_monterey: "b2eb16a1fa8b78a474c37fff5aa8b320703789d27ea4a4e6f0323a35ed3bbb2a"
|
|
sha256 cellar: :any, arm64_big_sur: "77860de764ac9b22cba41627d3d1dfd4d37957792d737cffd192b0fe3d96248a"
|
|
sha256 cellar: :any, monterey: "7f6f9f7bed57971c7f88b7b25a958d891cb81d57654aa637a4530c62bc4ce900"
|
|
sha256 cellar: :any, big_sur: "0bc8e1bc906f178060c72db35b1b037ee4089b3efdf9f850dfa1307a1b741089"
|
|
sha256 cellar: :any, catalina: "ad21532832c76117c4fd782199964d30190b8744c2bb73331544d19b81fdbe7a"
|
|
sha256 cellar: :any_skip_relocation, x86_64_linux: "79eb754a86d8f5c3c756038c09302a5d0cdd00800c1be6d89937606da75395a6"
|
|
end
|
|
|
|
keg_only :versioned_formula
|
|
|
|
depends_on "libyaml" # for faster PyYAML
|
|
# Some AWS APIs require TLS1.2, which system Python doesn't have before High Sierra
|
|
depends_on "python@3.9"
|
|
depends_on "six"
|
|
|
|
uses_from_macos "groff"
|
|
|
|
resource "botocore" do
|
|
url "https://files.pythonhosted.org/packages/c1/b9/c0bba321431b8e4823e53c4e09295df20743f930d0aedb6b20dce6e1b9d8/botocore-1.27.30.tar.gz"
|
|
sha256 "35897569bf5f80b935f7381f6b0d1580ee0f6a94e3c568faca9ce6603391c829"
|
|
end
|
|
|
|
resource "colorama" do
|
|
url "https://files.pythonhosted.org/packages/1f/bb/5d3246097ab77fa083a61bd8d3d527b7ae063c7d8e8671b1cf8c4ec10cbe/colorama-0.4.4.tar.gz"
|
|
sha256 "5941b2b48a20143d2267e95b1c2a7603ce057ee39fd88e7329b0c292aa16869b"
|
|
end
|
|
|
|
resource "docutils" do
|
|
url "https://files.pythonhosted.org/packages/2f/e0/3d435b34abd2d62e8206171892f174b180cd37b09d57b924ca5c2ef2219d/docutils-0.16.tar.gz"
|
|
sha256 "c2de3a60e9e7d07be26b7f2b00ca0309c207e06c100f9cc2a94931fc75a478fc"
|
|
end
|
|
|
|
resource "jmespath" do
|
|
url "https://files.pythonhosted.org/packages/00/2a/e867e8531cf3e36b41201936b7fa7ba7b5702dbef42922193f05c8976cd6/jmespath-1.0.1.tar.gz"
|
|
sha256 "90261b206d6defd58fdd5e85f478bf633a2901798906be2ad389150c5c60edbe"
|
|
end
|
|
|
|
resource "pyasn1" do
|
|
url "https://files.pythonhosted.org/packages/a4/db/fffec68299e6d7bad3d504147f9094830b704527a7fc098b721d38cc7fa7/pyasn1-0.4.8.tar.gz"
|
|
sha256 "aef77c9fb94a3ac588e87841208bdec464471d9871bd5050a287cc9a475cd0ba"
|
|
end
|
|
|
|
resource "python-dateutil" do
|
|
url "https://files.pythonhosted.org/packages/4c/c4/13b4776ea2d76c115c1d1b84579f3764ee6d57204f6be27119f13a61d0a9/python-dateutil-2.8.2.tar.gz"
|
|
sha256 "0123cacc1627ae19ddf3c27a5de5bd67ee4586fbdd6440d9748f8abb483d3e86"
|
|
end
|
|
|
|
resource "PyYAML" do
|
|
url "https://files.pythonhosted.org/packages/a0/a4/d63f2d7597e1a4b55aa3b4d6c5b029991d3b824b5bd331af8d4ab1ed687d/PyYAML-5.4.1.tar.gz"
|
|
sha256 "607774cbba28732bfa802b54baa7484215f530991055bb562efbed5b2f20a45e"
|
|
end
|
|
|
|
resource "rsa" do
|
|
url "https://files.pythonhosted.org/packages/db/b5/475c45a58650b0580421746504b680cd2db4e81bc941e94ca53785250269/rsa-4.7.2.tar.gz"
|
|
sha256 "9d689e6ca1b3038bc82bf8d23e944b6b6037bc02301a574935b2dd946e0353b9"
|
|
end
|
|
|
|
resource "s3transfer" do
|
|
url "https://files.pythonhosted.org/packages/e1/eb/e57c93d5cd5edf8c1d124c831ef916601540db70acd96fa21fe60cef1365/s3transfer-0.6.0.tar.gz"
|
|
sha256 "2ed07d3866f523cc561bf4a00fc5535827981b117dd7876f036b0c1aca42c947"
|
|
end
|
|
|
|
resource "urllib3" do
|
|
url "https://files.pythonhosted.org/packages/25/36/f056e5f1389004cf886bb7a8514077f24224238a7534497c014a6b9ac770/urllib3-1.26.10.tar.gz"
|
|
sha256 "879ba4d1e89654d9769ce13121e0f94310ea32e8d2f8cf587b77c08bbcdb30d6"
|
|
end
|
|
|
|
def install
|
|
# setuptools>=60 prefers its own bundled distutils, which is incompatabile with docutils~=0.15
|
|
# Force the previous behavior of using distutils from the stdlib
|
|
# Remove when fixed upstream: https://github.com/aws/aws-cli/pull/6011
|
|
with_env(SETUPTOOLS_USE_DISTUTILS: "stdlib") do
|
|
virtualenv_install_with_resources
|
|
end
|
|
pkgshare.install "awscli/examples"
|
|
|
|
rm Dir["#{bin}/{aws.cmd,aws_bash_completer,aws_zsh_completer.sh}"]
|
|
bash_completion.install "bin/aws_bash_completer"
|
|
zsh_completion.install "bin/aws_zsh_completer.sh"
|
|
(zsh_completion/"_aws").write <<~EOS
|
|
#compdef aws
|
|
_aws () {
|
|
local e
|
|
e=$(dirname ${funcsourcetrace[1]%:*})/aws_zsh_completer.sh
|
|
if [[ -f $e ]]; then source $e; fi
|
|
}
|
|
EOS
|
|
end
|
|
|
|
def caveats
|
|
<<~EOS
|
|
The "examples" directory has been installed to:
|
|
#{HOMEBREW_PREFIX}/share/awscli/examples
|
|
EOS
|
|
end
|
|
|
|
test do
|
|
assert_match "topics", shell_output("#{bin}/aws help")
|
|
end
|
|
end
|