Files
vdm/docs/07-packaging.md
T
samiandClaude Sonnet 5 31eadffce5 pkg: build a local .deb; de-duplicate onto DAEMON's systemd/nativehost/man page
DAEMON landed packaging/nativehost/, packaging/systemd/{velox.service,velox.socket}
(real sd_listen_fds() socket activation) and cli/man/velox.1 on main while this was
in flight, duplicating paths this branch had drafted independently. Per CLAUDE.md
(packaging/nativehost/ is DAEMON's; the rest of packaging/ is PKG/QA's), DAEMON's
copies are kept as the single source and this branch's packaging/native-messaging/,
packaging/man/velox.1 and stale packaging/systemd/velox.service are dropped rather
than maintained twice. The root CMakeLists.txt's install() rules now point at
DAEMON's paths directly, install both systemd units (not just velox.service), and
docs/07-packaging.md / packaging/README.md no longer claim there's no socket
activation — there is, and this package now ships it.

Adds the local-test-only .deb itself: debian/{control,rules,postinst,postrm,
changelog,copyright}, a placeholder icon set, the desktop entry and PKG/QA's own
man pages (veloxd.8, velox-gui.1 — velox.1 stays DAEMON's). libveloxcore stays
static (no consumer needs a .so yet); pairing has no real approval UI in this
build (D1 unbuilt), so postinst and packaging/README.md both say VELOX_PAIR_AUTO=1
is required and print it prominently. No PPA, no GPG — local dpkg -i only.

Verified live: dpkg-buildpackage -us -uc -b, dpkg -i, socket activation (systemctl
--user enable --now velox.socket), `velox ls` against the running daemon, lintian
clean, dpkg -r removes the manifest/units and leaves $XDG_DATA_HOME/velox alone.

.gitignore now excludes dpkg-buildpackage's debhelper build tree and obj-*/ (the
debuild output dir) — debian/control et al. stay tracked, everything debhelper
regenerates does not.

Co-Authored-By: Claude Sonnet 5 <[email protected]>
Claude-Session: https://claude.ai/code/session_0176u3fTrxegrGNm2yC7r69W
2026-09-15 18:02:11 +04:00

64 lines
3.4 KiB
Markdown

# 07 — Packaging & install layout
Owner: lane **PKG/QA**. Target: Ubuntu 26.04 LTS.
## Install layout (.deb)
```
/usr/bin/veloxd
/usr/bin/velox-gui
/usr/bin/velox # CLI
/usr/libexec/velox/velox-nmhost # native messaging host
/usr/share/applications/velox.desktop
/usr/share/icons/hicolor/*/apps/velox.png
/usr/share/man/man1/velox.1.gz
/usr/lib/systemd/user/velox.service
/usr/lib/systemd/user/velox.socket # real socket activation, see below
/usr/lib/mozilla/native-messaging-hosts/com.velox.host.json
/etc/xdg/autostart/velox-gui.desktop # optional, off by default
```
`libveloxcore` is **static**, linked into `veloxd`, `velox` and `velox-gui` directly —
there is no `libveloxcore.so.*` to install. A shared, versioned `libveloxcore.so.1` was
the original plan here; the user decided against building one for now (no consumer needs
it as a shared object yet, and it would need CORE's `core/CMakeLists.txt` to grow a
`SOVERSION`). Revisit as a CORE-lane request if that changes — this doc was corrected in
the same commit as the decision rather than left describing something unshipped.
`velox.service` and `velox.socket` are both DAEMON's (`packaging/systemd/README.md`,
`daemon/src/rpc/systemd_activation.cpp`) — real `sd_listen_fds()` socket activation, not a
plain `exec`. This package installs both units verbatim and lets `dh_installsystemduser`
(compat 13) pick them up from the install tree; see `packaging/README.md` for what that
does and does not do at install time for an already-running session.
`postinst` additionally drops per-user native-messaging manifests for the packaging formats
that need them, and **detects whether Firefox is a snap** — if so it prints (and the GUI's
first-run wizard shows) a one-line note that the extension will pair over loopback.
## Package matrix
| Format | Priority | Notes |
|---|---|---|
| `.deb` via PPA | **Primary** | The only format where native messaging, systemd user units and Secret Service all behave predictably |
| Flatpak | Secondary | The sandbox changes native messaging *again*; test explicitly, don't assume. Needs `--filesystem=xdg-download` and a portal-based folder picker |
| AppImage | Optional | Convenient for testing; if it bundles Qt, honour LGPLv3 relink terms (`docs/06` R5) |
| Snap | **Not planned** | Confinement fights both native messaging and arbitrary download destinations. Revisit only if there's demand |
## Firefox extension distribution
Signed XPI on **addons.mozilla.org**. Ship the source with a reproducible build script
(AMO requires it for minified/bundled submissions). The `.deb` does *not* bundle the XPI —
it links to AMO from the first-run wizard, so extension updates flow through Firefox's own
update channel rather than through apt.
## Release checklist
- [ ] `lintian` clean
- [ ] Fresh 26.04 VM: install → install extension → M2 vertical slice passes with snap Firefox
- [ ] Upgrade from N-1: DB migrates, in-flight `.veloxpart` files still resume
- [ ] Uninstall: manifests, units and sockets removed; user data untouched unless purged
- [ ] `systemctl --user` units enabled and socket-activation verified from cold boot
- [ ] Protocol `VERSION` matches between the shipped daemon and the shipped extension, and
a deliberate mismatch produces the "Velox needs updating" message rather than a hang
- [ ] Licence audit: Qt (LGPLv3, dynamic), libcurl, SQLite, ffmpeg, icon set