Improve support for apps installed in /opt/

Registered by Michael Hall

Discuss the platform changes needed to support /opt/ installation for things like Unity .lens and .scope files, dbus .service files and application .desktop files

Blueprint information

Status:
Not started
Approver:
Steve Langasek
Priority:
Medium
Drafter:
None
Direction:
Approved
Assignee:
Steve Langasek
Definition:
Approved
Series goal:
Accepted for raring
Implementation:
Unknown
Milestone target:
None

Related branches

Sprints

Whiteboard

File locations:
https://wiki.ubuntu.com/AppDevUploadProcess#TableWhitelistedInstallLocations

Identified work items:
https://wiki.ubuntu.com/AppDevUploadProcess#A.2BAC8-opt.2BAC8_Build_Relocation

We need namespacing:2
 - Ideally packaging does it for you rather than having to modify upstream -- pure filenames go into /opt and then are symlinked and so on by the packaging
- The packaging system provides symlinks to the integration points in /usr/share/

Can all of the integration points consume symlinks?
 - Probably

Currently Unity displays .desktop files by filename order, so extras.ubuntu.com/* would all arrive in one big clump.
  - This is why we are renaming it zzzzzzextras.ubuntu.com

 - all files being installed should be generated at build time to reference the prefix; upstream dev should never have to type /opt/extras anywhere in their upstream code

Assume symlinks are namespaced with 'extras' (or 'extras.ubuntu.com') in the filename

Changes:
Unity Dash .lens and .scope files (symlink - possibly unity should search in /opt/extras for the files because of ordering in the results? But maybe unity should sort by the name instead of filename)
DBus .service definitions (symlink)
AppArmor profiles - don't come from upstream, these are generated at build-time and installed in /etc
XDG .desktop files (symlink)
Apport source package hooks files (symilnk)
Compiled glib .schema files - preferable to keep this confined to /opt because that preserves runtime namespace of schemas for system apps; XDG_DATA_DIRS has to be set already for the app; we think debhelper should handle adding the snippet to compile for the per-package dir
Online Accounts (symlink)
docs/man/info files (copyright file: don't symlink. Other docs: symlink) Don't have man pages; not in path)
Yelp help docs (symlink)
PolicyKit actions (root is not allowed)
Mime type definitions (not allowed)
Thumbnailers (not allowed)
Theme lookup of icon by name (not allowed, file bugs if full paths aren't an option)

(?)

Work Items

Work items:
[mhall119] File a bug in Unity to sort apps in the Dash by (localized) name instead of file name (Bug #1081296): DONE
[vorlon] Create symlinks for .desktop: TODO
[vorlon] Create symlinks for .lens and .scope: TODO
[vorlon] Create symlinks for DBus .service: TODO
[vorlon] Create symlinks for apport source package hooks: TODO
[vorlon] Create symlinks for online accounts providers: TODO
[vorlon] Create symlinks for docs/man/info: TODO
[vorlon] Create symlinks for yelp documentation: TODO
[vorlon] Add glib schema compilation snippets with debhelper: TODO