summarylogtreecommitdiffstats
path: root/PKGBUILD
blob: b5414bfa23f477b2a9ad6f05253984f44b2156b5 (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
48
49
50
51
52
53
54
55
56
57
58
59
# Maintainer: Renato L. de F. Cunha <renatocunha@acm.org>

pkgname=microsoft-azure-vpn-client-bin
_pkgname=microsoft-azurevpnclient
_serverbase=https://packages.microsoft.com
pkgver=3.0.0
pkgrel=2
pkgdesc='The official Azure VPN Client, supporting Entra ID and certificates'
arch=('x86_64')
url='https://learn.microsoft.com/en-us/azure/vpn-gateway/point-to-site-entra-vpn-client-linux'
license=('Proprietary')
provides=('microsoft-azurevpnclient' 'microsoft-azure-vpn-client')
install=${pkgname}.install
depends=(
  'gtk3'
  'xdg-utils'
  'resolvconf'
  'libepoxy'
  'libcap'
  'curl'
  'fontconfig'
  'gcc-libs'
  'glib2'
  'pango'
  'libsecret'
  'zenity'
  'sqlite'
  'zlib'
)

source=(
  "${_serverbase}/ubuntu/22.04/prod/pool/main/m/${_pkgname}/${_pkgname}_${pkgver}_amd64.deb"
  'microsoft-azure-vpn-client-bin.install'
)

sha256sums=(
  '9e5d360433d1d374d9a1051bb29a65103e81ca74ebeaa35155d1f0e9fc94577b'
  '0d7150522a05145d31e7c8d492425b5b346ba57003fb4c8ed23249eec5d56b63'
)

package() {
  bsdtar -xf data.tar.zst -C "$pkgdir/"

  # Remove old policy action format file(s)
  rm -fr "${pkgdir}/var/lib/polkit-1"

  # Add rule to allow users from the "network" group to change DNS
  cat << EOF >> "$pkgdir/usr/share/polkit-1/rules.d/microsoft-azurevpnclient.rules"

polkit.addRule(function(action, subject) {
    if ((action.id == "org.freedesktop.resolve1.set-domains" ||
         action.id == "org.freedesktop.resolve1.set-dns-servers") &&
        subject.isInGroup("network"))
    {
        return polkit.Result.YES;
    }
});
EOF
}