datarootdir v.s. datadir

Public Service Announcement: Debian helpfully defines datadir to be /usr/share/games for some packages, which means that the AppData and MetaInfo files get installed into /usr/share/games/appdata which isn’t picked up by the metadata parsers.

It’s probably safer to install the AppData files into $datarootdir/appdata as this will work even if a distro has redefined datadir to be something slightly odd. I’ve changed the examples on the AppData page, but if you maintain a game on Debian with AppData then this might affect you when Debian starts extracting AppSpream metadata in the next few weeks. Anyone affected will be getting email in the next few days, although it only looks to affect very few people.

Published by

hughsie

Richard has over 10 years of experience developing open source software. He is the maintainer of GNOME Software, PackageKit, GNOME Packagekit, GNOME Power Manager, GNOME Color Manager, colord, and UPower and also contributes to many other projects and opensource standards. Richard has three main areas of interest on the free desktop, color management, package management, and power management. Richard graduated a few years ago from the University of Surrey with a Masters in Electronics Engineering. He now works for Red Hat in the desktop group, and also manages a company selling open source calibration equipment. Richard's outside interests include taking photos and eating good food.

3 thoughts on “datarootdir v.s. datadir”

  1. Debian itself doesn’t define variables, this happens on a per-package base and is thus in control of the respective maintainer. Which package did you find affected by this odd definition?

  2. I’ve been bitten by that too. Someone at some point decided it was a good idea to arbitrarily put games in special directory. While I can see that may have made sense from a corporate perspective years ago when it wasn’t easy to filter on package metadata, it’s just silly now. I wish someone would make it a goal in Debian to kill that exception.

  3. If a game in Debian is configured with ${datadir} = /usr/share/games, it’s straightforward for its packager to redirect the app-data, desktop files, etc. back into /usr/share/whatever (via debian/install).

    Neither debhelper nor cdbs seems to have any special magic for /usr/share/games, so if a particular game has ${datadir} = /usr/share/games, that would have to be something its packager had done deliberately…

    Debian Policy says game executables should be in /usr/games instead of /usr/bin, and Lintian currently checks for that. Some game packagers think that’s wrong and want to change it; it’s somewhat stronger than what the FHS says, which is that /usr/games *may* exist (but does not seem to require that all games are there). Similarly, the FHS says /usr/share/games and /usr/lib/games may exist, but does not seem to require that games must use them.

Comments are closed.