From be5dc704a8ee38c80dac59f524c53b6dc5c96e05 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Thomas=20M=C3=BCller?= <1005065+DeepDiver1975@users.noreply.github.com> Date: Tue, 27 Oct 2026 23:08:21 +0100 Subject: [PATCH] fix(packaging): ship AppStream metainfo so software centres show the licence MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit GNOME Software and KDE Discover listed the installed .deb as "Unknown License — may be proprietary", with no description, screenshots or age rating: they read all of that from AppStream metainfo, which the package did not carry. build-deb.sh now installs de.codeforfire.lagebuch.metainfo.xml: the MIT licence, a German summary and description, homepage, bug tracker and source links, the Einsatzdatei MIME type, an OARS rating, the release and five README screenshots fetched at the release tag. The id is the macOS bundle identifier. The script validates the file with appstreamcli when it is installed, as it does the desktop entry, and the release workflow now installs it. A .deb opened before installing still shows an unknown licence: PackageKit's apt backend reports "unknown" for every package. Closes #799 Co-Authored-By: Claude Opus 5.5 Signed-off-by: Thomas Müller <1005065+DeepDiver1975@users.noreply.github.com> --- .github/workflows/release.yml | 5 +- changelog.d/+appstream-metainfo.fixed.md | 1 + packaging/linux/build-deb.sh | 75 ++++++++++++++++++++++++ 3 files changed, 79 insertions(+), 2 deletions(-) create mode 100644 changelog.d/+appstream-metainfo.fixed.md diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 13f523b8..a3c6b676 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -169,11 +169,12 @@ jobs: if-no-files-found: error # build-deb.sh renders the hicolor icon sizes with ImageMagick and refuses to build # without it; ubuntu-24.04 runners carry no ImageMagick, rsvg or Inkscape. desktop-file-utils - # is only needed so the script's optional entry validation actually runs in CI. + # and appstream are only needed so the script's optional entry and metainfo validation + # actually runs in CI. - name: Install packaging tools run: | sudo apt-get update - sudo apt-get install -y --no-install-recommends imagemagick desktop-file-utils + sudo apt-get install -y --no-install-recommends imagemagick desktop-file-utils appstream - name: Build .deb env: VERSION: ${{ needs.version.outputs.version }} diff --git a/changelog.d/+appstream-metainfo.fixed.md b/changelog.d/+appstream-metainfo.fixed.md new file mode 100644 index 00000000..1bf06c90 --- /dev/null +++ b/changelog.d/+appstream-metainfo.fixed.md @@ -0,0 +1 @@ +Linux: software centres such as GNOME Software now show the installed `.deb` as MIT-licensed, with a description, screenshots and an age rating, instead of an unknown and possibly proprietary licence (#799). diff --git a/packaging/linux/build-deb.sh b/packaging/linux/build-deb.sh index 4dc6e77a..e0edb8a1 100755 --- a/packaging/linux/build-deb.sh +++ b/packaging/linux/build-deb.sh @@ -157,6 +157,81 @@ if command -v desktop-file-validate >/dev/null 2>&1; then desktop-file-validate "$ROOT/usr/share/applications/$PKG.desktop" fi +# --- AppStream metainfo ---------------------------------------------------------------------- +# What GNOME Software and KDE Discover show on the installed app's page: licence, description, +# screenshots, age rating. Without it they listed Lagebuch as "Unknown License — may be +# proprietary" (#799). The id is the macOS bundle identifier; the launchable ties it to the entry +# above. The screenshots are the README's, fetched from GitHub at this release's tag: the release +# workflow only ever builds from a v-tag, so the URL always exists. +# A .deb opened in a software centre before installing still shows an unknown licence: PackageKit's +# apt backend reports "unknown" for every package, whatever the package carries. +SCREENSHOTS="https://raw.githubusercontent.com/CodeForFire/lagebuch/v${VERSION}/docs/screenshots" +install -d "$ROOT/usr/share/metainfo" +cat > "$ROOT/usr/share/metainfo/de.codeforfire.$PKG.metainfo.xml" < + + de.codeforfire.$PKG + Lagebuch + Einsatztagebuch, Atemschutzüberwachung und Einsatzberichte für den ELW + CC0-1.0 + MIT + + CodeForFire + + +

+ Lagebuch ist das digitale Einsatztagebuch für den Einsatzleitwagen. Ein Einsatz ist eine + Datei auf dem ELW-Laptop – mit Einsatztagebuch, Kräften, Atemschutzüberwachung, Aufgaben, + CO-Messprotokoll und PDF-Bericht. +

+

+ Lagebuch läuft offline: kein Internet, kein Konto, kein Server, keine Telemetrie. Die + optionale Mehrgeräte-Verbindung bleibt im LAN, TLS-gesichert mit PIN. +

+
+ $PKG.desktop + https://codeforfire.github.io/ + https://github.com/CodeForFire/lagebuch/issues + https://github.com/CodeForFire/lagebuch + + application/x-lagebuch + + + + Startseite + ${SCREENSHOTS}/home.png + + + Einsatztagebuch + ${SCREENSHOTS}/etb.png + + + Kräfte + ${SCREENSHOTS}/kraefte.png + + + Atemschutzüberwachung + ${SCREENSHOTS}/atemschutz.png + + + PDF-Bericht + ${SCREENSHOTS}/pdf-export.png + + + + + + +
+METAINFO +chmod 644 "$ROOT/usr/share/metainfo/de.codeforfire.$PKG.metainfo.xml" + +# Optional for the same reason as desktop-file-validate above. --no-net keeps the build from +# depending on GitHub being reachable; it skips only the check that the screenshot URLs load. +if command -v appstreamcli >/dev/null 2>&1; then + appstreamcli validate --no-net "$ROOT/usr/share/metainfo/de.codeforfire.$PKG.metainfo.xml" +fi + # --- control metadata ------------------------------------------------------------------------ # Installed-Size is in KiB, what apt shows before installing. #