homebrew-core/Formula/awscli@1.rb

112 lines
4.7 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/e6/c7/2a595b4fb638f9903cc144e00a033475684658397fd37d32a9e9b4bd4b7b/awscli-1.22.30.tar.gz"
sha256 "48cacf396ec3cfae82e64844d0bddd156e676679cc41df4934571e87a092de15"
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: "2fdf487a2420b3493b3b7fdfef8d0fc3122eb14f38a44200eda5b103d6cb398f"
sha256 cellar: :any, arm64_big_sur: "0da48b2815d9bf5bad0605e6b6c1d6e11926aa98f19312dc92e5fd051971d30f"
sha256 cellar: :any, monterey: "1918c09e3b5a165aa1f12d0df505f129f69ce421c24f5958029241ba313ed84b"
sha256 cellar: :any, big_sur: "290561ef1e310c07c1fd03166e1352f59add82227e846572d9ca9dfac82b54d9"
sha256 cellar: :any, catalina: "f2fd8c828e0b1fa204dce3a9fb4aec2a2ddda4043609a38f8da177df823bb281"
sha256 cellar: :any_skip_relocation, x86_64_linux: "147e778a13588798f7b70183ee383a1c2276db1fe9619c2f482b412aaed943b2"
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/af/eb/defb1a74e7d3b0a62b5d4688a661d6ac9f1b1593182fa1470a6916730eb0/botocore-1.23.30.tar.gz"
sha256 "c6a60cffe095296b78ff03adae0fdf2875210a74531a0d1f68206091203573fe"
end
resource "colorama" do
url "https://files.pythonhosted.org/packages/82/75/f2a4c0c94c85e2693c229142eb448840fba0f9230111faa889d1f541d12d/colorama-0.4.3.tar.gz"
sha256 "e96da0d330793e2cb9485e9ddfd918d456036c7149416295932478192f4436a1"
end
resource "docutils" do
url "https://files.pythonhosted.org/packages/93/22/953e071b589b0b1fee420ab06a0d15e5aa0c7470eb9966d60393ce58ad61/docutils-0.15.2.tar.gz"
sha256 "a2aeea129088da402665e92e0b25b04b073c04b2dce4ab65caaa38b7ce2e1a99"
end
resource "jmespath" do
url "https://files.pythonhosted.org/packages/3c/56/3f325b1eef9791759784aa5046a8f6a1aff8f7c898a2e34506771d3b99d8/jmespath-0.10.0.tar.gz"
sha256 "b85d0567b8666149a93172712e68920734333c0ce7e89b78b3e987f71e5ed4f9"
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/88/ef/4d1b3f52ae20a7e72151fde5c9f254cd83f8a49047351f34006e517e1655/s3transfer-0.5.0.tar.gz"
sha256 "50ed823e1dc5868ad40c8dc92072f757aa0e653a192845c94a3b676f4a62da4c"
end
resource "urllib3" do
url "https://files.pythonhosted.org/packages/b0/b1/7bbf5181f8e3258efae31702f5eab87d8a74a72a0aa78bc8c08c1466e243/urllib3-1.26.8.tar.gz"
sha256 "0e7c33d9a63e7ddfcb86780aac87befc2fbddf46c58dbb487e0855f7ceec283c"
end
def install
virtualenv_install_with_resources
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