-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathinstall-dev.sh
More file actions
executable file
·110 lines (88 loc) · 3.09 KB
/
Copy pathinstall-dev.sh
File metadata and controls
executable file
·110 lines (88 loc) · 3.09 KB
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
102
103
104
105
106
107
108
109
110
#!/usr/bin/env bash
#
# Development installation script for nm-plugin
# This links files for testing without full installation
#
set -euo pipefail
SCRIPT_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)"
REPO_ROOT="$SCRIPT_DIR"
if [[ "${1:-}" == "-h" || "${1:-}" == "--help" ]]; then
echo "Usage: $0"
echo "Build and install plugin files for local development (requires sudo)."
exit 0
fi
echo "=== MS SSO OpenConnect NetworkManager Plugin - Dev Install ==="
echo ""
# Check for required build dependencies
echo "Checking build dependencies..."
for pkg in meson ninja-build pkg-config libnm-dev libgtk-4-dev libglib2.0-dev libsecret-1-dev; do
if ! dpkg -s "$pkg" &>/dev/null; then
echo "Missing: $pkg"
MISSING=1
fi
done
if [ -n "$MISSING" ]; then
echo ""
echo "Install missing dependencies with:"
echo " sudo apt install meson ninja-build pkg-config libnm-dev libgtk-4-dev libglib2.0-dev libsecret-1-dev"
exit 1
fi
echo "All build dependencies present."
echo ""
# Build the editor library
echo "Building editor library..."
cd "$SCRIPT_DIR"
if [ -d build ]; then
rm -rf build
fi
meson setup build
meson compile -C build
echo ""
echo "Build complete."
echo ""
# Install files
echo "Installing files (requires sudo)..."
# Create directories if needed
sudo mkdir -p /usr/lib/NetworkManager/VPN
sudo mkdir -p /usr/libexec
sudo mkdir -p /usr/share/dbus-1/system.d
sudo mkdir -p /usr/share/network-manager-ms-sso/python
# Detect library directory
if [ -d /usr/lib/x86_64-linux-gnu/NetworkManager ]; then
LIBDIR=/usr/lib/x86_64-linux-gnu/NetworkManager
elif [ -d /usr/lib/aarch64-linux-gnu/NetworkManager ]; then
LIBDIR=/usr/lib/aarch64-linux-gnu/NetworkManager
else
LIBDIR=/usr/lib/NetworkManager
fi
sudo mkdir -p "$LIBDIR"
# Install Python scripts
sudo cp "$SCRIPT_DIR/src/nm-ms-sso-service.py" /usr/libexec/nm-ms-sso-service
sudo chmod +x /usr/libexec/nm-ms-sso-service
sudo cp "$SCRIPT_DIR/src/nm-ms-sso-auth-dialog.py" /usr/libexec/nm-ms-sso-auth-dialog
sudo chmod +x /usr/libexec/nm-ms-sso-auth-dialog
# Install configuration files
sudo cp "$SCRIPT_DIR/data/nm-ms-sso-service.name" /usr/lib/NetworkManager/VPN/
sudo cp "$SCRIPT_DIR/data/nm-ms-sso-service.conf" /usr/share/dbus-1/system.d/
# Install editor library
sudo cp "$SCRIPT_DIR/build/src/editor/libnm-vpn-plugin-ms-sso-editor.so" "$LIBDIR/"
# Install plugin Python runtime module
sudo rm -rf /usr/share/network-manager-ms-sso/python/core
sudo cp -r "$REPO_ROOT/src/python/core" /usr/share/network-manager-ms-sso/python/
echo ""
echo "Files installed:"
echo " /usr/libexec/nm-ms-sso-service"
echo " /usr/libexec/nm-ms-sso-auth-dialog"
echo " /usr/lib/NetworkManager/VPN/nm-ms-sso-service.name"
echo " /usr/share/dbus-1/system.d/nm-ms-sso-service.conf"
echo " $LIBDIR/libnm-vpn-plugin-ms-sso-editor.so"
echo " /usr/share/network-manager-ms-sso/python/core/"
echo ""
# Restart NetworkManager
echo "Restarting NetworkManager..."
sudo systemctl restart NetworkManager
echo ""
echo "=== Installation complete! ==="
echo ""
echo "Open GNOME Settings -> Network -> VPN to add a new 'MS SSO OpenConnect' connection."
echo ""