feat(packaging): an installable release tarball for immutable distributions (#99)

The release .tar.gz held the four binaries and their translations only,
and the service unit pointed at /usr/bin/pdfs, so it was no install on
its own. It now carries a /usr-like tree (bin, share, the user unit, the
tray's autostart entry) and install.sh, which installs it into ~/.local
without root:

- checks the libraries with ldd and names the packages to install per
  distribution, and that fusermount3 is there and setuid;
- refuses to install next to a package of the client;
- rewrites Exec= and ExecStart= to absolute paths, since ~/.local/bin is
  often not on a session's PATH;
- keeps a manifest, removes what an older version left, restarts a
  running service on update, and --uninstall leaves settings alone.

packaging/tarball/build.sh lays the tarball out and test.sh installs,
updates and uninstalls it in a throwaway home; the release job runs
both, CI runs shellcheck on them. The app looks for its translations in
share/locale beside its own bin directory and starts the tray from there,
so nothing needs PDFS_LOCALEDIR or the PATH. The -bin AUR package takes
every file from the new tarball instead of raw.githubusercontent.com.

INSTALL.md documents the tarball and layering the COPR package on Fedora
Atomic.
This commit is contained in:
nvrl committed 2026-11-15 23:57:01 +01:00
1 parent 7e0d7d020e
commit a7baf2313c
12 files changed
+462 -75

No files matched your search

@@ -31,16 +31,6 @@ pkgbase = proton-drive-for-linux-bin
options = !strip
options = !debug
source = proton-drive-linux-3.7.0-x86_64.tar.gz::https://github.com/narrrl/proton-drive-linux/releases/download/v3.7.0/proton-drive-linux-3.7.0-x86_64.tar.gz
source = io.narl.proton-drive-linux-3.7.0.desktop::https://raw.githubusercontent.com/narrrl/proton-drive-linux/v3.7.0/packaging/io.narl.proton-drive-linux.desktop
source = io.narl.proton-drive-linux-tray-3.7.0.desktop::https://raw.githubusercontent.com/narrrl/proton-drive-linux/v3.7.0/packaging/io.narl.proton-drive-linux-tray.desktop
source = io.narl.proton-drive-linux-3.7.0.svg::https://raw.githubusercontent.com/narrrl/proton-drive-linux/v3.7.0/packaging/io.narl.proton-drive-linux.svg
source = proton-drive-3.7.0.service::https://raw.githubusercontent.com/narrrl/proton-drive-linux/v3.7.0/packaging/proton-drive.service
source = LICENSE-3.7.0::https://raw.githubusercontent.com/narrrl/proton-drive-linux/v3.7.0/LICENSE
sha256sums = 3f0d16c19b10b30e3f181e3c7fb439f0a8c38980e8ab7a4a96ae6596b349787c
sha256sums = d190d6771fff0b975271fb62fd3fb0fa8bbf17d7278c10853c18557855b0c123
sha256sums = 1d95e250370220e3bb6aead6ce34d1d6cc759f42c4803b75f1667e78ff47c6c0
sha256sums = e598a93c2715c3a9fdc7fb937902083d4a1135e8fbdfe6fe7e37f0383ebbd828
sha256sums = 44c25dca6e759c46fca50b58099aa6194abe78293dee07d971bbbce0ff3ca58f
sha256sums = 02c419e7f9af08dda720e4f852f3e57cf5a69e192605440f750e9d244fa2817c
sha256sums = SKIP
pkgname = proton-drive-for-linux-bin
@@ -25,54 +25,37 @@ options=('!strip' '!debug')
# Stops the running daemon before removal, so the mount stops mirroring deletes.
install=proton-drive.install
_tag="v$pkgver"
_raw="https://raw.githubusercontent.com/narrrl/proton-drive-linux/$_tag"
# The release tarball holds the four binaries only, so the desktop integration
# files come straight from the tagged tree. Every one carries $pkgver in its
# name: makepkg reuses a cached file of the same name, so an unversioned name
# keeps the old copy after upstream changes it and fails the checksum.
source=("proton-drive-linux-$pkgver-x86_64.tar.gz::$_repo/releases/download/$_tag/proton-drive-linux-$pkgver-x86_64.tar.gz"
"io.narl.proton-drive-linux-$pkgver.desktop::$_raw/packaging/io.narl.proton-drive-linux.desktop"
"io.narl.proton-drive-linux-tray-$pkgver.desktop::$_raw/packaging/io.narl.proton-drive-linux-tray.desktop"
"io.narl.proton-drive-linux-$pkgver.svg::$_raw/packaging/io.narl.proton-drive-linux.svg"
"proton-drive-$pkgver.service::$_raw/packaging/proton-drive.service"
"LICENSE-$pkgver::$_raw/LICENSE")
sha256sums=('3f0d16c19b10b30e3f181e3c7fb439f0a8c38980e8ab7a4a96ae6596b349787c'
'd190d6771fff0b975271fb62fd3fb0fa8bbf17d7278c10853c18557855b0c123'
'1d95e250370220e3bb6aead6ce34d1d6cc759f42c4803b75f1667e78ff47c6c0'
'e598a93c2715c3a9fdc7fb937902083d4a1135e8fbdfe6fe7e37f0383ebbd828'
'44c25dca6e759c46fca50b58099aa6194abe78293dee07d971bbbce0ff3ca58f'
'02c419e7f9af08dda720e4f852f3e57cf5a69e192605440f750e9d244fa2817c')
# The release tarball holds the binaries and everything installed around them
# (desktop files, icon, user service, translations, completions) in a /usr-like
# tree under one directory.
source=("proton-drive-linux-$pkgver-x86_64.tar.gz::$_repo/releases/download/$_tag/proton-drive-linux-$pkgver-x86_64.tar.gz")
sha256sums=('SKIP')
package() {
install -Dm755 "$srcdir/pdfs" "$pkgdir/usr/bin/pdfs"
install -Dm755 "$srcdir/pdfs-tray" "$pkgdir/usr/bin/pdfs-tray"
install -Dm755 "$srcdir/pdfs-app" "$pkgdir/usr/bin/pdfs-app"
install -Dm755 "$srcdir/pdfs-prompt" "$pkgdir/usr/bin/pdfs-prompt"
cd "$srcdir/proton-drive-linux-$pkgver-x86_64"
local exe
for exe in pdfs pdfs-tray pdfs-app pdfs-prompt; do
install -Dm755 "bin/$exe" "$pkgdir/usr/bin/$exe"
done
install -Dm644 "$srcdir/io.narl.proton-drive-linux-$pkgver.desktop" \
install -Dm644 share/applications/io.narl.proton-drive-linux.desktop \
"$pkgdir/usr/share/applications/io.narl.proton-drive-linux.desktop"
install -Dm644 "$srcdir/io.narl.proton-drive-linux-tray-$pkgver.desktop" \
install -Dm644 etc/xdg/autostart/io.narl.proton-drive-linux-tray.desktop \
"$pkgdir/etc/xdg/autostart/io.narl.proton-drive-linux-tray.desktop"
install -Dm644 "$srcdir/io.narl.proton-drive-linux-$pkgver.svg" \
install -Dm644 share/icons/hicolor/scalable/apps/io.narl.proton-drive-linux.svg \
"$pkgdir/usr/share/icons/hicolor/scalable/apps/io.narl.proton-drive-linux.svg"
# systemd user unit for the auto-mount daemon; enabled per user, not by pacman.
install -Dm644 "$srcdir/proton-drive-$pkgver.service" \
install -Dm644 lib/systemd/user/proton-drive.service \
"$pkgdir/usr/lib/systemd/user/proton-drive.service"
# Translations ship precompiled in the release tarball.
# Translations and shell completion for bash, zsh and fish.
install -dm755 "$pkgdir/usr/share"
cp -r --no-preserve=ownership "$srcdir/locale" "$pkgdir/usr/share/locale"
cp -r --no-preserve=ownership share/locale share/bash-completion share/zsh share/fish \
"$pkgdir/usr/share/"
# Shell completion for bash, zsh and fish, written by the binary itself.
local share="$pkgdir/usr/share"
install -d "$share/bash-completion/completions" "$share/zsh/site-functions" \
"$share/fish/vendor_completions.d"
"$srcdir/pdfs" completions bash > "$share/bash-completion/completions/pdfs"
"$srcdir/pdfs" completions zsh > "$share/zsh/site-functions/_pdfs"
"$srcdir/pdfs" completions fish > "$share/fish/vendor_completions.d/pdfs.fish"
install -Dm644 "$srcdir/LICENSE-$pkgver" "$pkgdir/usr/share/licenses/$pkgname/LICENSE"
install -Dm644 share/licenses/proton-drive-linux/LICENSE \
"$pkgdir/usr/share/licenses/$pkgname/LICENSE"
# pacman brings new releases, so the app never checks for them itself.
install -Dm644 /dev/null "$pkgdir/usr/share/proton-drive-linux/managed-updates"