From 51307190286e06deb0edf74f532f1903e15bc97e Mon Sep 17 00:00:00 2001 From: John Zaitseff Date: Thu, 14 Jan 2021 09:11:08 +1100 Subject: [PATCH] Add an AppStream-conforming metadata file --- .gitattributes | 2 ++ .gitignore | 1 + Makefile.am | 1 + NEWS | 4 ++- build-aux/msgfmt-appdata | 23 +++++++++++++++ configure.ac | 1 + data/Makefile.am | 7 ++++- data/README | 2 +- data/trader.appdata.xml.in | 59 ++++++++++++++++++++++++++++++++++++++ po/POTFILES.in | 1 + 10 files changed, 98 insertions(+), 3 deletions(-) create mode 100755 build-aux/msgfmt-appdata create mode 100644 data/trader.appdata.xml.in diff --git a/.gitattributes b/.gitattributes index 3827ab4..1737e98 100644 --- a/.gitattributes +++ b/.gitattributes @@ -1,7 +1,9 @@ Makefile.am ident /configure.ac ident /build-aux/bootstrap ident +/build-aux/msgfmt-appdata ident /build-aux/msgfmt-desktop ident +/data/trader.appdata.xml.in ident /data/trader.desktop.in ident /data/trader.svg ident /doc/trader.* ident diff --git a/.gitignore b/.gitignore index 8d5422e..b45efe5 100644 --- a/.gitignore +++ b/.gitignore @@ -16,6 +16,7 @@ TAGS /configure /stamp-h1 +/data/trader.appdata.xml /data/trader.desktop /po/POTFILES diff --git a/Makefile.am b/Makefile.am index 39412eb..c1198b5 100644 --- a/Makefile.am +++ b/Makefile.am @@ -33,6 +33,7 @@ SUBDIRS = lib src po data doc m4 # Additional files to distribute EXTRA_DIST = \ build-aux/bootstrap \ + build-aux/msgfmt-appdata \ build-aux/msgfmt-desktop \ lib/obsolete-strings.c \ lib/xopen-source.h diff --git a/NEWS b/NEWS index a1283eb..f19b186 100644 --- a/NEWS +++ b/NEWS @@ -25,7 +25,9 @@ __ https://www.zap.org.au/ Version 7.16 (not yet released) ------------------------------- -(No changes yet) +Added an application metadata file that conforms to the AppStream 0.12 +specification. Updated all translations to suit, using parts of existing +strings. Version 7.15 (12th January, 2021) diff --git a/build-aux/msgfmt-appdata b/build-aux/msgfmt-appdata new file mode 100755 index 0000000..a6acade --- /dev/null +++ b/build-aux/msgfmt-appdata @@ -0,0 +1,23 @@ +#!/bin/sh + +# Create or update AppData files using msgfmt(1) +# $Id$ + +# Usage: +# msgfmt-appdata -d PODIR INPUT OUTPUT + +set -e + +if [ x"$1" != x"-d" ]; then + echo "$0: Missing parameters" 1>&2 + exit 1 +fi + +PODIR="$2" +INPUT="$3" +OUTPUT="$4" + +if ! msgfmt --xml -d "$PODIR" --template "$INPUT" -o "$OUTPUT"; then + echo "$0: Using cp(1) program instead" + cp "$INPUT" "$OUTPUT" +fi diff --git a/configure.ac b/configure.ac index 5471584..1929cfe 100644 --- a/configure.ac +++ b/configure.ac @@ -82,6 +82,7 @@ AS_IF([test "x$ax_cv_curses_enhanced" = xyes], [], ]) AC_SUBST([desktopdir],['${datadir}/applications']) +AC_SUBST([appdatadir],['${datadir}/metainfo']) AC_SUBST([iconsdir],['${datadir}/icons/hicolor']) AC_CONFIG_FILES([ diff --git a/data/Makefile.am b/data/Makefile.am index 783f3ec..29d8835 100644 --- a/data/Makefile.am +++ b/data/Makefile.am @@ -28,6 +28,7 @@ dist_desktop_DATA = trader.desktop +dist_appdata_DATA = trader.appdata.xml icons16dir = ${iconsdir}/16x16/apps icons22dir = ${iconsdir}/22x22/apps @@ -55,8 +56,12 @@ dist_iconsscalable_DATA = trader.svg EXTRA_DIST = \ README \ - trader.desktop.in + trader.desktop.in \ + trader.appdata.xml.in trader.desktop: trader.desktop.in $(top_srcdir)/build-aux/msgfmt-desktop -d $(top_srcdir)/po $< $@ + +trader.appdata.xml: trader.appdata.xml.in + $(top_srcdir)/build-aux/msgfmt-appdata -d $(top_srcdir)/po $< $@ diff --git a/data/README b/data/README index c8d0c6e..82c9746 100644 --- a/data/README +++ b/data/README @@ -7,4 +7,4 @@ Star Traders: A Game of Interstellar Trading ============================================ This directory, `data`, contains non-code data related to Star Traders. -In particular, the desktop file and icons are located here. +In particular, the desktop file, AppData file and icons are located here. diff --git a/data/trader.appdata.xml.in b/data/trader.appdata.xml.in new file mode 100644 index 0000000..deb031f --- /dev/null +++ b/data/trader.appdata.xml.in @@ -0,0 +1,59 @@ + + + + + + au.org.zap.trader + + Star Traders + Play Star Traders, a simple game of interstellar trading + +

+ Star Traders is a simple game of interstellar trading, where the + objective is to create companies, buy and sell shares, borrow and + repay money, in order to become the wealthiest player (the winner). +

+
+ + trader.svg + trader.desktop + + trader + + + + Game + StrategyGame + + + https://www.zap.org.au/projects/trader/ + John Zaitseff + + + + https://www.zap.org.au/projects/trader/screenshot.png + + + + FSFAP + GPL-3.0+ + +
diff --git a/po/POTFILES.in b/po/POTFILES.in index 05875d1..047de6c 100644 --- a/po/POTFILES.in +++ b/po/POTFILES.in @@ -28,6 +28,7 @@ # Data files from Star Traders data/trader.desktop.in +data/trader.appdata.xml.in # Source files from Star Traders src/trader.c