I was recently asked how to make 3rd party repositories add apps to GNOME Software. This is relevant if you run a internal private repo for employee tools, or are just kind enough to provide a 3rd party repo for Fedora or RHEL users for your free or non-free applications.
In most cases people are already running something like this to generate the repomd metadata files on a directory of RPM files:
createrepo_c --no-database --simple-md-filenames SRPMS/ createrepo_c --no-database --simple-md-filenames x86_64/
So, we need to actually generate the AppStream XML. This works by exploding any interesting
.rpm files and merging together the
.desktop file, the
.appdata.xml file and preprocessing some icons. Only applications installing AppData files will be shown in GNOME Software, so you might need to fix before you start.
appstream-builder \ --origin=yourcompanyname \ --basename=appstream \ --cache-dir=/tmp/asb-cache \ --enable-hidpi \ --max-threads=1 \ --min-icon-size=32 \ --output-dir=/tmp/asb-md \ --packages-dir=x86_64/ \ --temp-dir=/tmp/asb-icons
This takes a second or two (or 40 minutes if you’re trying to process the entire Fedora archive…) and spits out some files to
/tmp/asb-md — you probably want to change some things there to make more sense for your build server.
We then have to take the generated XML and the tarball of icons and add it to the repomd.xml master document so that GNOME Software (via PackageKit) automatically downloads the content for searching. This is as simple as doing:
modifyrepo_c \ --no-compress \ --simple-md-filenames \ /tmp/asb-md/appstream.xml.gz \ x86_64/repodata/ modifyrepo_c \ --no-compress \ --simple-md-filenames \ /tmp/asb-md/appstream-icons.tar.gz \ x86_64/repodata/
Any questions, please ask. If you’re using a COPR then all these steps are done for you automatically. If you’re using xdg-app already, then this is all magically done for you as well, and automatically downloaded by GNOME Software.