1 Commits

Author SHA1 Message Date
Joakim Hulthe
9f1cc0665f Fix install-scripts, and bundle relay list 2026-04-23 11:25:44 +02:00
8 changed files with 39 additions and 10 deletions

View File

@@ -2,7 +2,7 @@
# Maintainer: Joakim Hulthe <joakim@hulthe.net>
pkgname=mullvad-vpn-daemon
pkgver=2026.1_git
pkgrel=5
pkgrel=4
pkgdesc="Mullvad VPN system service"
url="https://mullvad.net/"
arch="all"
@@ -33,10 +33,7 @@ install="
$pkgname-systemd.post-install
$pkgname-systemd.post-upgrade
"
subpackages="
$pkgname-systemd
$pkgname-suid
"
subpackages="$pkgname-systemd"
source=""
builddir="$srcdir/"
options="net suid"
@@ -84,6 +81,10 @@ package() {
install -m755 -D "$_cargo_target_dir/$CHOST/release/mullvad-daemon" \
"$pkgdir"/usr/bin/mullvad-daemon
# mullvad-exclude requires setuid
install -m4755 -D "$_cargo_target_dir/$CHOST/release/mullvad-exclude" \
"$pkgdir"/usr/bin/mullvad-exclude
install -m755 -D "$_cargo_target_dir/$CHOST/release/mullvad-problem-report" \
"$pkgdir"/usr/bin/mullvad-problem-report
@@ -102,8 +103,3 @@ systemd() {
install -m755 -D "$startdir/mullvadvpn-app/dist-assets/linux/mullvad-early-boot-blocking.service" \
"$subpkgdir"/usr/lib/systemd/system/mullvad-early-boot-blocking.service
}
suid() {
install -m4755 -D "$_cargo_target_dir/$CHOST/release/mullvad-exclude" \
"$subpkgdir"/usr/bin/mullvad-exclude
}

View File

@@ -1,6 +1,7 @@
#!/usr/bin/env bash
set -eu
echo "mullvad-systemd post-install"
# Are we running systemd?
if which systemctl &> /dev/null && systemctl is-system-running | grep -vq offline &> /dev/null; then
# Does `mullvad-daemon.service` exist?

View File

@@ -1,12 +1,25 @@
#!/usr/bin/env bash
set -eu
echo "mullvad-systemd post-upgrade"
# Are we running systemd?
if which systemctl &> /dev/null && systemctl is-system-running | grep -vq offline &> /dev/null; then
echo "systemctl exists and is running"
# Does `mullvad-daemon.service` exist?
if systemctl list-unit-files mullvad-daemon.service &> /dev/null; then
echo "enable mullvad-daemon"
systemctl enable "/usr/lib/systemd/system/mullvad-daemon.service"
echo "start mullvad-daemon"
systemctl start mullvad-daemon.service || echo "Failed to start mullvad-daemon.service"
echo "enable mullvad-early-boot-blocking"
systemctl enable "/usr/lib/systemd/system/mullvad-early-boot-blocking.service"
else
echo "mullvad-daemon.service does not exist!!"
systemctl list-unit-files mullvad-daemon.service
fi
else
echo "systemctl does not exit!"
fi
echo "sleep 5"
sleep 5

View File

@@ -1,6 +1,8 @@
#!/usr/bin/env bash
set -eu
echo "mullvad post-deinstall"
rm -r --interactive=never /var/log/mullvad-vpn/ || \
echo "Failed to remove mullvad-vpn logs"
rm -r --interactive=never /var/cache/mullvad-vpn/ || \

View File

@@ -1,6 +1,8 @@
#!/usr/bin/env bash
set -eu
echo "mullvad post-install"
# Overwrite the cached relay list with the one embedded in the package.
mkdir -p /var/cache/mullvad-vpn \
&& cp /usr/share/mullvad-vpn/relays.json /var/cache/mullvad-vpn/relays.json \

View File

@@ -1,6 +1,8 @@
#!/usr/bin/env bash
set -eu
echo "mullvad post-upgrade"
# Overwrite the cached relay list with the one embedded in the package.
mkdir /var/cache/mullvad-vpn
cp /usr/share/mullvad-vpn/relays.json /var/cache/mullvad-vpn/relays.json

View File

@@ -1,6 +1,18 @@
#!/usr/bin/env bash
set -eu
echo "mullvad pre-deinstall"
is_number_re='^[0-9]+$'
# Check if we're running during an upgrade step on Fedora
# https://fedoraproject.org/wiki/Packaging:Scriptlets#Syntax
if [[ "$1" =~ $is_number_re ]] && [ "$1" -gt 0 ]; then
exit 0;
fi
if [[ "$1" == "upgrade" ]]; then
exit 0;
fi
# the user might've disabled or stopped the service themselves already
systemctl stop mullvad-daemon.service || true
systemctl disable mullvad-daemon.service || true

View File

@@ -1,6 +1,7 @@
#!/usr/bin/env bash
set -eu
echo "mullvad pre-upgrade"
# Are we running systemd?
if which systemctl &> /dev/null && systemctl is-system-running | grep -vq offline &> /dev/null; then
# Is `mullvad-daemon.service` running?