summarylogtreecommitdiffstats
path: root/PKGBUILD
blob: e4d30d9fb96a4807e22aa4e79b2a7bd88a45b818 (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
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
# Maintainer: Mark Wagie <mark dot wagie at proton dot me>
pkgname=(
  'mullvad-vpn-beta-bin'
  'mullvad-vpn-daemon-beta-bin'
)
pkgbase=mullvad-vpn-beta-bin
_pkgver=2026.3
_channel=stable
_rel=1
#pkgver=${_pkgver}.${_channel}${_rel}  # beta
pkgver=${_pkgver}.${_channel}  # stable
pkgrel=1
pkgdesc="The Mullvad VPN client app for desktop - beta channel"
arch=('x86_64' 'aarch64')
url="https://www.mullvad.net"
license=('GPL-3.0-or-later')
depends=(
  'alsa-lib'
  'gtk3'
  'iputils'
  'libnftnl'
  'libnotify'
  'nss'
)
source=('mullvad-vpn.sh')
source_x86_64=(
#  "https://github.com/mullvad/mullvadvpn-app/releases/download/${_pkgver}-beta${_rel}/MullvadVPN-${_pkgver}-beta${_rel}_amd64.deb"{,.asc}  # beta
  "https://github.com/mullvad/mullvadvpn-app/releases/download/${_pkgver}/MullvadVPN-${_pkgver}_amd64.deb"{,.asc}  # stable
)
source_aarch64=(
#  "https://github.com/mullvad/mullvadvpn-app/releases/download/${_pkgver}-beta${_rel}/MullvadVPN-${_pkgver}-beta${_rel}_arm64.deb"{,.asc}  # beta
  "https://github.com/mullvad/mullvadvpn-app/releases/download/${_pkgver}/MullvadVPN-${_pkgver}_arm64.deb"{,.asc}  # stable
)
sha256sums=('a59c29f07b4eab9af56f0e8be42bae0d83726f5185e88de0c5a48f4098c3c0a4')
sha256sums_x86_64=('38c6ee73ae80870688560922a28525b6d0dacc62c2e410938863d7038e931aca'
                   'SKIP')
sha256sums_aarch64=('a44cdbdb50923e7fd97e5cd91934892391f3dd0f8444520b83cabb57cf403754'
                    'SKIP')
validpgpkeys=('A1198702FC3E0A09A9AE5B75D5A1D4F266DE8DDF') # Mullvad (code signing) <admin@mullvad.net>

prepare() {
  mkdir -p "MullvadVPN-$pkgver"
  bsdtar -xvf data.tar.xz -C "MullvadVPN-$pkgver"
}

package_mullvad-vpn-beta-bin() {
  pkgdesc+=" (desktop application)"
  depends+=('mullvad-vpn-daemon-beta-bin')
  optdepends=('libappindicator: tray icon')
  provides=('mullvad-vpn')
  conflicts=('mullvad-vpn')
  install='mullvad-vpn.install'

  bsdtar -xvf data.tar.xz -C "$pkgdir/"
  chmod 4755 "$pkgdir/opt/Mullvad VPN/chrome-sandbox"

  # Remove useless changelog.gz & symlink actual changelog
  rm "$pkgdir/usr/share/doc/mullvad-vpn/changelog.gz"
  ln -s "/opt/Mullvad VPN/resources/CHANGELOG.md" "$pkgdir/usr/share/doc/mullvad-vpn/"

  # Remove mullvad-vpn-daemon files
  rm -r "$pkgdir/usr/bin/"
  rm "$pkgdir/opt/Mullvad VPN"/resources/{ca.crt,mullvad-{problem-report,setup},relays.json}
  rm -r "$pkgdir"/usr/{lib,local,share/{bash-completion,fish}}/

  install -Dm755 "$srcdir/mullvad-vpn.sh" "$pkgdir/usr/bin/mullvad-vpn"

  # The AppArmor profile allows Electron sandbox to work
  # This disables user namespace restrictions
  install -d "$pkgdir/etc/apparmor.d"
  ln -s "/opt/Mullvad VPN/resources/apparmor_mullvad" "$pkgdir/etc/apparmor.d/mullvad"
}

package_mullvad-vpn-daemon-beta-bin() {
  pkgdesc+=" (daemon and CLI)"
  depends=(
    'dbus'
    'iputils'
    'libnftnl'
  )
  provides=('mullvad-vpn-daemon')
  conflicts=('mullvad-vpn-daemon')
  install='mullvad-vpn-daemon.install'

  cd "MullvadVPN-$pkgver"
  install -Dm755 usr/bin/{mullvad,mullvad{-daemon,-exclude}} -t \
    "$pkgdir/usr/bin/"
  install -Dm755 "opt/Mullvad VPN"/resources/mullvad{-problem-report,-setup} -t \
    "$pkgdir/opt/Mullvad VPN/resources/"
  ln -s "/opt/Mullvad VPN/resources/mullvad-problem-report" "$pkgdir/usr/bin/"
  install -Dm644 "opt/Mullvad VPN"/resources/ca.crt -t "$pkgdir/opt/Mullvad VPN/resources/"
  install -Dm644 "opt/Mullvad VPN"/resources/relays.json -t "$pkgdir/opt/Mullvad VPN/resources/"
  install -Dm644 usr/lib/systemd/system/mullvad{-daemon,-early-boot-blocking}.service -t \
    "$pkgdir/usr/lib/systemd/system/"
  install -Dm644 usr/share/bash-completion/completions/mullvad -t \
    "$pkgdir/usr/share/bash-completion/completions/"
  install -Dm644 usr/share/fish/vendor_completions.d/mullvad.fish -t \
    "$pkgdir/usr/share/fish/vendor_completions.d/"
  install -Dm644 usr/local/share/zsh/site-functions/_mullvad -t \
    "$pkgdir/usr/share/zsh/site-functions/"
}