# Maintainer: Valery Kartel # Contributor: Valery Kartel pkgname=awscli _pkgname=aws-cli pkgver=1.11.34 pkgrel=1 _python="python3" pkgdesc="Universal Command Line Interface for Amazon Web Services" url="https://github.com/aws/aws-cli" arch="noarch" license="apache2" depends="$_python py-botocore py-jmespath py-s3transfer py-docutils py-colorama py-yaml py-rsa" depends_dev="" makedepends="$_python-dev py-setuptools" install="" subpackages="$pkgname-doc $pkgname-zsh-completion:zshcomp $pkgname-bash-completion:bashcomp $pkgname-completer" source="$_pkgname-$pkgver.tar.gz::https://github.com/aws/$_pkgname/archive/$pkgver.tar.gz" builddir="$srcdir"/$_pkgname-$pkgver build() { cd "$builddir" $_python setup.py build || return 1 } package() { cd "$builddir" $_python setup.py install --prefix=/usr --root="$pkgdir" || return 1 rm -fr "$pkgdir"/usr/bin/aws.cmd \ $(find "$pkgdir" -name "*.egg-info") } bashcomp() { depends="$pkgname-completer" pkgdesc="Bash completions for $pkgname" install_if="$pkgname=$pkgver-r$pkgrel bash-completion" mkdir -p "$subpkgdir"/usr/share/bash-completion/completions mv "$pkgdir"/usr/bin/aws_bash_completer \ "$subpkgdir"/usr/share/bash-completion/completions } zshcomp() { depends="$pkgname-completer" pkgdesc="Zsh completions for $pkgname" install_if="$pkgname=$pkgver-r$pkgrel zsh" mkdir -p "$subpkgdir"/usr/share/zsh/site-functions mv "$pkgdir"/usr/bin/aws_zsh_completer.sh \ "$subpkgdir"/usr/share/zsh/site-functions } completer() { depends="" pkgdesc="$pkgdesc (completions helper)" cd "$pkgdir" local file; for file in $(find . -name "*completer*"); do echo $(dirname $file) mkdir -p "$subpkgdir"/$(dirname $file) mv "$pkgdir"/$file "$subpkgdir"/$file done } doc() { default_doc local path=$($_python -c "import sys;print(sys.path[-1])")/$pkgname mkdir -p "$subpkgdir"/$path mv "$pkgdir"/$path/examples "$subpkgdir"/$path/ mv "$pkgdir"/$path/topics "$subpkgdir"/$path/ } md5sums="a7cfdf07e7ff624a65bb6cf9d9bb09c6 aws-cli-1.11.34.tar.gz" sha256sums="a836980eb468c0864f3a343c0f78d21ebc5f05abfc80914a2714dca89ae0feec aws-cli-1.11.34.tar.gz" sha512sums="1231873f0e880f9a5d86f1691d4f6e7e62bfb4dd392047d0f51b5bbec83a3896ee160062a1c05b7139ec1ab65d83568dd27516e341092b583e4070c483c68794 aws-cli-1.11.34.tar.gz"