packaging: add deb/flatpak build flow and desktop metadata

This commit is contained in:
Keith Smith
2026-03-03 20:46:03 -07:00
parent f54c2e9bcd
commit c1c23d115a
10 changed files with 244 additions and 1 deletions

70
packaging/linux/build-deb.sh Executable file
View File

@@ -0,0 +1,70 @@
#!/usr/bin/env bash
set -euo pipefail
ROOT_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")/../.." && pwd)"
BUILD_DIR="${1:-$ROOT_DIR/build}"
DIST_DIR="${2:-$ROOT_DIR/dist}"
STAGE_DIR="$DIST_DIR/deb-staging"
PKG_ROOT="$STAGE_DIR/orbithub"
if [[ ! -f "$BUILD_DIR/CMakeCache.txt" ]]; then
echo "Build directory not configured: $BUILD_DIR" >&2
echo "Run: cmake -S \"$ROOT_DIR\" -B \"$BUILD_DIR\" -G Ninja" >&2
exit 1
fi
mkdir -p "$DIST_DIR"
rm -rf "$STAGE_DIR"
mkdir -p "$PKG_ROOT/DEBIAN"
VERSION="$(sed -n 's/^CMAKE_PROJECT_VERSION:STATIC=//p' "$BUILD_DIR/CMakeCache.txt" | head -n1)"
ARCH="$(dpkg --print-architecture)"
if [[ -z "$VERSION" ]]; then
echo "Unable to determine project version from $BUILD_DIR/CMakeCache.txt" >&2
exit 1
fi
cmake --build "$BUILD_DIR" -j
cmake --install "$BUILD_DIR" --prefix "$PKG_ROOT/usr"
cat > "$PKG_ROOT/DEBIAN/control" <<EOF
Package: orbithub
Version: ${VERSION}
Section: net
Priority: optional
Architecture: ${ARCH}
Maintainer: OrbitHub Maintainers <maintainers@orbithub.local>
Depends: libc6, libstdc++6, libqt6core6, libqt6gui6, libqt6widgets6, libqt6sql6, libssl3, zlib1g, openssh-client
Description: OrbitHub remote session manager
OrbitHub is a native desktop application for managing connection profiles
and opening SSH and RDP sessions in a tabbed interface.
EOF
cat > "$PKG_ROOT/DEBIAN/postinst" <<'EOF'
#!/bin/sh
set -e
if command -v update-desktop-database >/dev/null 2>&1; then
update-desktop-database -q /usr/share/applications || true
fi
if command -v gtk-update-icon-cache >/dev/null 2>&1; then
gtk-update-icon-cache -q /usr/share/icons/hicolor || true
fi
EOF
chmod 0755 "$PKG_ROOT/DEBIAN/postinst"
cat > "$PKG_ROOT/DEBIAN/postrm" <<'EOF'
#!/bin/sh
set -e
if command -v update-desktop-database >/dev/null 2>&1; then
update-desktop-database -q /usr/share/applications || true
fi
if command -v gtk-update-icon-cache >/dev/null 2>&1; then
gtk-update-icon-cache -q /usr/share/icons/hicolor || true
fi
EOF
chmod 0755 "$PKG_ROOT/DEBIAN/postrm"
OUTPUT_DEB="$DIST_DIR/orbithub_${VERSION}_${ARCH}.deb"
fakeroot dpkg-deb --build "$PKG_ROOT" "$OUTPUT_DEB" >/dev/null
echo "Created $OUTPUT_DEB"

View File

@@ -0,0 +1,11 @@
[Desktop Entry]
Type=Application
Version=1.0
Name=OrbitHub
GenericName=Remote Session Manager
Comment=Manage SSH and RDP sessions in one native app
Exec=orbithub
Icon=orbithub
Terminal=false
Categories=Network;RemoteAccess;Utility;
StartupNotify=true

View File

@@ -0,0 +1,16 @@
<?xml version="1.0" encoding="UTF-8"?>
<component type="desktop-application">
<id>io.orbithub.OrbitHub</id>
<name>OrbitHub</name>
<summary>Unified remote session manager for SSH and RDP</summary>
<metadata_license>MIT</metadata_license>
<project_license>MIT</project_license>
<description>
<p>OrbitHub is a native desktop app for organizing connection profiles and launching SSH and RDP sessions in one tabbed interface.</p>
</description>
<launchable type="desktop-id">io.orbithub.OrbitHub.desktop</launchable>
<url type="homepage">https://git.firebugit.com/ksmith/orbithub</url>
<provides>
<binary>orbithub</binary>
</provides>
</component>

View File

@@ -0,0 +1,20 @@
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 256 256">
<defs>
<linearGradient id="bg" x1="0%" y1="0%" x2="100%" y2="100%">
<stop offset="0%" stop-color="#20354f"/>
<stop offset="100%" stop-color="#0b1524"/>
</linearGradient>
<linearGradient id="ring" x1="0%" y1="0%" x2="100%" y2="0%">
<stop offset="0%" stop-color="#69e2ff"/>
<stop offset="100%" stop-color="#7cf0a3"/>
</linearGradient>
</defs>
<rect x="18" y="24" width="220" height="152" rx="16" fill="url(#bg)" stroke="#94a3b8" stroke-opacity="0.4"/>
<rect x="32" y="38" width="192" height="112" rx="8" fill="#101b2e"/>
<rect x="96" y="182" width="64" height="16" rx="8" fill="#3a4a63"/>
<rect x="70" y="200" width="116" height="14" rx="7" fill="#52627c"/>
<ellipse cx="128" cy="98" rx="74" ry="24" fill="none" stroke="url(#ring)" stroke-width="11" transform="rotate(-14 128 98)"/>
<circle cx="128" cy="98" r="18" fill="#8be4ff"/>
</svg>

After

Width:  |  Height:  |  Size: 958 B