Per-distro packaging: .deb / .rpm / AppImage + CI (1.8)

Ships beyond the Arch PKGBUILD so non-Arch users can install without a
Rust toolchain.

## Package metadata (Cargo.toml)

- [package.metadata.deb] for cargo-deb: declares the runtime subprocess
  deps (yt-dlp, ffmpeg, mpv, xdg-utils) that auto-detection can't find,
  plus libxcb1/libc6 link deps and libnotify4 as recommended.
- [package.metadata.generate-rpm] for cargo-generate-rpm with the
  RPM-distro dep names.
- Filled in license / repository / authors / readme package fields.

## scripts/package.sh

One entry point: `scripts/package.sh [deb|rpm|appimage|all]`. Builds the
release binary once and reuses it. Installs cargo-deb / cargo-generate-rpm
on demand; downloads appimagetool to dist/tools/ on first AppImage build.
Per-format failures are isolated and summarized at the end rather than
aborting the run. Output to dist/ (gitignored).

AppImage is hand-rolled (AppDir + AppRun + root desktop/icon) and bundles
only the GUI binary's shared-lib closure — yt-dlp/ffmpeg/mpv stay host
PATH deps, same as the package declarations.

## CI

.forgejo/workflows/release.yml builds all formats on a v* tag push and
attaches them to the Codeberg release via actions/forgejo-release. Manual
workflow_dispatch builds without uploading for smoke testing. Sets
APPIMAGE_EXTRACT_AND_RUN since CI containers lack FUSE.

## docs/PACKAGING.md

Per-format build + install instructions, the Arch PKGBUILD pointer, and
an honest Windows/macOS section: both are blocked on the Linux-only tray
(ksni) + file-picker (rfd xdg-portal) deps needing per-OS abstraction.
The rest of the stack already cross-compiles.

Verified .deb (dpkg control + payload correct) and .rpm (payload correct)
build cleanly through the script on this host.

Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
This commit is contained in:
Luna 2026-05-31 16:46:57 -07:00
parent 865ad87b22
commit 91ca20d687
5 changed files with 401 additions and 0 deletions

View file

@ -3,6 +3,11 @@ name = "yt-offline"
version = "0.1.0"
edition = "2021"
description = "Self-hosted archive for YouTube, TikTok, Twitch, Vimeo, Bandcamp, SoundCloud, Odysee and more. Desktop GUI + web UI, bundled yt-dlp with curl_cffi impersonation, Plex export, SQLite-backed resume tracking. AGPL-3.0."
license = "AGPL-3.0-only"
repository = "https://codeberg.org/anassaeneroi/yt-offline"
homepage = "https://codeberg.org/anassaeneroi/yt-offline"
authors = ["InannaBeloved <anassaeneroi@pm.me>"]
readme = "README.md"
[dependencies]
eframe = "0.29"
@ -42,3 +47,47 @@ codegen-units = 1
# runtime; those are less informative without symbols but usable with
# addr2line against the unstripped build artifact.
strip = "debuginfo"
# ── Debian / Ubuntu package (cargo-deb) ──────────────────────────────────────
# `cargo deb` reads this to build a .deb. Runtime deps mirror the PKGBUILD:
# yt-dlp + ffmpeg + mpv are invoked as subprocesses, xdg-utils provides
# xdg-open, and libxcb is needed by the eframe/winit windowing stack.
[package.metadata.deb]
maintainer = "InannaBeloved <anassaeneroi@pm.me>"
copyright = "2026, InannaBeloved <anassaeneroi@pm.me>"
license-file = ["LICENSE", "0"]
extended-description = """\
Self-hosted archive for YouTube, TikTok, Twitch, Vimeo, Bandcamp, \
SoundCloud, Odysee and more. Ships a desktop GUI and a mobile-friendly \
web UI, with a bundled yt-dlp (curl_cffi impersonation), Plex export, \
and SQLite-backed resume tracking."""
section = "video"
priority = "optional"
# yt-dlp / ffmpeg / mpv are runtime subprocess deps, not link-time, so
# cargo-deb's auto-detection won't find them — list explicitly. libxcb
# is the one shared library the GUI actually dlopens.
depends = "libc6, libxcb1, yt-dlp, ffmpeg, mpv, xdg-utils"
recommends = "libnotify4"
assets = [
["target/release/yt-offline", "usr/bin/", "755"],
["youtube-backup.desktop", "usr/share/applications/yt-offline.desktop", "644"],
["icon.png", "usr/share/pixmaps/yt-offline.png", "644"],
["README.md", "usr/share/doc/yt-offline/README.md", "644"],
]
# ── Fedora / RHEL / openSUSE package (cargo-generate-rpm) ─────────────────────
# `cargo generate-rpm` reads this. Run `cargo build --release` first; it
# packages the already-built binary rather than building itself.
[package.metadata.generate-rpm]
summary = "Self-hosted multi-platform video archiver with desktop + web UI"
license = "AGPLv3"
# RPM distro package names differ from Debian's. yt-dlp is `yt-dlp` on
# Fedora; ffmpeg lives in RPM Fusion but we still declare the dep.
requires = { yt-dlp = "*", ffmpeg = "*", mpv = "*", "xdg-utils" = "*" }
assets = [
{ source = "target/release/yt-offline", dest = "/usr/bin/yt-offline", mode = "755" },
{ source = "youtube-backup.desktop", dest = "/usr/share/applications/yt-offline.desktop", mode = "644" },
{ source = "icon.png", dest = "/usr/share/pixmaps/yt-offline.png", mode = "644" },
{ source = "README.md", dest = "/usr/share/doc/yt-offline/README.md", mode = "644" },
{ source = "LICENSE", dest = "/usr/share/licenses/yt-offline/LICENSE", mode = "644" },
]