Compare commits
1 Commits
2026.1-dev
...
9f1cc0665f
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
9f1cc0665f |
@@ -24,7 +24,15 @@ makedepends="
|
||||
libnftnl-dev
|
||||
"
|
||||
checkdepends=""
|
||||
install="$pkgname.post-install $pkgname.pre-upgrade $pkgname.post-upgrade $pkgname.pre-deinstall $pkgname.post-deinstall"
|
||||
install="
|
||||
$pkgname.post-install
|
||||
$pkgname.pre-upgrade
|
||||
$pkgname.post-upgrade
|
||||
$pkgname.pre-deinstall
|
||||
$pkgname.post-deinstall
|
||||
$pkgname-systemd.post-install
|
||||
$pkgname-systemd.post-upgrade
|
||||
"
|
||||
subpackages="$pkgname-systemd"
|
||||
source=""
|
||||
builddir="$srcdir/"
|
||||
@@ -44,6 +52,8 @@ build() {
|
||||
|
||||
# Specify `--target` so that the build artifacts ends up in target/<target>/release to
|
||||
# avoid clashes with host system when running in a container with a mounted target folder.
|
||||
|
||||
# Compile all binaries
|
||||
cargo auditable build --release --locked \
|
||||
--target "$CHOST" \
|
||||
-p mullvad-cli \
|
||||
@@ -51,6 +61,12 @@ build() {
|
||||
-p mullvad-exclude \
|
||||
-p mullvad-problem-report \
|
||||
-p mullvad-setup
|
||||
|
||||
# Generate vendored relay list
|
||||
cargo run --release --locked \
|
||||
-p mullvad-api --bin relay_list \
|
||||
--target "$CHOST" \
|
||||
> "$builddir/relays.json"
|
||||
}
|
||||
|
||||
check() {
|
||||
@@ -74,6 +90,10 @@ package() {
|
||||
|
||||
install -m755 -D "$_cargo_target_dir/$CHOST/release/mullvad-setup" \
|
||||
"$pkgdir"/usr/bin/mullvad-setup
|
||||
|
||||
# Bundle the vendored relay list. It's copied to /var/cache/mullvad-vpn/ by the post-* scripts.
|
||||
install -m644 -D "$builddir/relays.json" \
|
||||
"$pkgdir"/usr/share/mullvad-vpn/relays.json
|
||||
}
|
||||
|
||||
systemd() {
|
||||
|
||||
13
mullvad-vpn-daemon/mullvad-vpn-daemon-systemd.post-install
Normal file
13
mullvad-vpn-daemon/mullvad-vpn-daemon-systemd.post-install
Normal file
@@ -0,0 +1,13 @@
|
||||
#!/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?
|
||||
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
|
||||
25
mullvad-vpn-daemon/mullvad-vpn-daemon-systemd.post-upgrade
Normal file
25
mullvad-vpn-daemon/mullvad-vpn-daemon-systemd.post-upgrade
Normal file
@@ -0,0 +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
|
||||
@@ -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/ || \
|
||||
|
||||
@@ -1,10 +1,9 @@
|
||||
#!/usr/bin/env bash
|
||||
set -eu
|
||||
|
||||
if which systemctl &> /dev/null && systemctl is-system-running | grep -vq offline &> /dev/null; then
|
||||
if systemctl status mullvad-daemon &> /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
|
||||
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 \
|
||||
|| echo "failed to install /var/cache/mullvad-vpn/relays.json"
|
||||
|
||||
@@ -1,10 +1,8 @@
|
||||
#!/usr/bin/env bash
|
||||
set -eu
|
||||
|
||||
if which systemctl &> /dev/null && systemctl is-system-running | grep -vq offline &> /dev/null; then
|
||||
if systemctl status mullvad-daemon &> /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
|
||||
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
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
#!/usr/bin/env bash
|
||||
set -eu
|
||||
|
||||
echo "Running prerm."
|
||||
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
|
||||
|
||||
@@ -1,7 +1,10 @@
|
||||
#!/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?
|
||||
if systemctl status mullvad-daemon &> /dev/null; then
|
||||
mullvad-setup prepare-restart || true
|
||||
systemctl stop mullvad-daemon.service
|
||||
@@ -12,5 +15,5 @@ if which systemctl &> /dev/null && systemctl is-system-running | grep -vq offlin
|
||||
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
|
||||
|
||||
Reference in New Issue
Block a user