summaryrefslogtreecommitdiff
path: root/azure-cli/PKGBUILD
blob: 81d229ddb5ba8912be09dd72cd9ef67ac06e9ce2 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
# Maintainer: Erich Eckner <arch at eckner dot net>
# Contributor: pallxk <aur@pallxk.com>
# https://docs.microsoft.com/en-us/cli/azure/install-azure-cli-linux

pkgname=azure-cli
pkgver=2.35.0
pkgrel=2
pkgdesc="Command-line tools for Azure."
arch=('x86_64')
url="https://github.com/Azure/azure-cli"
license=('MIT')
_pinned_dependencies=(
  'gcc-libs=12.1.0'
  'glibc>=2.35'
  'python=3.10.4'
)
depends=("${_pinned_dependencies[@]}")
conflicts=("python-azure-cli")
source=("install-${pkgver}.py::https://azurecliprod.blob.core.windows.net/install.py"
        "install.response"
        "az")
sha256sums=('7869d3c46992852525b8f9e4c63e34edd2d29cafed9e16fd94d5356665eefdfd'
            '7c05e9915a52fb72fa8d1c498b173c42457d669351313eaddccf43f86ed0e0ec'
            '990f70efec828c1e1f3f57748fc6e40f9705f2223dc96683e8e29d118daac116')
options=(!strip)

prepare() {
  rm -rf "$srcdir/azure-cli"
  grep -v -E '^===>|^$' install.response | python "$srcdir/install-${pkgver}.py"
  find "$srcdir/azure-cli/bin" -type f -print0 | xargs -0 sed -i -e "s|$srcdir|/opt|g"
}

pkgver() {
  # Make sure we have a writable $HOME/.azure directory to run az
  HOME=$srcdir "$srcdir/bin/az" --version 2> /dev/null | head -1 | tr -c -d 0-9.
}

package() {
  mkdir "$pkgdir/opt"
  cp -r azure-cli "$pkgdir/opt"

  mkdir -p "$pkgdir/usr/bin"
  install -Dm755 az "$pkgdir/usr/bin"

  install -Dm644 "$pkgdir/opt/azure-cli/az.completion" \
    "$pkgdir/etc/bash_completion.d/azure-cli"
}