# Maintainer: Jamie Magee <jamie dot magee at gmail dot com>
_name=azure-functions-core-tools
pkgname=$_name-bin
pkgver=4.12.1 # renovate: datasource=github-tags depName=Azure/azure-functions-core-tools
pkgrel=1
pkgdesc="Command line tools for Azure Functions"
arch=('x86_64')
url="https://github.com/Azure/$_name"
license=('MIT')
provides=($_name)
conflicts=($_name)
optdepends=('dotnet-runtime: to install extensions') # https://github.com/Azure/azure-functions-core-tools/issues/367
options=('staticlibs')
source=("https://github.com/Azure/${_name}/releases/download/${pkgver}/Azure.Functions.Cli.linux-x64.${pkgver}.zip")
b2sums=('8d14ebac36762fd10ef6e87d40a533bcba21a0ea73af3542d35fcf6c556760f5ea4e7b3752ddf862f2c3d356c1734607ba3aecb9c91cbf784810c4d5d5a5a5fa')

package() {
  install -dm 755 "${pkgdir}/usr/lib/${_name}/"
  cp -r "${srcdir}/"* "${pkgdir}/usr/lib/${_name}"
  install -m 755 "func" "${pkgdir}/usr/lib/${_name}/"

  install -dm 755 "${pkgdir}/usr/bin"
  ln -s "/usr/lib/${_name}/func" "${pkgdir}/usr/bin/func"
}
