Rename the web dashboard binary to maglevd-frontend and move it to /usr/sbin (it's a daemon and belongs with maglevd). The systemd unit name stays vpp-maglev-frontend.service since that prefix is the package name. Manpage, README, user-guide, and debian packaging all updated in lockstep; bump to 0.9.1 for the first real release. All frontend env vars are now prefixed MAGLEV_FRONTEND_ so a single /etc/default/vpp-maglev can be shared with maglevd without collisions. Every flag has an env equivalent for Docker use. MAGLEV_FRONTEND_USER and MAGLEV_FRONTEND_PASSWORD still gate the /admin surface. VPPInfoPanel now pulses "API: ↑↓" indicators in the zippy title whenever a vpp-api-send / vpp-api-recv log event arrives on the SSE stream for the scoped maglevd — 250ms blue flash, re-triggerable, with the two arrows tightly kerned via negative letter-spacing.
68 lines
2.8 KiB
Bash
Executable File
68 lines
2.8 KiB
Bash
Executable File
#!/bin/bash
|
|
# Build a vpp-maglev Debian package for one architecture.
|
|
# Usage: build-deb.sh <amd64|arm64> <version>
|
|
#
|
|
# The commit hash is baked into the binaries at link time via -ldflags
|
|
# in the Makefile, so `maglevd --version` / `maglevc --version` /
|
|
# `maglevd-frontend --version` are the source of truth for "which
|
|
# build". The .deb itself carries only the release version.
|
|
set -euo pipefail
|
|
|
|
ARCH="${1:?usage: build-deb.sh <amd64|arm64> <version>}"
|
|
VERSION="${2:?usage: build-deb.sh <amd64|arm64> <version>}"
|
|
|
|
REPO_ROOT="$(cd "$(dirname "$0")/.." && pwd)"
|
|
PKG="vpp-maglev_${VERSION}_${ARCH}"
|
|
STAGING="$(mktemp -d)"
|
|
trap 'rm -rf "$STAGING"' EXIT
|
|
|
|
echo "Building ${PKG}.deb"
|
|
|
|
# Directories
|
|
install -d "$STAGING/usr/sbin"
|
|
install -d "$STAGING/usr/bin"
|
|
install -d "$STAGING/usr/share/man/man1"
|
|
install -d "$STAGING/usr/share/man/man8"
|
|
install -d "$STAGING/lib/systemd/system"
|
|
install -d "$STAGING/etc/default"
|
|
install -d "$STAGING/etc/vpp-maglev"
|
|
install -d "$STAGING/DEBIAN"
|
|
|
|
# Binaries. maglevd and maglevd-frontend are daemons and live under
|
|
# /usr/sbin; maglevc is the interactive CLI client and lives under
|
|
# /usr/bin so it's on every login shell's PATH.
|
|
install -m 755 "$REPO_ROOT/build/${ARCH}/maglevd" "$STAGING/usr/sbin/maglevd"
|
|
install -m 755 "$REPO_ROOT/build/${ARCH}/maglevc" "$STAGING/usr/bin/maglevc"
|
|
install -m 755 "$REPO_ROOT/build/${ARCH}/maglevd-frontend" "$STAGING/usr/sbin/maglevd-frontend"
|
|
|
|
# Man pages
|
|
gzip -9 -c "$REPO_ROOT/docs/maglevd.8" > "$STAGING/usr/share/man/man8/maglevd.8.gz"
|
|
gzip -9 -c "$REPO_ROOT/docs/maglevc.1" > "$STAGING/usr/share/man/man1/maglevc.1.gz"
|
|
gzip -9 -c "$REPO_ROOT/docs/maglevd-frontend.8" > "$STAGING/usr/share/man/man8/maglevd-frontend.8.gz"
|
|
|
|
# Systemd units
|
|
install -m 644 "$REPO_ROOT/debian/vpp-maglev.service" "$STAGING/lib/systemd/system/vpp-maglev.service"
|
|
install -m 644 "$REPO_ROOT/debian/vpp-maglev-frontend.service" "$STAGING/lib/systemd/system/vpp-maglev-frontend.service"
|
|
|
|
# /etc/default/vpp-maglev (conffile — dpkg won't overwrite on upgrade)
|
|
install -m 644 "$REPO_ROOT/debian/default.vpp-maglev" "$STAGING/etc/default/vpp-maglev"
|
|
|
|
# /etc/vpp-maglev/maglev.yaml (conffile)
|
|
install -m 644 "$REPO_ROOT/debian/maglev.yaml" "$STAGING/etc/vpp-maglev/maglev.yaml"
|
|
|
|
# DEBIAN/control
|
|
sed "s/@VERSION@/${VERSION}/;s/@ARCH@/${ARCH}/" \
|
|
"$REPO_ROOT/debian/control.in" > "$STAGING/DEBIAN/control"
|
|
|
|
# DEBIAN/conffiles, postinst, prerm, postrm
|
|
install -m 644 "$REPO_ROOT/debian/conffiles" "$STAGING/DEBIAN/conffiles"
|
|
install -m 755 "$REPO_ROOT/debian/postinst" "$STAGING/DEBIAN/postinst"
|
|
install -m 755 "$REPO_ROOT/debian/prerm" "$STAGING/DEBIAN/prerm"
|
|
install -m 755 "$REPO_ROOT/debian/postrm" "$STAGING/DEBIAN/postrm"
|
|
|
|
# Emit package into build/
|
|
mkdir -p "$REPO_ROOT/build"
|
|
OUT="$REPO_ROOT/build/${PKG}.deb"
|
|
dpkg-deb --build --root-owner-group "$STAGING" "$OUT"
|
|
echo "Built: $OUT"
|