summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorAlexander Sack <asac@jwsdot.com>2008-02-21 12:34:26 +0000
committerAlexander Sack <asac@jwsdot.com>2008-02-21 12:34:26 +0000
commitcc808aca7ed6e5c7a968b2b8598aa249a7d76ed4 (patch)
tree3b028ed6534b8db27edab8220dc22163ca69af9c /src
parent8db3b2d83d2bf9c8e39a17ab5f4885ebfe57843c (diff)
parent87f14814ca495dd0016d373821a5e3dbc60cbbc7 (diff)
* merge changes from .local development branch
- keep src/xpi.mk
Diffstat (limited to 'src')
-rw-r--r--src/xpi.mk30
1 files changed, 25 insertions, 5 deletions
diff --git a/src/xpi.mk b/src/xpi.mk
index 227c8f5..595d0d8 100644
--- a/src/xpi.mk
+++ b/src/xpi.mk
@@ -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