xdg-desktop-menu Install Locations; why /usr/local/share/ and not /usr/share/?
dyek at real.com
Wed Aug 19 14:33:01 PDT 2009
Michael Pyne wrote:
> On Wednesday 19 August 2009 15:22:42 Daniel Yek wrote:
>> This is what xdg-desktop-menu is doing:
>> If $XDG_DATA_DIRS is NULL, xdg_system_dirs is set to:
>> The first writable directory is used.
>> So, if /usr/local/share/ is found, it is used, instead of /usr/share/!
>> It turned out that a distribution wanted us to always install the
>> .desktop file into /usr/share/applications/.
> The way I think of it is that if you were to download a software
> package, and
> compile it and install it yourself for the whole system to use you'd
> to /usr/local.
> On the other hand, distribution-provided software packages (like Red
> Hat RPMs
> or Ubuntu .debs) would be installed to /usr as it is part of the
> and not just a local addon.
Right. And the installer/packages built by 3rd. party vendor should
install to /opt/.
That is software installation directory.
Desktop menu installation (xdg-desktop-menu) that I asked about may be a
different case from software installation.
> So a configure script you provide, along with other software installation
> tools, should default to a prefix of /usr/local if no other prefix is
For software installation directory, the 3rd. party installer cannot
touch /usr/local, which is for locally-built software.
Again, for desktop menu installation, it may be a different case than this.
> Distributions will still need a way to have the package install to
> /usr (well,
> install to any given path actually) in order to make the packages.
> the distribution handles this, but if you use a custom build setup
> with your
> software package then you'd need to provide a way to change where a
> package is
> installed to, either at configure time or at install time.
For configuration time before build, true.
Typical .rpm or .deb packages simply install (correctly) without
interaction. So, the question is by simply using xdg-desktop-menu, would
it install to the correct path? Or how the utility can be used
correctly, so that it can install correctly?
>> Why xdg-desktop-menu doesn't appear to follow the Desktop Menu Spec.?
>> Is it because the directory content in /usr/local/share/ can potentially
>> shadow that from /usr/share/?
>> (If so, the .desktop file installed to the user home directory also
>> shadows the system directory and can be very confusing in some cases.)
> Both of these cases are intentional. /usr/local shadows /usr since it
> is a
> more specific software package (for the given system at least). Home
> directory shadows /usr/local since it is yet again more specific (to a
> specific user now instead of system wide).
The question here is no longer about software installation directories.
It is about what xdg-desktop-menu was intended to do as designed.
>> A few other questions...
>> (2) Any idea why if this directory, /usr/share/desktop-directories/,
>> isn't found on a system, xdg-desktop-menu will not work? Is that just a
>> bug? xdg-desktop-menu: No writable system menu directory found.
> Does /usr/local/share/desktop-directories/ exist?
The directory doesn't exist on certain distribution/installation.
> The error message means
> exactly what it says: There is nowhere to put the .desktop files meant to
> create a system-wide menu entry.
It doesn't install into it though -- the directory remain empty after it
installed the .desktop file correctly.
It appears more like a script problem to me (although I didn't read into
the script much when I debug through it.)
This is also an issue of how reliable is xdg-desktop-menu. Software
packages should be able to rely on the utility to do the right thing,
not to error out during installation. :-) Right?
More information about the xdg