Rename the project to Voelin; packages hold only the app, tsgw is a Linux server package

The product is Voelin (app id io.github.faumaray.Voelin), everywhere:
- crates tsc-* -> voelin-* (and voelin-fuzz), the desktop binary
  tsc-desktop -> voelin, the development CLI tsctl -> voelinctl;
- the Android app: applicationId, Kotlin package io.github.faumaray.voelin,
  VoelinApp, libvoelin_android.so (JNI class names follow);
- TSC_* environment variables -> VOELIN_*, Gradle properties tsc.* ->
  voelin.*, signing secrets VOELIN_SIGNING_*;
- the data/config/cache/state folder tsc -> voelin, the keyring service,
  thread names, the dev compose project;
- desktop file, metainfo, icon, Flatpak manifest, NSIS installer, docs.
The gateway keeps its name: bin tsgw (crate voelin-gateway), TSGW_* env
vars, the tsgw.v1+json protocol, the tsgw image. The window title and the
About page show "Voelin <version>" from voelin_platform::APP_NAME.

Packages (scripts/package.sh): the app only (voelin, voelin.exe, APKs,
Flatpak). voelinctl is a development tool and in no package. tsgw is for
servers and now its own Linux package, tsgw_<v>_amd64.deb and
tsgw-<v>-linux-x86_64.tar.gz, with a sandboxed systemd unit
(packaging/linux/tsgw.service; /etc/tsgw config, /var/lib/tsgw state) and
dependencies of its own (no GUI libraries). docs/gateway-admin.md has an
Install section.

Fixes:
- package-windows: makensis on Windows found no file through "D:/a/..."
  paths; pass Windows paths (cygpath -w).
- StartupWMClass is the app id, which the app sets as its X11 WM_CLASS
  (it was the binary name, so desktops could not match the window).
- Gradle wrapper download timeout 10 s -> 60 s (slow proxies).

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01NJvYyRmTjKcb9i8eyYXK5G
This commit is contained in:
Claude committed 2026-09-26 21:11:17 +00:00
1 parent fa9e626c5b
commit e050148a32
197 files changed
+1357 -1210

No files matched your search

