40 lines
1.4 KiB
Bash
Executable File
40 lines
1.4 KiB
Bash
Executable File
#!/bin/bash
|
|
# Baut RemminaMac.app (Drag-and-drop-fähiges Bundle) aus dem Release-Binary.
|
|
# Usage: ./scripts/build-app.sh [version]
|
|
set -euo pipefail
|
|
VERSION="${1:-0.1.0}"
|
|
ROOT="$(cd "$(dirname "$0")/.." && pwd)"
|
|
DIST="$ROOT/dist"
|
|
BIN="$ROOT/.build/release/RemminaMac"
|
|
APP="$DIST/RemminaMac.app"
|
|
|
|
echo "[build-app] Version: $VERSION"
|
|
if [ ! -x "$BIN" ]; then
|
|
echo "[build-app] Kein Release-Binary, baue..."
|
|
swift build -c release --package-path "$ROOT"
|
|
fi
|
|
|
|
rm -rf "$APP"
|
|
mkdir -p "$APP/Contents/MacOS" "$APP/Contents/Resources"
|
|
cp "$BIN" "$APP/Contents/MacOS/RemminaMac"
|
|
chmod +x "$APP/Contents/MacOS/RemminaMac"
|
|
# Ctty-Helper (gibt ssh ein Controlling-Terminal für Prompts)
|
|
if [ -x "$ROOT/.build/release/ctty-run" ]; then
|
|
cp "$ROOT/.build/release/ctty-run" "$APP/Contents/MacOS/"
|
|
else
|
|
echo "[build-app] WARNUNG: ctty-run fehlt (swift build lief ohne C-Target?)"
|
|
fi
|
|
cp "$ROOT/Resources/AppIcon.icns" "$APP/Contents/Resources/" 2>/dev/null || echo "[build-app] Hinweis: kein AppIcon.icns (./scripts/generate-icon.sh)"
|
|
|
|
# Info.plist mit Version versehen
|
|
sed "s|<string>0.1.0</string>|<string>$VERSION</string>|" "$ROOT/Resources/Info.plist" > "$APP/Contents/Info.plist"
|
|
echo -n "APPL????" > "$APP/Contents/PkgInfo"
|
|
|
|
# Ad-hoc-Signatur (nötig für Apple Silicon / Gatekeeper-Basis)
|
|
codesign --force --deep --sign - "$APP" 2>&1 | tail -n 3 || true
|
|
codesign --verify --verbose=2 "$APP" 2>&1 | tail -n 5 || true
|
|
|
|
echo "[build-app] Fertig:"
|
|
ls -ld "$APP"
|
|
du -sh "$APP"
|