7 Commits

Author SHA1 Message Date
fa2c6775c0 Bikeshed comment 2026-04-23 13:57:37 +02:00
b0d79cbb26 Fix sha256sum location 2026-04-23 13:52:53 +02:00
6e88da887c Passthrough cli arguments to abuild 2026-04-23 12:25:55 +02:00
5591ae7379 Download mullvad-daemon from github 2026-04-23 12:25:48 +02:00
6e56dd1e6c Add depends to subpackages 2026-04-23 11:46:50 +02:00
c1fe3c1c9b Move mullvad-exclude into suid subpackage 2026-04-23 11:42:17 +02:00
Joakim Hulthe
7af09af8d1 Fix install-scripts, and bundle relay list 2026-04-23 11:42:08 +02:00
11 changed files with 98 additions and 59 deletions

4
.gitmodules vendored
View File

@@ -2,7 +2,3 @@
path = mullvad-vpn-daemon/mullvadvpn-app path = mullvad-vpn-daemon/mullvadvpn-app
url = git@github.com:mullvad/mullvadvpn-app-priv.git url = git@github.com:mullvad/mullvadvpn-app-priv.git
branch = poc-slint branch = poc-slint
[submodule "mullvad-vpn-slint/mullvadvpn-app"]
path = mullvad-vpn-slint/mullvadvpn-app
url = git@github.com:mullvad/mullvadvpn-app-priv.git
branch = poc-slint

View File

@@ -4,6 +4,8 @@ set -ex
cd "$(dirname "$0")" cd "$(dirname "$0")"
package="$1" package="$1"
shift
builder_image="mullvad-slint-musl-builder" builder_image="mullvad-slint-musl-builder"
cargo_home="${CARGO_HOME:-$HOME/.cargo}" cargo_home="${CARGO_HOME:-$HOME/.cargo}"
. "$HOME/.abuild/abuild.conf" . "$HOME/.abuild/abuild.conf"
@@ -22,5 +24,5 @@ docker run --rm \
-e "CARGO_TARGET_DIR=/cargo-target" \ -e "CARGO_TARGET_DIR=/cargo-target" \
-it \ -it \
"$builder_image" \ "$builder_image" \
abuild -F abuild -F "$@"

View File