+34 -34
View File
@@ -1,5 +1,5 @@
#!/usr/bin/env bash
# Integration smoke test: tsctl against the TS3 and TS6 servers from
# Integration smoke test: voelinctl against the TS3 and TS6 servers from
# dev/docker-compose.yml.
#
# For each server it checks:
@@ -14,7 +14,7 @@
# 8. stream (TeamSpeak 6 only): a viewer watches a synthetic VP8 + Opus stream
#
# Usage: scripts/it-smoke.sh [ts3|ts6]... (default: both)
# Env: TSCTL=path/to/tsctl (default: builds target/debug/tsctl)
# Env: VOELINCTL=path/to/voelinctl (default: builds target/debug/voelinctl)
# COMPOSE_FILE=dev/docker-compose.yml
set -euo pipefail
@@ -27,9 +27,9 @@ mkdir -p "$STATE_DIR"
# Never leave background clients behind.
trap 'kill $(jobs -p) 2>/dev/null || true' EXIT
if [[ -z "${TSCTL:-}" ]]; then
cargo build --quiet -p tsctl -p tsc-gateway
TSCTL=target/debug/tsctl
if [[ -z "${VOELINCTL:-}" ]]; then
cargo build --quiet -p voelinctl -p voelin-gateway
VOELINCTL=target/debug/voelinctl
fi
TSGW="${TSGW:-target/debug/tsgw}"
@@ -37,7 +37,7 @@ declare -A PORTS=([ts3]=9987 [ts6]=9988)
# ServerQuery transport and address per server (dev/docker-compose.yml).
declare -A QUERY=([ts3]="raw 127.0.0.1:10011" [ts6]="ssh 127.0.0.1:10022")
declare -A GATEWAY=([ts3]=7787 [ts6]=7788)
QUERY_SECRET=tsc-dev-admin
QUERY_SECRET=voelin-dev-admin
SERVERS=("$@")
[[ ${#SERVERS[@]} -eq 0 ]] && SERVERS=(ts3 ts6)
@@ -63,15 +63,15 @@ privilege_key() {
admin_args() {
local svc=$1 addr=$2 id="$STATE_DIR/$svc-admin.json"
if [[ ! -f "$id" ]]; then
"$TSCTL" identity new --out "$id.tmp" --force >/dev/null
if ! "$TSCTL" connect "$addr" --identity "$id.tmp" --nick admin \
"$VOELINCTL" identity new --out "$id.tmp" --force >/dev/null
if ! "$VOELINCTL" connect "$addr" --identity "$id.tmp" --nick admin \
--privilege-key "$(privilege_key "$svc")" tree >/dev/null; then
fail "could not redeem the $svc privilege key (already used?). Reset the servers:
docker compose -f $COMPOSE_FILE down -v && docker compose -f $COMPOSE_FILE up -d && rm -rf $STATE_DIR"
fi
mv "$id.tmp" "$id"
# The rapid test connections would trip the per-IP anti-flood ban.
"$TSCTL" connect "$addr" --identity "$id" --nick admin raw \
"$VOELINCTL" connect "$addr" --identity "$id" --nick admin raw \
"serveredit virtualserver_antiflood_points_needed_ip_block=100000 virtualserver_antiflood_points_needed_command_block=100000" >/dev/null
fi
echo "--identity $id"
@@ -81,12 +81,12 @@ admin_args() {
chat_roundtrip() {
local addr=$1 kind=$2 sender_args=$3
local token="smoke-$kind-$RANDOM$RANDOM" out="$STATE_DIR/listen.log"
"$TSCTL" connect "$addr" --nick listener listen --expect "$token" --timeout 20 >"$out" 2>&1 &
"$VOELINCTL" connect "$addr" --nick listener listen --expect "$token" --timeout 20 >"$out" 2>&1 &
local listener=$!
# Give the listener time to connect before sending.
for _ in $(seq 1 40); do grep -q "listener" "$out" 2>/dev/null && break; sleep 0.25; done
# shellcheck disable=SC2086
"$TSCTL" connect "$addr" --nick sender $sender_args chat "$kind" "$token"
"$VOELINCTL" connect "$addr" --nick sender $sender_args chat "$kind" "$token"
if ! wait "$listener"; then
cat "$out"
fail "$kind chat message not received"
@@ -97,11 +97,11 @@ chat_roundtrip() {
# One client records while another sends a tone; Goertzel checks the result.
voice_roundtrip() {
local addr=$1 out="$STATE_DIR/voice.log"
"$TSCTL" connect "$addr" --nick recorder voice record "$STATE_DIR/voice.wav" \
"$VOELINCTL" connect "$addr" --nick recorder voice record "$STATE_DIR/voice.wav" \
--seconds 6 --expect-tone 1000 >"$out" 2>&1 &
local recorder=$!
sleep 2
"$TSCTL" connect "$addr" --nick talker voice send --tone 1000 --seconds 2 >/dev/null
"$VOELINCTL" connect "$addr" --nick talker voice send --tone 1000 --seconds 2 >/dev/null
if ! wait "$recorder"; then
cat "$out"
fail "voice tone not received"
@@ -114,11 +114,11 @@ stream_check() {
local addr=$1 out="$STATE_DIR/stream-watch.log" streamer_out="$STATE_DIR/stream-start.log"
# Unique nicknames: other clients may stream on the same server.
local streamer="streamer-$$-$RANDOM"
"$TSCTL" connect "$addr" --nick "viewer-$$" stream --loopback watch --streamer-nick "$streamer" \
"$VOELINCTL" connect "$addr" --nick "viewer-$$" stream --loopback watch --streamer-nick "$streamer" \
--expect-frames 60 --timeout 30 >"$out" 2>&1 &
local viewer=$!
sleep 2
if ! "$TSCTL" connect "$addr" --nick "$streamer" stream --loopback start --synthetic \
if ! "$VOELINCTL" connect "$addr" --nick "$streamer" stream --loopback start --synthetic \
--auto-accept --seconds 10 >"$streamer_out" 2>&1; then
cat "$streamer_out" "$out"
fail "streamer failed"
@@ -134,11 +134,11 @@ stream_check() {
presence_check() {
local addr=$1 query=$2 out="$STATE_DIR/observe.log"
# shellcheck disable=SC2086
"$TSCTL" observe $query --secret "$QUERY_SECRET" --allowlisted --poll 2 \
"$VOELINCTL" observe $query --secret "$QUERY_SECRET" --allowlisted --poll 2 \
--seconds 20 --expect-client presence-probe >"$out" 2>&1 &
local observer=$!
sleep 2
"$TSCTL" connect "$addr" --nick presence-probe listen --timeout 4 >/dev/null 2>&1 || true
"$VOELINCTL" connect "$addr" --nick presence-probe listen --timeout 4 >/dev/null 2>&1 || true
if ! wait "$observer"; then
cat "$out"
fail "observer did not see the voice client"
@@ -151,16 +151,16 @@ relay_check() {
local addr=$1 query=$2 out="$STATE_DIR/relay.log" heard="$STATE_DIR/relay-heard.log"
local token="relay-$RANDOM$RANDOM"
# shellcheck disable=SC2086
"$TSCTL" relay $query --secret "$QUERY_SECRET" --allowlisted --channel 1 \
"$VOELINCTL" relay $query --secret "$QUERY_SECRET" --allowlisted --channel 1 \
--expect "to-relay-$token" --seconds 20 >"$out" 2>&1 &
local relay=$!
"$TSCTL" connect "$addr" --nick relay-listener listen --expect "from-relay-$token" \
"$VOELINCTL" connect "$addr" --nick relay-listener listen --expect "from-relay-$token" \
--timeout 20 >"$heard" 2>&1 &
local listener=$!
sleep 4
"$TSCTL" connect "$addr" --nick relay-talker chat channel "to-relay-$token"
"$VOELINCTL" connect "$addr" --nick relay-talker chat channel "to-relay-$token"
# shellcheck disable=SC2086
"$TSCTL" relay $query --secret "$QUERY_SECRET" --allowlisted --channel 1 --nick Alice \
"$VOELINCTL" relay $query --secret "$QUERY_SECRET" --allowlisted --channel 1 --nick Alice \
--send "from-relay-$token" --seconds 1 >/dev/null
if ! wait "$relay"; then
cat "$out"
@@ -187,22 +187,22 @@ gateway_check() {
# The gateway only knows identities that connected with voice once.
local user="$STATE_DIR/$svc-gateway-user.json" stranger="$STATE_DIR/stranger.json"
[[ -f "$user" ]] || "$TSCTL" identity new --out "$user" >/dev/null
"$TSCTL" connect "$addr" --identity "$user" --nick gateway-user tree >/dev/null
"$TSCTL" identity new --out "$stranger" --force >/dev/null
if "$TSCTL" gateway "$url" --identity "$stranger" --seconds 3 >/dev/null 2>&1; then
[[ -f "$user" ]] || "$VOELINCTL" identity new --out "$user" >/dev/null
"$VOELINCTL" connect "$addr" --identity "$user" --nick gateway-user tree >/dev/null
"$VOELINCTL" identity new --out "$stranger" --force >/dev/null
if "$VOELINCTL" gateway "$url" --identity "$stranger" --seconds 3 >/dev/null 2>&1; then
fail "gateway accepted an identity the server does not know"
fi
"$TSCTL" gateway "$url" --identity "$user" --presence --open channel:1 \
"$VOELINCTL" gateway "$url" --identity "$user" --presence --open channel:1 \
--expect "to-gateway-$token" --seconds 20 >"$out" 2>&1 &
local reader=$!
"$TSCTL" connect "$addr" --nick gateway-listener listen --expect "from-gateway-$token" \
"$VOELINCTL" connect "$addr" --nick gateway-listener listen --expect "from-gateway-$token" \
--timeout 20 >"$STATE_DIR/gateway-heard.log" 2>&1 &
local listener=$!
sleep 4
"$TSCTL" connect "$addr" --nick gateway-talker chat channel "to-gateway-$token"
"$TSCTL" gateway "$url" --identity "$user" --send "channel:1=from-gateway-$token" --seconds 3 >/dev/null
"$VOELINCTL" connect "$addr" --nick gateway-talker chat channel "to-gateway-$token"
"$VOELINCTL" gateway "$url" --identity "$user" --send "channel:1=from-gateway-$token" --seconds 3 >/dev/null
if ! wait "$reader"; then
cat "$out" "$STATE_DIR/tsgw-$svc.log"
fail "gateway user did not receive the channel message"
@@ -224,7 +224,7 @@ for svc in "${SERVERS[@]}"; do
admin=$(admin_args "$svc" "$addr")
tree=$("$TSCTL" connect "$addr" --nick tree-check tree)
tree=$("$VOELINCTL" connect "$addr" --nick tree-check tree)
echo "$tree"
grep -q "tree-check" <<<"$tree" || fail "own client missing from tree"
@@ -240,10 +240,10 @@ for svc in "${SERVERS[@]}"; do
fi
done
log "engine (tsc-core) against both servers, media pipeline through TS6"
TSC_LIVE=1 cargo test --quiet -p tsc-core --features media-desktop --test live --test stream_live --test media_live 2>&1 | grep -E "test result|panicked|timed out" || fail "engine tests failed"
log "engine (voelin-core) against both servers, media pipeline through TS6"
VOELIN_LIVE=1 cargo test --quiet -p voelin-core --features media-desktop --test live --test stream_live --test media_live 2>&1 | grep -E "test result|panicked|timed out" || fail "engine tests failed"
log "stream (tsc-stream) through the TeamSpeak 6 server"
TSC_LIVE=1 cargo test --quiet -p tsc-stream --test live_ts6 2>&1 | grep -E "test result|panicked|timed out" || fail "stream test failed"
log "stream (voelin-stream) through the TeamSpeak 6 server"
VOELIN_LIVE=1 cargo test --quiet -p voelin-stream --test live_ts6 2>&1 | grep -E "test result|panicked|timed out" || fail "stream test failed"
log "all smoke tests passed"
+1 -1
View File
@@ -1,7 +1,7 @@
#!/usr/bin/env bash
# Regenerate THIRD_PARTY_NOTICES.md from Cargo.lock with cargo-about
# (about.toml, about.hbs). The app shows the file in its About page
# (tsc_platform::notices::text()), so it is committed; run this after changing
# (voelin_platform::notices::text()), so it is committed; run this after changing
# dependencies.
#
# Usage: scripts/notices.sh regenerate THIRD_PARTY_NOTICES.md
+104 -74
View File
@@ -2,14 +2,18 @@
# Package release builds into the files CI uploads and the Docker builds
# produce (docs/building.md). Build first, then:
#
# scripts/package.sh linux [out-dir] tsc-<version>-linux-<arch>.tar.gz and
# tsc-desktop_<version>_<arch>.deb
# from target/release
# scripts/package.sh windows [out-dir] tsc-<version>-windows-x86_64.zip and
# tsc-desktop-<version>-setup.exe (NSIS)
# scripts/package.sh linux [out-dir] from target/release:
# voelin-<version>-linux-<arch>.tar.gz,
# voelin_<version>_<arch>.deb (the app),
# tsgw-<version>-linux-<arch>.tar.gz,
# tsgw_<version>_<arch>.deb (the gateway,
# for servers)
# scripts/package.sh windows [out-dir] voelin-<version>-windows-x86_64.zip and
# voelin-<version>-setup.exe (NSIS)
# scripts/package.sh android [out-dir] the APKs Gradle built, renamed
#
# out-dir defaults to dist/. Each run also writes SHA256SUMS-<kind> there.
# voelinctl (a development tool) is in no package.
#
# Environment:
# CARGO_TARGET_DIR cargo's target directory (default: target)
@@ -32,91 +36,118 @@ target_dir=${CARGO_TARGET_DIR:-target}
# The version of a crate, from its manifest.
crate_version() {
sed -n 's/^version = "\(.*\)"$/\1/p' "$1/Cargo.toml" | head -n 1
local v
v=$(sed -n 's/^version = "\(.*\)"$/\1/p' "$1/Cargo.toml" | head -n 1)
[[ -n $v ]] || { echo "no version in $1/Cargo.toml" >&2; exit 1; }
printf '%s\n' "$v"
}
version=$(crate_version crates/tsc-ui)
[[ -n $version ]] || { echo "no version in crates/tsc-ui/Cargo.toml" >&2; exit 1; }
version=$(crate_version crates/voelin-ui)
app_id=io.github.faumaray.TsClient
bins=(tsc-desktop tsctl tsgw)
app_id=io.github.faumaray.Voelin
homepage=https://github.com/Faumaray/teamspeak_client_rs
tmp=$(mktemp -d)
trap 'rm -rf "$tmp"' EXIT
files=()
package_linux() {
local bin=$target_dir/release arch name stage pkg deb_arch depends
arch=$(uname -m)
name=tsc-$version-linux-$arch
# make_deb <package> <version> <depends suffix> <description…>: builds
# <package>_<version>_<arch>.deb from the tree in $tmp/debian/<package>, with
# Depends from its /usr/bin binaries (dpkg-shlibdeps) plus <depends suffix>.
# Extra control fields can be passed in $deb_extra.
make_deb() {
local pkg=$1 ver=$2 extra_depends=$3 root=$tmp/debian/$1 deb_arch depends bins
shift 3
deb_arch=$(dpkg --print-architecture)
mkdir -p "$tmp/debian"
printf 'Source: %s\n\nPackage: %s\nArchitecture: any\n' "$pkg" "$pkg" >"$tmp/debian/control"
bins=("$root"/usr/bin/*)
depends=$(cd "$tmp" && dpkg-shlibdeps -O "${bins[@]#"$tmp/"}" | sed -n 's/^shlibs:Depends=//p')
depends=${depends:+$depends${extra_depends:+, }}$extra_depends
cat >"$root/usr/share/doc/$pkg/copyright" <<-EOF
Upstream: $homepage
License: MIT OR Apache-2.0
Third-party licenses: /usr/share/doc/$pkg/THIRD_PARTY_NOTICES.md
EOF
mkdir -p "$root/DEBIAN"
{
printf 'Package: %s\nVersion: %s\nArchitecture: %s\n' "$pkg" "$ver" "$deb_arch"
printf 'Maintainer: Faumaray <23194470+Faumaray@users.noreply.github.com>\n'
printf 'Section: net\nPriority: optional\nHomepage: %s\n' "$homepage"
printf 'Depends: %s\n' "$depends"
[[ -z ${deb_extra:-} ]] || printf '%s\n' "$deb_extra"
printf 'Description: %s\n' "$1"
shift
printf ' %s\n' "$@"
} >"$root/DEBIAN/control"
dpkg-deb --root-owner-group --build "$root" "$out/${pkg}_${ver}_$deb_arch.deb" >/dev/null
files+=("${pkg}_${ver}_$deb_arch.deb")
}
# Archive: a prefix layout, e.g. `tar -xzf … --strip-components=1 -C ~/.local`.
package_linux() {
local bin=$target_dir/release arch name stage root gw_version
arch=$(uname -m)
gw_version=$(crate_version crates/voelin-gateway)
# The app. Archives use a prefix layout, e.g.
# `tar -xzf … --strip-components=1 -C ~/.local`.
name=voelin-$version-linux-$arch
stage=$tmp/$name
for b in "${bins[@]}"; do
install -Dm755 "$bin/$b" -t "$stage/bin"
done
install -Dm755 "$bin/voelin" -t "$stage/bin"
install -Dm644 packaging/linux/$app_id.desktop -t "$stage/share/applications"
install -Dm644 packaging/linux/$app_id.metainfo.xml -t "$stage/share/metainfo"
install -Dm644 packaging/linux/$app_id.svg -t "$stage/share/icons/hicolor/scalable/apps"
install -Dm644 THIRD_PARTY_NOTICES.md crates/tsc-gateway/tsgw.example.toml -t "$stage/share/doc/tsc"
install -Dm644 THIRD_PARTY_NOTICES.md -t "$stage/share/doc/voelin"
tar -C "$tmp" -czf "$out/$name.tar.gz" "$name"
files+=("$name.tar.gz")
# Debian package, with dependencies from the binaries' shared libraries.
command -v dpkg-deb >/dev/null || { echo "dpkg-deb not found: skipping the .deb" >&2; return; }
pkg=$tmp/debian/tsc-desktop
for b in "${bins[@]}"; do
install -Dm755 "$bin/$b" -t "$pkg/usr/bin"
done
install -Dm644 packaging/linux/$app_id.desktop -t "$pkg/usr/share/applications"
install -Dm644 packaging/linux/$app_id.metainfo.xml -t "$pkg/usr/share/metainfo"
install -Dm644 packaging/linux/$app_id.svg -t "$pkg/usr/share/icons/hicolor/scalable/apps"
install -Dm644 THIRD_PARTY_NOTICES.md -t "$pkg/usr/share/doc/tsc-desktop"
install -Dm644 crates/tsc-gateway/tsgw.example.toml -t "$pkg/usr/share/doc/tsc-desktop/examples"
cat >"$pkg/usr/share/doc/tsc-desktop/copyright" <<-EOF
Upstream: https://github.com/Faumaray/teamspeak_client_rs
License: MIT OR Apache-2.0
Third-party licenses: /usr/share/doc/tsc-desktop/THIRD_PARTY_NOTICES.md
EOF
deb_arch=$(dpkg --print-architecture)
mkdir -p "$tmp/debian"
printf 'Source: tsc-desktop\n\nPackage: tsc-desktop\nArchitecture: any\n' >"$tmp/debian/control"
depends=$(cd "$tmp" && dpkg-shlibdeps -O "${bins[@]/#/debian/tsc-desktop/usr/bin/}" |
sed -n 's/^shlibs:Depends=//p')
# Loaded at run time (dlopen), so dpkg-shlibdeps cannot see them: the
# keyboard, then Wayland or X11 and EGL for the window.
depends=${depends:+$depends, }libxkbcommon0
mkdir -p "$pkg/DEBIAN"
cat >"$pkg/DEBIAN/control" <<-EOF
Package: tsc-desktop
Version: $version
Architecture: $deb_arch
Maintainer: Faumaray <23194470+Faumaray@users.noreply.github.com>
Section: net
Priority: optional
Homepage: https://github.com/Faumaray/teamspeak_client_rs
Depends: $depends
Recommends: libwayland-client0, libwayland-cursor0, libxkbcommon-x11-0, libx11-xcb1, libxcursor1, libxi6, libxrandr2, libegl1
Description: TeamSpeak 3 and 6 client
Desktop client for TeamSpeak 3 and TeamSpeak 6 servers (tsc-desktop), with
the tsctl command line client and the tsgw companion gateway.
EOF
dpkg-deb --root-owner-group --build "$pkg" "$out/tsc-desktop_${version}_$deb_arch.deb" >/dev/null
files+=("tsc-desktop_${version}_$deb_arch.deb")
# The gateway, for servers: nothing of the app, no GUI libraries.
name=tsgw-$gw_version-linux-$arch
stage=$tmp/$name
install -Dm755 "$bin/tsgw" -t "$stage/bin"
install -Dm644 packaging/linux/tsgw.service -t "$stage/lib/systemd/system"
install -Dm644 THIRD_PARTY_NOTICES.md crates/voelin-gateway/tsgw.example.toml -t "$stage/share/doc/tsgw"
tar -C "$tmp" -czf "$out/$name.tar.gz" "$name"
files+=("$name.tar.gz")
command -v dpkg-deb >/dev/null || { echo "dpkg-deb not found: skipping the .deb files" >&2; return; }
root=$tmp/debian/voelin
install -Dm755 "$bin/voelin" -t "$root/usr/bin"
install -Dm644 packaging/linux/$app_id.desktop -t "$root/usr/share/applications"
install -Dm644 packaging/linux/$app_id.metainfo.xml -t "$root/usr/share/metainfo"
install -Dm644 packaging/linux/$app_id.svg -t "$root/usr/share/icons/hicolor/scalable/apps"
install -Dm644 THIRD_PARTY_NOTICES.md -t "$root/usr/share/doc/voelin"
# libxkbcommon, Wayland/X11 and EGL are loaded at run time (dlopen), so
# dpkg-shlibdeps cannot see them.
deb_extra="Recommends: libwayland-client0, libwayland-cursor0, libxkbcommon-x11-0, libx11-xcb1, libxcursor1, libxi6, libxrandr2, libegl1" \
make_deb voelin "$version" libxkbcommon0 \
"Voelin, a TeamSpeak 3 and 6 client" \
"Desktop client for TeamSpeak 3 and TeamSpeak 6 servers: voice, chat," \
"screen sharing and invisible presence through a tsgw gateway."
root=$tmp/debian/tsgw
install -Dm755 "$bin/tsgw" -t "$root/usr/bin"
install -Dm644 packaging/linux/tsgw.service -t "$root/usr/lib/systemd/system"
install -Dm644 THIRD_PARTY_NOTICES.md -t "$root/usr/share/doc/tsgw"
install -Dm644 crates/voelin-gateway/tsgw.example.toml -t "$root/usr/share/doc/tsgw/examples"
make_deb tsgw "$gw_version" "" \
"Voelin gateway for TeamSpeak servers" \
"Runs next to a TeamSpeak 3 or 6 server and gives Voelin users invisible" \
"presence and channel chat over ServerQuery. Configure /etc/tsgw/tsgw.toml" \
"(example in /usr/share/doc/tsgw/examples), then systemctl enable --now tsgw."
}
# A path makensis.exe understands when running on Windows (Git Bash).
# A path Windows programs understand when running on Windows (Git Bash):
# backslashes, since makensis's File finds nothing through "D:/a/…" paths.
native_path() {
if command -v cygpath >/dev/null; then cygpath -m "$1"; else printf '%s\n' "$1"; fi
if command -v cygpath >/dev/null; then cygpath -w "$1"; else printf '%s\n' "$1"; fi
}
package_windows() {
local bin=$target_dir/${WINDOWS_TARGET:+$WINDOWS_TARGET/}release name stage makensis
name=tsc-$version-windows-x86_64
name=voelin-$version-windows-x86_64
stage=$tmp/$name
mkdir -p "$stage"
for b in "${bins[@]}"; do
cp "$bin/$b.exe" "$stage/"
done
cp THIRD_PARTY_NOTICES.md crates/tsc-gateway/tsgw.example.toml "$stage/"
cp "$bin/voelin.exe" THIRD_PARTY_NOTICES.md "$stage/"
if command -v zip >/dev/null; then
(cd "$tmp" && zip -qr "$out/$name.zip" "$name")
elif command -v 7z >/dev/null; then
@@ -137,21 +168,20 @@ package_windows() {
fi
# Absolute paths: makensis changes into the script's directory.
"$makensis" -V2 -DVERSION="$version" -DOUTDIR="$(native_path "$out")" \
-DBINARY="$(native_path "$(cd "$bin" && pwd)/tsc-desktop.exe")" packaging/windows/installer.nsi
files+=("tsc-desktop-$version-setup.exe")
-DBINARY="$(native_path "$(cd "$bin" && pwd)/voelin.exe")" packaging/windows/installer.nsi
files+=("voelin-$version-setup.exe")
}
package_android() {
local apk android_version found=0
android_version=$(crate_version crates/tsc-android)
local apk android_version variant found=0
android_version=$(crate_version crates/voelin-android)
for apk in android/app/build/outputs/apk/*/*.apk; do
[[ -e $apk ]] || continue
# app-debug.apk, app-release.apk, app-release-unsigned.apk
local variant
variant=$(basename "$apk" .apk)
variant=${variant#app-}
cp "$apk" "$out/tsc-$android_version-android-$variant.apk"
files+=("tsc-$android_version-android-$variant.apk")
cp "$apk" "$out/voelin-$android_version-android-$variant.apk"
files+=("voelin-$android_version-android-$variant.apk")
found=1
done
((found)) || { echo "no APKs in android/app/build/outputs/apk: build with Gradle first" >&2; exit 1; }