summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorAlexander Sack <asac@jwsdot.com>2008-02-21 12:31:21 +0000
committerAlexander Sack <asac@jwsdot.com>2008-02-21 12:31:21 +0000
commit87f14814ca495dd0016d373821a5e3dbc60cbbc7 (patch)
tree851145554ab12ad69aa6cad6f8d1e17b442de710 /src
parent809c853639f4893263aa7b6a893ee19d7f84d56a (diff)
* rename xpi.mk stamp files: use stamp- as a prefix
- update src/xpi.mk.in * implement default cdbs hooks for build, install and clean - update src/xpi.mk.in * implement new variable MOZ_XPI_BUILD_COMMAND which is run at cdbs build/PACKAGENAME stage if defined; if defined we remove all .xpi files from top-level directory in |clean| accordingly - update src/xpi.mk.in
Diffstat (limited to 'src')
-rw-r--r--src/xpi.mk.in30
1 files changed, 25 insertions, 5 deletions
diff --git a/src/xpi.mk.in b/src/xpi.mk.in
index 227c8f5..595d0d8 100644
--- a/src/xpi.mk.in
+++ b/src/xpi.mk.in
@@ -35,6 +35,13 @@
# our best to extract the em:id from the install.rdf file shipped
# by any xpi
#
+# MOZ_XPI_BUILD_COMMAND (OPTIONAL):
+# 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)
endif
-# cdbs hooks (TODO implement these)
+# ### cdbs hooks
+# build xpi using MOZ_XPI_BUILD_COMMAND if defined
+build/$(MOZ_EXTENSION_PKG)::
+ifneq (,$(MOZ_XPI_BUILD_COMMAND))
+ $(MOZ_XPI_BUILD_COMMAND)
+endif
+
+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
+ifneq (,$(MOZ_XPI_BUILD_COMMAND))
+ rm -f *.xpi
+endif
-# general helper targets
-unzip-%:
+# ### general helper targets
+stamp-unzip-%:
unzip -d $(TEMPDIR) $*
touch $@
-install-%:
+stamp-install-%:
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