# Distribution

RLC remains LGPL-2.1-or-later and VLC-inspired, not a port. Distribution tooling
builds downloadable packages; users do not need Rust or a C compiler. Nothing in
this change uploads a package, creates a remote release, or submits a registry
entry. The repository's production-readiness findings still apply.

## Available formats and verification

| Platform | Implemented output | Verification on 2026-12-01 |
| --- | --- | --- |
| Linux x86_64 | AppImage, DEB, RPM, tar.gz, Pacman .pkg.tar.zst | Built locally. Version/probe/playback and isolated dpkg/RPM/Pacman install/remove exercised; dependency/signature checks were bypassed in isolated package-manager tests. No host package changes. |
| Linux x86_64 | Standalone shell installer | Eight real install/desktop-launch/playback/uninstall checks passed; ownership/checksum/rollback regressions tested separately. |
| Linux x86_64 | APT/DNF/Pacman repository staging | APT update/download accepted the local index and exact DEB hash. DNF repodata checksums verified; repo-add created Pacman indexes. Public signing/hosting not configured. |
| Linux x86_64 | Flatpak bundle and offline Cargo build manifest | Manifest preparation tested; Flatpak/SDK unavailable locally. Native build/install/playback remains unverified. |
| Arch Linux x86_64 | AUR rlc-bin PKGBUILD + .SRCINFO | Built with makepkg using the actual local binary archive, a private build directory and --nodeps. No AUR submission. |
| Windows x64 | Portable ZIP, NSIS EXE, WiX MSI, WinGet | Generators/container structures tested; native build/install/launch/playback/uninstall remain unverified. |
| macOS Intel and Apple Silicon | Separate native RLC.app ZIP/DMG, Homebrew cask | Native container/relocation definitions tested structurally; actual builds, Finder, signing and playback remain unverified. |

Local Linux artifacts were built on glibc 2.44; they are **not portable to older
glibc systems**. Every Linux package records its measured glibc and libstdc++
requirements in `rlc-VERSION-linux-build.json`. CI builds on Ubuntu 24.04 to target
an older baseline; that build has not run here. AppImage still needs compatible
host C/C++ runtimes, ALSA, graphics drivers and fonts. Linux ARM builds are not
implemented. macOS builds target macOS 15 or later. Windows CI targets Windows
Server 2022/x64; a Windows 10/11 support claim requires actual device testing.

## Install and remove