@@ -1,8 +1,8 @@
# Contributor: # Contributor:
# Maintainer: Joakim Hulthe <joakim@hulthe.net> # Maintainer: Joakim Hulthe <joakim@hulthe.net>
pkgname=mullvad-vpn-daemon pkgname=mullvad-vpn-daemon
pkgver=2026.1_git pkgver=2026.2_beta1
pkgrel=4 pkgrel=1
pkgdesc="Mullvad VPN system service" pkgdesc="Mullvad VPN system service"
url="https://mullvad.net/" url="https://mullvad.net/"
arch="all" arch="all"
@@ -24,26 +24,39 @@ makedepends="
libnftnl-dev libnftnl-dev
" "
checkdepends="" checkdepends=""
install="$pkgname.post-install $pkgname.pre-upgrade $pkgname.post-upgrade $pkgname.pre-deinstall $pkgname.post-deinstall" install="
subpackages="$pkgname-systemd" $pkgname.post-install
source="" $pkgname.pre-upgrade
builddir="$srcdir/" $pkgname.post-upgrade
$pkgname.pre-deinstall
$pkgname.post-deinstall
$pkgname-systemd.post-install
$pkgname-systemd.post-upgrade
"
subpackages="
$pkgname-systemd
$pkgname-suid
"
source="
https://github.com/mullvad/mullvadvpn-app/archive/refs/tags/2026.2-beta1.tar.gz
"
builddir="$srcdir/mullvadvpn-app-2026.2-beta1/"
options="net suid" options="net suid"
_cargo_target_dir="${CARGO_TARGET_DIR:-$startdir/mullvadvpn-app/target}" _cargo_target_dir="${CARGO_TARGET_DIR:-$builddir/target}"
_cargo_release_dir="$_cargo_target_dir/$CHOST/release"
prepare() { prepare() {
default_prepare default_prepare
cd "$startdir/mullvadvpn-app"
cargo fetch --target "$CHOST" --locked cargo fetch --target "$CHOST" --locked
} }
build() { build() {
cd "$startdir/mullvadvpn-app" # Specify `--target` so that build artifacts will end up in target/<target>/release
# This avoids clashes with host system when running in a container with a mounted target folder.
# Specify `--target` so that the build artifacts ends up in target/<target>/release to # Compile all binaries
# avoid clashes with host system when running in a container with a mounted target folder.
cargo auditable build --release --locked \ cargo auditable build --release --locked \
--target "$CHOST" \ --target "$CHOST" \
-p mullvad-cli \ -p mullvad-cli \
@@ -51,35 +64,55 @@ build() {
-p mullvad-exclude \ -p mullvad-exclude \
-p mullvad-problem-report \ -p mullvad-problem-report \
-p mullvad-setup -p mullvad-setup
# Generate vendored relay list
cargo run --release --locked \
-p mullvad-api --bin relay_list \
--target "$CHOST" \
> "$builddir/relays.json"
} }
check() { check() {
cd "$startdir/mullvadvpn-app"
cargo test --target "$CHOST" --frozen cargo test --target "$CHOST" --frozen
} }
package() { package() {
install -m755 -D "$_cargo_target_dir/$CHOST/release/mullvad" \ install -m755 -D "$_cargo_release_dir/mullvad" \
"$pkgdir"/usr/bin/mullvad "$pkgdir/usr/bin/mullvad"
install -m755 -D "$_cargo_target_dir/$CHOST/release/mullvad-daemon" \ install -m755 -D "$_cargo_release_dir/mullvad-daemon" \
"$pkgdir"/usr/bin/mullvad-daemon "$pkgdir/usr/bin/mullvad-daemon"
# mullvad-exclude requires setuid install -m755 -D "$_cargo_release_dir/mullvad-problem-report" \
install -m4755 -D "$_cargo_target_dir/$CHOST/release/mullvad-exclude" \ "$pkgdir/usr/bin/mullvad-problem-report"
"$pkgdir"/usr/bin/mullvad-exclude
install -m755 -D "$_cargo_target_dir/$CHOST/release/mullvad-problem-report" \ install -m755 -D "$_cargo_release_dir/mullvad-setup" \
"$pkgdir"/usr/bin/mullvad-problem-report "$pkgdir/usr/bin/mullvad-setup"
install -m755 -D "$_cargo_target_dir/$CHOST/release/mullvad-setup" \ # Bundle the vendored relay list. It's copied to /var/cache/mullvad-vpn/ by the post-* scripts.
"$pkgdir"/usr/bin/mullvad-setup install -m644 -D "$builddir/relays.json" \
"$pkgdir/usr/share/mullvad-vpn/relays.json"
} }
systemd() { systemd() {
pkgdesc="systemd service files for Mullvad VPN"
depends="$pkgname=$pkgver-r$pkgrel"
install -m755 -D "$startdir/mullvadvpn-app/dist-assets/linux/mullvad-daemon.service" \ install -m755 -D "$startdir/mullvadvpn-app/dist-assets/linux/mullvad-daemon.service" \
"$subpkgdir"/usr/lib/systemd/system/mullvad-daemon.service "$subpkgdir/usr/lib/systemd/system/mullvad-daemon.service"
install -m755 -D "$startdir/mullvadvpn-app/dist-assets/linux/mullvad-early-boot-blocking.service" \ install -m755 -D "$startdir/mullvadvpn-app/dist-assets/linux/mullvad-early-boot-blocking.service" \
"$subpkgdir"/usr/lib/systemd/system/mullvad-early-boot-blocking.service "$subpkgdir/usr/lib/systemd/system/mullvad-early-boot-blocking.service"
} }
suid() {
pkgdesc="mullvad-exclude cli for split tunneling"
depends="$pkgname=$pkgver-r$pkgrel"
install -m4755 -D "$_cargo_release_dir/mullvad-exclude" \
"$subpkgdir/usr/bin/mullvad-exclude"
}
sha512sums="
9af0c263f0e5985d7842099f50a5070da0b23691f08ffe57c3b6d239d2c1c9acea89c07890f31d89bd75448a2dd1fd3c878b85be458baba0bcd90760e714b032 2026.2-beta1.tar.gz
"

View File

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

View File

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

View File

@@ -1,10 +1,7 @@
#!/usr/bin/env bash #!/usr/bin/env bash
set -eu set -eu
if which systemctl &> /dev/null && systemctl is-system-running | grep -vq offline &> /dev/null; then # Overwrite the cached relay list with the one embedded in the package.
if systemctl status mullvad-daemon &> /dev/null; then mkdir -p /var/cache/mullvad-vpn \
systemctl enable "/usr/lib/systemd/system/mullvad-daemon.service" && cp /usr/share/mullvad-vpn/relays.json /var/cache/mullvad-vpn/relays.json \
systemctl start mullvad-daemon.service || echo "Failed to start mullvad-daemon.service" || echo "failed to install /var/cache/mullvad-vpn/relays.json"
systemctl enable "/usr/lib/systemd/system/mullvad-early-boot-blocking.service"
fi
fi

View File

@@ -1,10 +1,6 @@
#!/usr/bin/env bash #!/usr/bin/env bash
set -eu set -eu
if which systemctl &> /dev/null && systemctl is-system-running | grep -vq offline &> /dev/null; then # Overwrite the cached relay list with the one embedded in the package.
if systemctl status mullvad-daemon &> /dev/null; then mkdir /var/cache/mullvad-vpn
systemctl enable "/usr/lib/systemd/system/mullvad-daemon.service" cp /usr/share/mullvad-vpn/relays.json /var/cache/mullvad-vpn/relays.json
systemctl start mullvad-daemon.service || echo "Failed to start mullvad-daemon.service"
systemctl enable "/usr/lib/systemd/system/mullvad-early-boot-blocking.service"
fi
fi

View File

@@ -1,18 +1,6 @@
#!/usr/bin/env bash #!/usr/bin/env bash
set -eu set -eu
echo "Running prerm."
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 # the user might've disabled or stopped the service themselves already
systemctl stop mullvad-daemon.service || true systemctl stop mullvad-daemon.service || true
systemctl disable mullvad-daemon.service || true systemctl disable mullvad-daemon.service || true

View File

@@ -1,7 +1,9 @@
#!/usr/bin/env bash #!/usr/bin/env bash
set -eu set -eu
# Are we running systemd?
if which systemctl &> /dev/null && systemctl is-system-running | grep -vq offline &> /dev/null; then if which systemctl &> /dev/null && systemctl is-system-running | grep -vq offline &> /dev/null; then
# Is `mullvad-daemon.service` running?
if systemctl status mullvad-daemon &> /dev/null; then if systemctl status mullvad-daemon &> /dev/null; then
mullvad-setup prepare-restart || true mullvad-setup prepare-restart || true
systemctl stop mullvad-daemon.service systemctl stop mullvad-daemon.service
@@ -12,5 +14,5 @@ if which systemctl &> /dev/null && systemctl is-system-running | grep -vq offlin
fi fi
fi fi
rm -f /var/cache/mullvad-vpn/relays.json # Since we are upgrading mullvad-daemon, it will probably have current IP baked into itself.
rm -f /var/cache/mullvad-vpn/api-ip-address.txt rm -f /var/cache/mullvad-vpn/api-ip-address.txt

View File

@@ -4,6 +4,8 @@ set -ex
cd "$(dirname "$0")" cd "$(dirname "$0")"
package="$1" package="$1"
shift
builder_image="mullvad-slint-musl-builder" builder_image="mullvad-slint-musl-builder"
cargo_home="${CARGO_HOME:-$HOME/.cargo}" cargo_home="${CARGO_HOME:-$HOME/.cargo}"
. "$HOME/.abuild/abuild.conf" . "$HOME/.abuild/abuild.conf"
@@ -22,5 +24,5 @@ podman run --rm \
-e "CARGO_TARGET_DIR=/cargo-target" \ -e "CARGO_TARGET_DIR=/cargo-target" \
-it \ -it \
"$builder_image" \ "$builder_image" \
abuild -F abuild -F "$@"