From Fedora Project Wiki

< User:Kalev

Revision as of 12:14, 11 August 2011 by Kalev (talk | contribs)

This page is a draft only
It is still under construction and content may change. Do not rely on the information on this page.

Draft for Packaging Mozilla Extensions

This is a draft for packaging extensions for Mozilla applications: Firefox, Thunderbird, Seamonkey, and others.


Packages of Mozilla extensions should take into account the upstream name of the extension. All Mozilla extensions MUST follow the scheme of mozilla-<extension>, where <extension> is the name of the extension. Examples include mozilla-adblockplus, mozilla-noscript.


Installation Directories

Packages for Mozilla extensions should place unpacked files in %{_datadir}/mozilla/extensions/common/<extension>/ directory, where <extension> is the name of the package without the mozilla- prefix. Packages that contain architecture specific files should instead use %{_libdir}/mozilla/extensions/<extension>/ directory.

To register an extension for a Mozilla application, the package should drop into the application's extension directory symlinks which point to the actual files in the %{_datadir}/mozilla/extensions/common/<extension>/ directory.

For an example, to register the extension for Mozilla and Thunderbird, the package should:

# Firefox
mkdir -p $RPM_BUILD_ROOT%{_firefox_extdir}
ln -s %{_moz_ext_commondir}/{extension_name} $RPM_BUILD_ROOT%{_firefox_extdir}/{extension_id}
# Thunderbird
mkdir -p $RPM_BUILD_ROOT%{_thunderbird_extdir}
ln -s %{_moz_ext_commondir}/{extension_name} $RPM_BUILD_ROOT%{_thunderbird_extdir}/{extension_id}


Directory Ownership

Mozilla extension packages should Require mozilla-filesystem for common directories, but avoid depending on specific Mozilla applications. For each of the supported Mozilla application, the extension package installs a symlink to the %{_<appname>_extdir} and should also own the directory.

Sample %files section:


Rationale: RPM needs to keep track of the installed directories, so that it could remove them on uninstall. When installing extensions, we drop symlinks to multiple application directories and want to avoid depending on these apps just to satisfy directory ownership requirements. Because of that, Mozilla extension packages need to own all the %{_<appname>_extdir} directories they drop symlinks in.


Macro Usage
_moz_ext_commondir Directory where extension packages should install actual files.
_chatzilla_extdir Chatzilla extension directory for dropping symlinks in
_firefox_extdir Firefox extension directory for dropping symlinks in
_seamonkey_extdir Seamonkey extension directory for dropping symlinks in
_spicebird_extdir Spicebird extension directory for dropping symlinks in
_sunbird_extdir Sunbird extension directory for dropping symlinks in
_thunderbird_extdir Thunderbird extension directory for dropping symlinks in

Sample Spec File