Policy for packaging extensions for XUL based applications

This is a draft and up for discussion on pkg-mozext-maintainers@lists.alioth.debian.org:

Filesystem Placement and Linking

Packages shipping extensions for XUL-based applications like iceweasel or icedove should put unpack the contents of the extension in a folder in /usr/share/mozilla/extensions/common. Packages that also contain architecture-dependent material should place the architecture-dependent material in a folder in /usr/lib/mozilla/extensions/common and symlink to it from the folder under /usr/share/mozilla/extensions/common

The unpacked extension directory should then be symlinked into the applications directory of every XUL application that can use the extension. For example, the package for an extension "fubar" which works with iceape (app-id {92650c4d-4b8e-4d2a-b7eb-24ecf4f6b63a}) and iceweasel (app-id {ec8030f7-c20a-464f-9b0e-13a3a9e97384}) should drop links into both /usr/share/mozilla/extensions/{ec8030f7-c20a-464f-9b0e-13a3a9e97384}/fubar and /usr/share/mozilla/extensions/{92650c4d-4b8e-4d2a-b7eb-24ecf4f6b63a}/fubar, each pointing to /usr/share/mozilla/extensions/common/fubar.

Package Naming

The binary package's name should be xul-ext-<ext> with <ext> being the extension's name. E.g. xul-ext-nostalgy for Icedove's nostalgy extension.

In order to ease finding extensions for a given application the packages should

Provides: <xul-based-app1>-<extension>, <xul-based-app2>-<extension>, ...

and

Enhances: <xul-based-app1>, <xul-based-app2>, ...

where xul-based-app1 and xul-based-app2 are e.g. iceweasel and iceape.

Rationale:

Config Files

Note that many extensions contain default preferences files (e.g. defaults/preferences/fubar.js). Site administrators may want to customize these preferences for their users, so they should be treated as conffiles. The simplest way to do this is to place the file somewhere under /etc (WHERE? /etc/mozilla-extensions/fubar.js seems common right now), and create a symlink back to it from the unpacked xpi tree.

Implementation/Tools

It is recommended to use mozilla-devscripts. It will realize the policy for you.