From Fedora Project Wiki

Revision as of 15:59, 13 October 2010 by Kalev (talk | contribs) (Created page with '{{Draft}} == Draft for Packaging Mozilla Extensions == This is a draft for packaging extensions for Mozilla applications: Firefox, Thunderbird, Seamonkey, and others. == Naming...')
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)

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.

Naming

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.

Rationale:

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}

Rationale:

Directory Ownership

Mozilla extension packages should not Require a specific Mozilla application. As per Packaging/Guidelines, to avoid unowned directories Mozilla extension packages should own all the directories under %{_moz_extdir}.

Sample %files section:

Rationale:

Macros

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