For the last couple of releases Fedora has been shipping the appstream metadata in a package. First it was the
gnome-software package, but this wasn’t an awesome dep for KDE applications like Apper and was a pain to keep updated. We then moved the data to an
appstream-data package, but this was just as much of a hack that was slightly more palatable for KDE. What I’ve wanted for a long time is to actually ship the metadata as metadata, i.e. next to the other files like
primary.xml.gz on the mirrors.
I’ve just pushed the final patches to libhif, PackageKit and appstream-glib, which that means if you ship metadata of type
repomd.xml then they get downloaded automatically and decompressed into the right place so that gnome-software and apper can use the data magically.
I had not worked on this much before, as
appstream-builder (which actually produces the two AppStream files) wasn’t suitable for the Fedora builders for two reasons:
- Even just processing the changed packages, it took a lot of CPU, memory, and thus time.
- Downloading screenshots from random websites all over the internet wasn’t something that a build server can do.
modifyrepo_c to the rescue. This is what I’m currently doing for the Utopia repo.
createrepo_c --no-database x86_64/ createrepo_c --no-database SRPMS/ modifyrepo_c \ --no-compress \ /tmp/asb-md/appstream.xml.gz \ x86_64/repodata/ modifyrepo_c \ --no-compress \ /tmp/asb-md/appstream-icons.tar.gz \ x86_64/repodata/
If you actually do want to create the metadata on the build server, this is what I use for Utopia:
appstream-builder \ --api-version=0.8 \ --origin=utopia \ --cache-dir=/tmp/asb-cache \ --enable-hidpi \ --max-threads=4 \ --min-icon-size=48 \ --output-dir=/tmp/asb-md \ --packages-dir=x86_64/ \ --temp-dir=/tmp/asb-icons \ --screenshot-uri=http://people.freedesktop.org/~hughsient/fedora/21/screenshots/
For Fedora, I’m going to suggest getting the data files from alt.fedoraproject.org during compose. It’s not ideal as it still needs a separate server to build them on (currently sitting in the corner of my office) but gets us a step closer to what we want. Comments, as always, welcome.