33 lines
1.0 KiB
Bash
Executable File
33 lines
1.0 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"
|
|
|
|
# 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"
|