After an approved release, download the asset for your architecture from
[GitHub Releases](https://github.com/raman118/rlc/releases). These instructions
describe the generated packages; they do not assert that a release is published.
Check `SHA256SUMS` against the downloaded assets (`sha256sum -c SHA256SUMS` on
Linux, `shasum -a 256 FILE` on macOS, `Get-FileHash FILE -Algorithm SHA256` in
PowerShell). Checksums detect corruption; authenticated signatures are separate.

### Linux

```sh
chmod +x rlc-VERSION-linux-x86_64.AppImage
./rlc-VERSION-linux-x86_64.AppImage
# On systems without FUSE:
./rlc-VERSION-linux-x86_64.AppImage --appimage-extract-and-run

sudo apt install ./rlc-VERSION-linux-x86_64.deb
sudo apt remove rlc

sudo dnf install ./rlc-VERSION-linux-x86_64.rpm
sudo dnf remove rlc

sudo pacman -U ./rlc-bin-VERSION-1-x86_64.pkg.tar.zst
sudo pacman -R rlc-bin

# Per-user installation, Python >= 3.9; no sudo or Rust needed.
sh ./rlc-install.sh --archive ./rlc-VERSION-linux-x86_64.tar.gz --checksums ./SHA256SUMS
~/.local/bin/rlc-uninstall

flatpak install --user ./rlc-VERSION-linux-x86_64.flatpak
flatpak run io.github.raman118.rlc
flatpak uninstall --user io.github.raman118.rlc
```

Flatpak requires the Freedesktop 25.08 runtime, available through Flathub.
Configure its remote as described in the [Flatpak installation documentation](https://docs.flatpak.org/en/latest/first-build.html).
The generated sandbox has read-only host file access so path entry and drag/drop
work without a document portal; it has audio and GPU access and no network
permission. Portal-based selection is future work. Flathub review/publication is
separate from generating a single-file bundle.

DEB/RPM/AUR install `rlc`, a desktop entry, original application icons, AppStream
metadata and license notices. Choose RLC in your desktop's **Open With** menu.
Packages do not forcibly change your default player. AppImage runs standalone;
use an AppImage integration tool for launcher registration, or run it directly.
Remove the AppImage file to uninstall it. The tar.gz contains `usr/`; it can be
extracted into a private directory and run with `./usr/bin/rlc`.

AUR recipes are generated from real hashes in `rlc-VERSION-aur-recipes.tar.gz`
and the combined `registry-recipes.tar.gz`. Linux-only generation does not wait
for Windows/macOS artifacts. Recipes disable stripping/debug postprocessing to
preserve the reviewed prebuilt native libraries.
Until a maintainer submits `rlc-bin`, use its reviewed PKGBUILD locally with
`makepkg -si` (packages precompiled RLC; does not compile RLC). Remove it with
`sudo pacman -R rlc-bin`. Do not advertise an AUR listing before it exists.

### Windows

Run `rlc-VERSION-windows-x86_64-setup.exe` or install the MSI. Both install for the
current user under `%LOCALAPPDATA%\Programs\RLC`, add a Start menu shortcut and
register supported media extensions under Open With. Install **one installer
format at a time**; changing formats requires uninstalling the previous one.
Silent installation: `setup.exe /S` or `msiexec /i rlc.msi /qn`. The EXE offers
an optional desktop shortcut and finish-page launch. MSI accepts
`INSTALLDESKTOPSHORTCUT=1` to create a desktop shortcut. Installer/UI/default icons
use RLC artwork. These definitions have not been exercised on Windows.

The portable executable is distributed in a ZIP **with its DLLs**. Extract the
whole ZIP; launch `rlc-launcher.exe` for the graphical app or use `rlc.exe` for
CLI commands. A single EXE without FFmpeg/libass DLLs is not self-contained.
Portable use does not register file associations or an uninstaller.

Remove an installed package in Windows Settings > Apps (or its uninstaller;
MSI: `msiexec /x rlc.msi`). Remove a portable extraction directory to uninstall.
Installers remove only owned files and registrations, preserving unrelated files
in the installation directory and user configuration. Extensions are registered
without replacing the user's chosen default player.

After the generated manifest is accepted in microsoft/winget-pkgs:

```powershell
winget install --exact --id Raman118.RLC
winget uninstall --exact --id Raman118.RLC
```

This ID is proposed, not a claim of availability. Validate real manifests with
`winget validate --manifest PATH`, then test install, upgrade and uninstall before
submitting, following [Microsoft's manifest documentation](https://learn.microsoft.com/en-us/windows/package-manager/package/manifest).

### macOS

Download the DMG matching your CPU (`x86_64` for Intel, `arm64` for Apple Silicon),
open it and drag RLC.app to Applications. Open local media through Finder's Open
With menu or the app's path entry/drop target. The native Swift shell receives
Finder document events and starts the Rust player. Remove RLC.app from Applications
to uninstall. The ZIP is an alternative native application bundle.

The generated Homebrew cask selects the architecture automatically and installs
the prebuilt app plus a CLI symlink. Once an approved tap hosts the generated
`homebrew/Casks/rlc.rb`, use `brew install --cask OWNER/TAP/rlc` and
`brew uninstall --cask rlc`. No tap has been created or published. Development
artifacts are ad-hoc signed and are not notarized; they are not ready for ordinary
Gatekeeper-protected distribution. Do not disable Gatekeeper to work around this.

Uninstallation preserves configuration on all platforms. RLC currently reads,
but does not write, configuration: Linux `$XDG_CONFIG_HOME/rlc/config.toml`
(default `~/.config/rlc/config.toml`), Windows `%APPDATA%/rlc/config.toml`, macOS
`~/Library/Application Support/rlc/config.toml`. Delete only your own RLC config
if you explicitly want to reset it.

## Maintainer builds

All generated material stays under `target/distribution/`. Python >= 3.12, Rust
1.100, native compilers, pkg-config and libclang are required on builders, not
end-user machines. Linux additionally needs ALSA development files. libass uses
FreeType, FriBidi and HarfBuzz; Linux uses Fontconfig; libunibreak is optional.
See workflow dependency steps for apt, MSYS2 and Homebrew packages.

```sh
bash packaging/native/build.sh
# Linux build environment (do not apply these loader paths to system ffmpeg):
export PKG_CONFIG_PATH="$PWD/target/distribution/native/lib/pkgconfig"
export LIBRARY_PATH="$PWD/target/distribution/native/lib"
export LD_LIBRARY_PATH="$LIBRARY_PATH"
export RLC_ASS_INCLUDE="$PWD/target/distribution/native/include"
cargo build --locked --release -p rlc --bins
python3 packaging/native/fetch-appimage.py
python3 packaging/distribute.py linux --binary target/release/rlc --rpm --pacman \
  --appimagetool target/distribution/tools/appimagetool-x86_64.AppImage \
  --runtime target/distribution/tools/runtime-x86_64
python3 packaging/distribute.py checksums target/distribution/artifacts
```

`native/sources.json` pins FFmpeg 9.0.2 and libass 0.17.5 archives by SHA-256.
FFmpeg builds shared with GPL, nonfree, version3, external autodetection, network
and unused devices/filters disabled. Software decoding of local media remains;
optional external codecs and hardware acceleration are not enabled in these
release builds. The packager queries avutil's actual license/configuration and
rejects GPL/nonfree builds or a mismatched source lock. It does not substitute
the development system's GPL-enabled FFmpeg.

Linux resolves ELF dependencies recursively and bundles application libraries,
leaving OS runtimes/graphics/audio drivers on the host. RPM format 4 preserves
compatibility with pre-RPM-6 tooling. Windows resolves PE imports case-insensitively,
rejects missing non-system DLLs and bundles compiler runtime DLLs where required.
macOS recursively copies dylibs, resolves rpaths, rewrites install names into
Contents/Frameworks, verifies architectures and signs nested code before the app.
Windows resource icons and macOS icns files accompany the Linux SVG/PNG icon;
these are original RLC assets, not VLC branding.

Prepare Flatpak's local source tree, vendored Cargo dependencies and manifest:

```sh
python3 packaging/flatpak/prepare.py
# Build/install/bundle steps are in .github/workflows/flatpak.yml.
```

Vendor preparation needs network; the Cargo build inside Flatpak runs frozen and
offline. Runtime/SDK/toolchain extensions and system font libraries can change;
record their exact revisions before a public release. Deterministic tar ordering,
owner fields and timestamps do not imply bit-for-bit reproducible binaries or
installers. AppImage continuous URLs are hash-locked; an upstream replacement
fails closed and requires a reviewed hash update.

## CI and authorized releases

- `distribution.yml`: Linux, Windows, Intel macOS and ARM macOS builds; Linux
  extracted playback tests, native Windows EXE/MSI installation/removal probes,
  macOS DMG mount/copy/probe/removal, and Fedora container RPM install/removal.
  Collects `release-candidate`, SHA256SUMS and real-hash registry recipes.
- `flatpak.yml`: source build, bundle generation, user installation, media probe
  and uninstall. Produces `flatpak-candidate`.
- `publish-release.yml`: **manual only**, with tag, both successful build run IDs
  and the exact confirmation `PUBLISH`. Checks tag/version/commit agreement,
  workflow identity, successful non-PR provenance and both checksum files before
  creating a versioned GitHub Release. Never overwrites a release or submits to
  AUR, Homebrew, WinGet or Flathub. Configure required reviewers on the `release`
  environment before enabling this workflow.

Tag pushes only build artifacts. Do not push a tag, run a remote workflow, submit
a package, or publish a release without the repository owner's permission.
After permission, dispatch the publication workflow **on the release tag**, using
reviewed build run IDs for that same tag commit. GitHub documents manual workflow
invocation [here](https://docs.github.com/en/actions/how-tos/manage-workflow-runs/manually-run-a-workflow).
CI definitions have been validated locally where stated below, but no remote run
has been dispatched in this task. Artifact-only builds have no signing secrets.

Before authorizing publication, review the existing production-readiness gates,
execute all native workflows, complete physical-device playback and upgrade tests,
review native licenses/source requirements, and supply signed/notarized artifacts
when required. Successful probe tests alone do not certify playback compatibility.

## Signing, notarization and license review

Windows: obtain an Authenticode code-signing certificate or authorized signing
service. On a secure Windows builder import the certificate into the current
user's certificate store and set `RLC_WINDOWS_CERT_THUMBPRINT` and, if needed,
`RLC_SIGNTOOL` (Windows SDK signtool path). Packaging signs staged EXE/DLLs before
archiving, then signs EXE/MSI installers with SHA-256 and RFC3161 timestamping.
Unsigned builds remain useful test artifacts; SmartScreen reputation and
certificate-backed distribution are not verified here. Never expose signing
credentials to pull-request jobs. Keep certificates/keys outside the repository.

macOS: an Apple Developer membership and Developer ID Application certificate
are needed. Import signing credentials on an authorized Mac, set
`RLC_MAC_SIGN_IDENTITY`, and rebuild. The Rust executable carries the hardened
runtime entitlement permitting replacement of LGPL shared libraries. Submit the
signed DMG with `bash packaging/macos/notarize.sh FILE.dmg KEYCHAIN_PROFILE`;
the helper submits, staples and assesses the DMG. This contacts Apple and requires
separate authorization. Validate the mounted app with Gatekeeper on a clean Mac.
Regenerate the app ZIP from the reviewed signed bundle if applicable, and always
regenerate checksums and catalog recipes **after** signing/stapling changes bytes.
See [Apple's notarization documentation](https://developer.apple.com/documentation/security/notarizing-macos-software-before-distribution).

Linux: sign RPMs with an authorized RPM/GPG identity if distributing through an
RPM repository, and sign APT repository metadata for a hosted DEB repository.
Flatpak repositories need an approved GPG signing/hosting process. AppImage and
SHA256SUMS detached signatures can be supplied separately. None is configured or
published automatically here.

Every package includes the RLC license, Cargo SPDX inventory and available crate
notices, direct FFmpeg/libass source archives and native configure logs (Flatpak
uses its source-build manifest and notices). Release collection includes RLC and
direct native source archives. Shared libraries remain replaceable. This follows
[FFmpeg's documented LGPL distribution approach](https://ffmpeg.org/legal.html).

**Licensing release gate remains open:** the inventory reports missing crate
notice files. Distro/Homebrew/MSYS2 libraries copied transitively also require
exact license texts and, where applicable, corresponding source. The generic
native notice is not a substitute. Review those against each final artifact,
add missing notices/sources and AppImage runtime obligations, and preserve the
ability to modify/relink LGPL components. RLC's own source license is unchanged.
Do not publish artifacts on the basis of inventory generation alone.

## Shell installer behavior

`install.sh` runs the installer from a source checkout. Release builds also emit
standalone `rlc-install.sh` and `rlc-VERSION-install.sh`; users need only that
script, the prebuilt Linux tar.gz and its SHA256SUMS. Python >= 3.9, a glibc Linux
x86_64 desktop and suitable host runtimes/drivers are required. The installer
never builds Rust, invokes sudo or changes system package databases.

It installs under `~/.local` by default; `--prefix PATH` selects a private prefix.
It validates the archive's checksum, rejects links/unsafe paths/excessive archive
members, checks the measured glibc requirement and runs the staged binary's
version command before replacing files. Installation registers RLC under
share/applications and hicolor icons, and refreshes the MIME cache when the desktop
utility is available. A custom prefix must be in your desktop's XDG data search
path to be discovered automatically. Default ~/.local/share is the normal user
location. CLI use of a custom prefix does not require PATH changes if invoked
by its absolute path.

The generated desktop entry uses an absolute launcher and passes media as
positional arguments, with desktop-entry and shell quoting kept separate. Actual
GIO launch tests cover prefixes and media paths containing spaces, $ and %.
Launching with no file opens the existing empty player. Open With launches a
selected local file. Neither path changes the user's default media player.

A hash manifest records ownership. Conflicting/modified files block replacement;
failed writes roll back replaced files. The uninstaller removes only unchanged
owned files and empty directories, preserves modified/unrelated data and config,
and removes the app association from its scoped MIME cache. A preserved modified
file can require manual review before reinstalling into that prefix. Close RLC
before replacing or removing an installation.

`--version VERSION` downloads an explicitly selected published GitHub release
and its checksums; it never assumes that a latest release exists. No such release
is currently published. An HTTP failure is an error, not an installation success.
Checksums downloaded from the same origin detect corruption, not a separate
publisher identity; use reviewed/authenticated release material. Do not curl-pipe
a script or silently disable repository signature verification.

## APT, DNF and Pacman repository preparation

The Linux workflow creates a native Pacman package, a standalone installer,
Linux-only AUR recipes and `rlc-VERSION-linux-repositories.tar.gz` containing
**unsigned staging** APT/DNF trees. APT is also usable with a local DEB via
`apt install ./FILE.deb`; DNF accepts local RPMs, and Pacman accepts the native
package via `pacman -U`. None of these commands means a remote RLC repository is
already configured.

Maintainers can stage the current actual packages locally:

```sh
python3 packaging/catalog.py target/distribution/artifacts --platform linux --output target/distribution/catalog-linux
python3 packaging/repositories.py apt
python3 packaging/repositories.py dnf
python3 packaging/repositories.py pacman
# On an authorized signing host, each accepts --sign-key APPROVED_FINGERPRINT.
```

APT writes pool packages, Packages/Packages.gz, Release and SHA-256 index hashes;
a signing key adds InRelease and Release.gpg. DNF uses createrepo_c and can sign
repomd.xml; RPM package signatures still require the separately documented
rpmsign process. Pacman uses repo-add and can sign both packages and its database.
No tool hosts/uploads repositories, imports keys on users' systems or changes
live sources. Reviewed GPG identities, independently verified public-key
fingerprints and an approved HTTPS host are required before publication.

For a public APT repository, distribute a dedicated keyring and a source entry
with Signed-By scoped to that keyring. For DNF, keep both gpgcheck and
repo_gpgcheck enabled and sign RPMs before generating metadata. For Pacman,
require package/database signatures and distribute the reviewed signing key.
Do not replace these requirements with trusted=yes or SigLevel=Never on a user's
machine. Hosting URLs and public signing keys are intentionally not invented.

Desktop-file-utils and hicolor-icon-theme are native package dependencies so
normal distribution file triggers can refresh desktop/MIME/icon metadata. The
shell installer performs its own scoped desktop cache update. Windows/macOS and
Flatpak retain their existing native shell/export integration.

## Local evidence and remaining gates

The latest desktop-installation record is
[desktop-2026-12-01.json](distribution/desktop-2026-12-01.json). Earlier
[Linux package evidence](distribution/linux-2026-12-01.json) remains a historical
snapshot and is not rewritten to describe the new code.

Actual local checks include the shell installer, desktop syntax and MIME cache,
GIO launch without a file, Open With a media path, probe/playback to EOF, and
uninstall with unowned-file preservation. The reusable script is
`python3 packaging/smoke_desktop.py target/test-media/av-smoke.mkv` (requires an
X11 display and audio). `packaging/smoke_linux.py` separately exercises DEB/RPM
extraction and AppImage extracted-runtime version/probe/playback.

The local native package-manager tests used private databases/roots: dpkg with
--force-not-root/--force-depends, RPM with forced /usr relocation and skipped
scripts/dependencies/signatures, and Pacman under fakeroot with dependency/signature
checks bypassed. Each installed payload ran version/probe/playback, then was
removed. These are real package-manager transactions, **not** proof of normal
APT/DNF/Pacman dependency resolution, signed installation or host integration.
The AUR recipe was built using the actual local archive with makepkg --nodeps;
it has not been submitted. APT update/download against the unsigned local test
repository validated indexes and the downloaded DEB checksum in a private config;
its trusted test fixture is never installed as a user's repository source.
DNF client testing is blocked; createrepo metadata hashes were checked independently.

Formatting, warning-denied Clippy, workspace tests with/without VAAPI, packaging
regressions and workflow/link checks are recorded in the verification JSON. The
icon export containers and all common Linux sizes are checked, but Windows/macOS
shell rendering is not certified. Normal FUSE mounting, Flatpak/SDK execution,
Windows/macOS native hosts, signing/notarization, clean-machine compatibility and
remote workflow runs remain unverified. Docker daemon access is denied locally.
No registry entry, hosted package repository, tag or release has been published.
Native notice/source review and engineering release gates remain open; source
licensing stays LGPL-2.1-or-later and the production verdict remains NO-GO.
