#!/usr/bin/env bash # Builds the Synology SPK launcher package for the Trips app. # Usage: bash scripts/build-spk.sh [output-name] set -euo pipefail REPO_ROOT="$(cd "$(dirname "$0")/.." && pwd)" SPK_DIR="$REPO_ROOT/spk" OUT="${1:-$REPO_ROOT/trips.spk}" cd "$SPK_DIR" echo "Building SPK from $SPK_DIR..." # package.tgz is the payload — it must be a gzip-compressed tar. # It can be empty but must exist and be valid. touch .keep tar czf package.tgz .keep rm .keep # The outer SPK wrapper is a plain (uncompressed) tar — NOT gzipped. # DSM unpacks it with tar, not gunzip+tar. tar cf "$OUT" \ INFO \ PACKAGE_ICON.PNG \ PACKAGE_ICON_256.PNG \ package.tgz \ scripts \ conf rm -f package.tgz echo "Built: $OUT"