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

pkgname='steamos-networking-tools'
pkgver=1.1
pkgrel=2
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=(
  'd151d32e4a6fce255361a1ebb25720ea9edb623d54a56ff90cccdb3858324449'
  'ea4b7b1fb046922233f2deda1c1ae1a96ff034973c1a02202849f27c323b4de1'
  '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
}
