summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAlexander Sack <asac@ubuntu.com>2009-07-26 17:20:29 +0200
committerAlexander Sack <asac@ubuntu.com>2009-07-26 17:20:29 +0200
commit064ad998b90da2dca915022f1c6b024074413c8d (patch)
treea9fb8c884759bd76cecb0d485d94d07e3d7e6305
parent52f2fa8e92bc74f196a0ecba9d4d2e05d2c7add2 (diff)
* xpi.mk:
- add target application id magic (|XPI_TARGET_EMIDs|); parse install.rdf and create extension links for all targetapplications like: |/usr/lib/mozilla/extensions/$targetappid/$extid|; in same turn we deprecate |MOZ_XPI_MOZILLA_DIRS| and unset its default accordingly - update src/xpi.mk
-rw-r--r--debian/changelog11
-rw-r--r--src/xpi.mk36
2 files changed, 34 insertions, 13 deletions
diff --git a/debian/changelog b/debian/changelog
index d9fc7db..4b311ac 100644
--- a/debian/changelog
+++ b/debian/changelog
@@ -1,3 +1,14 @@
+mozilla-devscripts (0.14) UNRELEASED; urgency=low
+
+ * xpi.mk:
+ - add target application id magic (|XPI_TARGET_EMIDs|); parse install.rdf
+ and create extension links for all targetapplications like:
+ |/usr/lib/mozilla/extensions/$targetappid/$extid|; in same turn we
+ deprecate |MOZ_XPI_MOZILLA_DIRS| and unset its default accordingly
+ - update src/xpi.mk
+
+ -- Alexander Sack <asac@ubuntu.com> Sun, 26 Jul 2009 17:14:39 +0200
+
mozilla-devscripts (0.13) unstable; urgency=low
First debian upload (Closes: 528225)
diff --git a/src/xpi.mk b/src/xpi.mk
index d1923c9..b622ebe 100644
--- a/src/xpi.mk
+++ b/src/xpi.mk
@@ -1,6 +1,6 @@
# -*- mode: makefile; coding: utf-8 -*-
-# Copyright (c) 2008 Canonical Ltd.
+# Copyright (c) 2008-2009 Canonical Ltd.
# Author(s): Alexander Sack <asac@ubuntu.com>
# Fabien Tassin <fta@sofaraway.org>
#
@@ -42,21 +42,26 @@
# 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|
-# MOZ_XPI_MOZILLA_DIRS (DEFAULT=firefox-addons):
+#
+#
+# Deprecated variables:
+#
+# MOZ_XPI_MOZILLA_DIRS /deprecated/ (OPTIONAL/NODEFAULT - see "Note:"):
# defines in which directories to create links for this extension.
# the default is "firefox-addons", which means that
# the extension will be linked appropriately to the
# /usr/lib/firefox-addons/extensions directory.
+# '''Note''': this variable is deprecated and will go away; the
+# default is already empty; if you still need this variable, migrate
+# your code to MOZ_XPI_MOZILLA_EXTRA_DIRS
#
-MOZ_XPI_MOZILLA_DIRS ?= firefox-addons
-
MOZ_XPI_BUILD_COMMAND ?= med-xpi-pack $(CURDIR) $(MOZ_EXTENSION_PKG).xpi;
-TEMPDIR := $(shell rm -rf temp-xpi-*; mktemp -d temp-xpi-XXXXXXXX)
+TEMPDIR := temp-xpi-unpacked
ifneq (,$(MOZ_XPI_FILE))
-XPI_FILE = $(MOZ_XPI_FILE)
+XPI_FILE = $(wildcard $(MOZ_XPI_FILE))
else
XPI_FILE = $(wildcard *.xpi)
endif
@@ -70,6 +75,12 @@ else
XPI_EMID = $(shell xpath -e '/node()/Description/em:id/text()' $(1)/install.rdf 2>/dev/null)
endif
+ifeq (,$(MOZ_XPI_DISABLE_AUTOLINKS))
+XPI_TARGET_EMIDs = \
+ $(shell xpath -q -e '//em:targetApplication//@em:id' $(1)/install.rdf | sed -e 's/.*"\(.*\)"/\1/') \
+ $(shell xpath -q -e '//em:targetApplication//em:id/text()' $(1)/install.rdf)
+endif
+
# ### cdbs hooks
# build xpi using MOZ_XPI_BUILD_COMMAND if defined
build/$(MOZ_EXTENSION_PKG)::
@@ -86,19 +97,18 @@ ifneq (,$(MOZ_XPI_BUILD_COMMAND))
endif
# ### general helper targets
-stamp-unzip-%:
+stamp-unzip-%: $(XPI_FILE)
unzip -d $(TEMPDIR) $(XPI_DIR)$*
touch $@
-stamp-installdirs-%:
- dh_installdirs -p$(MOZ_EXTENSION_PKG) /usr/lib/$*/extensions
- touch $@
-
-stamp-installlinks-%:
+stamp-installlinks-%: stamp-unzip-%*
dh_link -p$(MOZ_EXTENSION_PKG) /usr/share/$(MOZ_EXTENSION_PKG) /usr/lib/$*/extensions/$(call XPI_EMID,$(TEMPDIR))
touch $@
-stamp-install-%: $(foreach mozilla,$(MOZ_XPI_MOZILLA_DIRS),stamp-installdirs-$(mozilla) stamp-installlinks-$(mozilla))
+stamp-autolinks: $(foreach mozilla,$(MOZ_XPI_MOZILLA_DIRS),stamp-installlinks-$(mozilla))
+ $(foreach id,$(call XPI_TARGET_EMIDs,$(TEMPDIR)),dh_link -p$(MOZ_EXTENSION_PKG) /usr/share/$(MOZ_EXTENSION_PKG) /usr/lib/mozilla/extensions/$(id);)
+
+stamp-install-%: stamp-autolinks
dh_install -p$(MOZ_EXTENSION_PKG) $(wildcard $(TEMPDIR)/*) /usr/share/$(MOZ_EXTENSION_PKG)
touch $@