# Author : Manuel A. Fernandez Montecelo <mafm@igalia.com>

pkgname='steamos-networking-tools'
pkgver=1.2
pkgrel=1
pkgdesc='SteamOS networking tools'
arch=('any')
license=('LGPL2.1')
url='https://gitlab.steamos.cloud/holo/holo'
source=("${pkgname%-git}::git+${url}#tag=${_tag}")
source=(
  'steamos-wifi-set-backend'
  'steamos-wifi-set-backend-privileged'
  'steamos-wifi-set-backend.bash-completion'
  'com.steampowered.SteamOS.WifiSetBackend.policy'
)
sha256sums=(
  '2fd71495b31d3b98442f8a8cd72719ee203a1d1777d278eb3c49066ba28c724e'
  'b8cfea8158a263891ad9abdb6a881dce32597db6fed83b88271ba381776a688c'
  'ebc55a73168f331d34ce03ecf0d081699faa448ae49098ecd2ce15e8081598bc'
  'd5b620c8b6cf581f1d0068611d63b17671f7383ce5ed11ab085966d9cf7574cc'
)
# depends on these at runtime, commented out as not needed at build time
# depends=(
#   'bash'
#   'iw'
#   'iwd'                            # iwd systemd unit
#   'network-manager'                # NetworkManager systemd unit and config
#   'systemd'                        # systemctl
#   'polkit'
# )

package() {
  install -Dm0755 steamos-wifi-set-backend -t "${pkgdir}"/usr/bin
  install -Dm0755 steamos-wifi-set-backend-privileged -t "${pkgdir}"/usr/bin/steamos-polkit-helpers
  install -Dm0644 steamos-wifi-set-backend.bash-completion -T "${pkgdir}"/usr/share/bash-completion/completions/steamos-wifi-set-backend
  install -m0755 -d "${pkgdir}"/usr/share/polkit-1/actions
  install -Dm0644 com.steampowered.SteamOS.WifiSetBackend.policy -t "${pkgdir}"/usr/share/polkit-1/actions
}
