build(packaging): the Linux packages carry the third-party notices as a file

The .deb, the .rpm and the Arch tarball install THIRD-PARTY-NOTICES.txt
under /usr/share/doc/wanderbooks/, where a distribution's reader looks
for it; the program prints the same text (`wanderbooks licenses`), and
the package test compares the two after the upgrade. The AppImage, the
.dmg and the Windows program carry the text compiled in.

Not checked by a package build: the first `just package-linux` and
`test-linux-packages.sh` run does that.

Co-Authored-By: Claude <noreply@anthropic.com>
This commit is contained in:
swaitsandClaude committed 2026-11-09 22:00:44 -07:00
1 parent 7568bca7b0
commit 3bbef05cb7
5 files changed
+14 -2

No files matched your search

+2 -1
View File
@@ -13,7 +13,8 @@ depends=('gcc-libs' 'glibc')
provides=('wanderbooks')
conflicts=('wanderbooks')
options=('!lto' '!strip')
# The tarball holds usr/bin/wanderbooks, usr/share/applications/ and
# The tarball holds usr/bin/wanderbooks, usr/share/applications/,
# usr/share/doc/wanderbooks/THIRD-PARTY-NOTICES.txt and
# usr/share/wanderbooks/install-method (which makes `wanderbooks update`
# refuse and send the owner to pacman).
source=("wanderbooks_${pkgver}_x86_64.tar.gz::https://github.com/swaits/wanderbooks/releases/download/v${pkgver}/wanderbooks_${pkgver}_x86_64.tar.gz")
+3 -1
View File
@@ -36,7 +36,8 @@ sed "s/^version = \".*\"/version = \"$version\"/
s#^out-dir = .*#out-dir = \"$PWD/$out\"#
s#\"target/release\"#\"$PWD/$stage\"#
s#\"deploy/packaging/#\"$PWD/deploy/packaging/#
s#\"LICENSE-MIT\"#\"$PWD/LICENSE-MIT\"#" \
s#\"LICENSE-MIT\"#\"$PWD/LICENSE-MIT\"#
s#^\"THIRD-PARTY-NOTICES.txt\"#\"$PWD/THIRD-PARTY-NOTICES.txt\"#" \
deploy/packaging/packager.toml >"$config"
# The AppImage tools are themselves AppImages; run them without FUSE.
export APPIMAGE_EXTRACT_AND_RUN=1
@@ -45,6 +46,7 @@ assets='assets = [
{ source = "'$PWD/$stage'/wanderbooks", dest = "/usr/bin/wanderbooks", mode = "0755" },
{ source = "deploy/packaging/install-method-rpm", dest = "/usr/share/wanderbooks/install-method", mode = "0644" },
{ source = "deploy/packaging/wanderbooks-static.desktop", dest = "/usr/share/applications/wanderbooks.desktop", mode = "0644" },
{ source = "THIRD-PARTY-NOTICES.txt", dest = "/usr/share/doc/wanderbooks/THIRD-PARTY-NOTICES.txt", mode = "0644" },
]'
cargo generate-rpm -p crates/ledger-cli --set-metadata "version=\"$version\"" --set-metadata "$assets" -o "$out/"
rm -rf "$stage"
+4
View File
@@ -28,9 +28,13 @@ depends = ["libc6", "libgcc-s1"]
[deb.files]
"deploy/packaging/install-method-deb" = "usr/share/wanderbooks/install-method"
# The notices the third-party licences ask to travel with the program
# (`just notices`); `wanderbooks licenses` prints the same text.
"THIRD-PARTY-NOTICES.txt" = "usr/share/doc/wanderbooks/THIRD-PARTY-NOTICES.txt"
[pacman]
depends = ["gcc-libs", "glibc"]
[pacman.files]
"deploy/packaging/install-method-aur" = "usr/share/wanderbooks/install-method"
"THIRD-PARTY-NOTICES.txt" = "usr/share/doc/wanderbooks/THIRD-PARTY-NOTICES.txt"
+4
View File
@@ -51,6 +51,10 @@ test "$before" = "$after"
test "$head_before" = "$(head_of)"
if as_tester 'wanderbooks update' >/tmp/update.out 2>&1; then echo "update did not refuse" >&2; exit 1; fi
grep -q 'package manager' /tmp/update.out
# The new package carries the third-party notices, as a file and in the
# program, and the two are the same text.
test -s /usr/share/doc/wanderbooks/THIRD-PARTY-NOTICES.txt
as_tester 'wanderbooks licenses' | tail -n +3 | cmp -s - /usr/share/doc/wanderbooks/THIRD-PARTY-NOTICES.txt
as_tester 'wanderbooks close' >/dev/null 2>&1 || true
echo "OK"
INNER