mozilla-devscripts makes packaging extensions for XUL based applications easy. It provides a bunch of scripts and the CDBS snippet /usr/share/mozilla-devscripts/, which can be included by debian/rules. You only have to build a .xpi file, everything else will be done by mozilla-devscripts. It will extract the xpi file, remove extra license files, install it and set the links.


simplified dh 7

You can use this simplified dh 7 rule if your source contains the extracted .xpi file. This requires mozilla-devscripts (>= 0.22~).

#!/usr/bin/make -f

        dh $@ --with xul-ext --buildsystem=xul_ext

extended dh 7

The xul_ext build system does nothing else than the following rule file. This rule file required only mozilla-devscripts (>= 0.19~). You can use this snippet if your extension provides a build system (like ant or make) and you need to override the dh_auto_build rule.

#!/usr/bin/make -f

        dh $@ --with xul-ext

        # put here the commands used for building the xpi file, for example:
        xpi-pack . xul-ext-fubar.xpi

        install-xpi xul-ext-fubar.xpi

        rm -f xul-ext-fubar.xpi

multiple xpi files

Installing multiple xpi file is supported too.

#!/usr/bin/make -f

        dh $@ --with xul-ext

        # put here the commands used for building the xpi files, for example:

        install-xpi -p xul-ext-bla bla.xpi
        install-xpi -p xul-ext-keks keks.xpi

        rm -f *.xpi


CDBS is support by mozilla-devscripts.

building from source

You have to run one command if you build the xpi file from source. Some extensions will provide a makefile to create the xpi file and you have to run "make", some will use ant and you have to run "ant", some will provide a shell script and you have to run "sh". Your debian/rules file will look like this with CDBS:

#!/usr/bin/make -f


include /usr/share/cdbs/1/rules/
include /usr/share/mozilla-devscripts/

An example for this design is notify-extension.

using xpi file

You should use med-xpi-unpack to create the source file if you use the xpi file from upstream. Please do not drop the xpi file into your sources. Your debian/rules file will be very simple if you use med-xpi-unpack to create the source. mozilla-devscripts will pack the files for you. You do not have to set MOZ_XPI_BUILD_COMMAND.

#!/usr/bin/make -f

include /usr/share/cdbs/1/rules/
include /usr/share/mozilla-devscripts/

An example for this design is flashgot.


The debian/control file will normally look like:

Section: web
Priority: optional
Maintainer: Debian Mozilla Extension Maintainers <>
Uploaders: Your Fullname <your@email.tld>
Build-Depends: debhelper (>= 9), mozilla-devscripts (>= 0.34~)
Standards-Version: 3.9.4
Vcs-Git: git://

Package: xul-ext-EXTENSIONNAME
Architecture: all
Depends: ${misc:Depends}, ${xpi:Depends}
Recommends: ${xpi:Recommends}
Breaks: ${xpi:Breaks}
Provides: ${xpi:Provides}
Enhances: ${xpi:Enhances}
Description: one line for short description
 Long descriptions can span
 multiple lines
 and as above empty lines


This is an example watch file for an extension that is available on