path: root/src/
diff options
Diffstat (limited to 'src/')
1 files changed, 25 insertions, 5 deletions
diff --git a/src/ b/src/
index 227c8f5..595d0d8 100644
--- a/src/
+++ b/src/
@@ -35,6 +35,13 @@
# our best to extract the em:id from the install.rdf file shipped
# by any xpi
+# if defined the given command will be run _before_ the extension
+# gets packaged up the standard .xpi way. Thus, the build command
+# should produce an .xpi in top level directory. Note: If this
+# command is specified, all .xpi files in the top level directory
+# will be removed during |clean|
TEMPDIR := $(shell rm -rf temp-xpi-*; mktemp -d temp-xpi-XXXXXXXX)
@@ -50,20 +57,33 @@ else
XPI_EMID = $(shell xpath -e '/node()/Description/em:id/text()' $(1)/install.rdf 2>/dev/null)
-# cdbs hooks (TODO implement these)
+# ### cdbs hooks
+# build xpi using MOZ_XPI_BUILD_COMMAND if defined
+install/$(MOZ_EXTENSION_PKG):: xpi-install
+# clean build and remove all .xpi in top-level if a MOZ_XPI_BUILD_COMMAND is defined
+clean:: xpi-clean
+ rm -f *.xpi
-# general helper targets
+# ### general helper targets
unzip -d $(TEMPDIR) $*
touch $@
dh_installdirs -p$(MOZ_EXTENSION_PKG) /usr/lib/firefox-addons/extensions
dh_install -p$(MOZ_EXTENSION_PKG) $(wildcard $(TEMPDIR)/*) /usr/share/$(MOZ_EXTENSION_PKG)
dh_link -p$(MOZ_EXTENSION_PKG) /usr/share/$(MOZ_EXTENSION_PKG) /usr/lib/firefox-addons/extensions/$(call XPI_EMID,$(TEMPDIR))
touch $@
-stamp-extension-install: $(XPI_FILE) unzip-$(XPI_FILE) install-$(XPI_FILE)
+stamp-extension-install: $(XPI_FILE) stamp-unzip-$(XPI_FILE) stamp-install-$(XPI_FILE)
touch stamp-extension-install