summaryrefslogtreecommitdiff
path: root/src/xpi.mk
diff options
context:
space:
mode:
Diffstat (limited to 'src/xpi.mk')
-rw-r--r--src/xpi.mk24
1 files changed, 14 insertions, 10 deletions
diff --git a/src/xpi.mk b/src/xpi.mk
index 35cd037..98a4e5d 100644
--- a/src/xpi.mk
+++ b/src/xpi.mk
@@ -153,7 +153,7 @@ MOZ_EXTENSION_PKG ?= $(strip $(shell grep ^Package: debian/control | head -n 1 |
MOZ_XPI_ARCH := $(strip $(shell egrep '^Package:|^Architecture:' debian/control | grep -A1 '^Package:[ \t]*$(MOZ_EXTENSION_PKG)[ \t]*$$' | grep ^Architecture: | sed -e 's/Architecture://'))
-MOZ_XPI_BUILD_COMMAND ?= med-xpi-pack $(CURDIR) $(MOZ_EXTENSION_PKG).xpi;
+MOZ_XPI_BUILD_COMMAND ?= med-xpi-pack $(CURDIR) $(MOZ_EXTENSION_PKG).xpi
ALL_XPI_RECOMMENDS = $(sort $(foreach id,$(call XPI_TARGET_EMIDs,$(TEMPDIR)), \
$(foreach package,$(packages_$(id)),$(call CHECK_VERSION,$(id),$(package)))))
@@ -178,7 +178,6 @@ XPI_FILE = $(wildcard *.xpi)
endif
XPI_BASE_FILE = $(notdir $(XPI_FILE))
-XPI_DIR = $(dir $(XPI_FILE))
ifneq (,$(MOZ_XPI_EMID))
XPI_EMID = $(MOZ_XPI_EMID)
@@ -188,8 +187,8 @@ 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)
+ $(shell xpath -q -e '//em:targetApplication//@em:id' $(1)/install.rdf 2>/dev/null | sed -e 's/.*"\(.*\)"/\1/') \
+ $(shell xpath -q -e '//em:targetApplication//em:id/text()' $(1)/install.rdf 2>/dev/null)
endif
# local vars
@@ -211,22 +210,27 @@ install/$(MOZ_EXTENSION_PKG):: xpi-install
# ### general helper targets
unzip-%-stamp: $(XPI_FILE)
+ @if test ! -f "$^" -a -f "$<"; then \
+ echo "xpi.mk: Failed to extract the xpi file, there are multiple: $^"; \
+ echo "xpi.mk: Either create only one xpi file or specify MOZ_XPI_FILE!"; \
+ exit 1; \
+ fi
mkdir -p $(TEMPDIR)
ifneq (,$(MOZ_XPI_DOCUMENTED_LICENSE_FILES))
- unzip -o -d $(TEMPDIR) $(XPI_DIR)$* -x $(MOZ_XPI_DOCUMENTED_LICENSE_FILES)
+ unzip -o -d $(TEMPDIR) $^ -x $(MOZ_XPI_DOCUMENTED_LICENSE_FILES)
else
- unzip -o -d $(TEMPDIR) $(XPI_DIR)$*
+ unzip -o -d $(TEMPDIR) $^
ifeq ($(origin MOZ_XPI_DOCUMENTED_LICENSE_FILES),undefined)
cd $(TEMPDIR) && find \( -iname copying -o -iname gpl.txt -o -iname licen[cs]e -o -iname licen[cs]e.txt \) -printf "xpi.mk: deleted %p\n" -delete
endif
endif
touch $@
-installlinks-%-stamp: unzip-$(XPI_BASE_FILE)-stamp
+installlinks-%-stamp: $(patsubst %,unzip-%-stamp,$(XPI_BASE_FILE))
dh_link -p$(MOZ_EXTENSION_PKG) /usr/$(lib_share_dir)/$(MOZ_EXTENSION_PKG) /usr/lib/$*/extensions/$(call XPI_EMID,$(TEMPDIR))
touch $@
-autolinks-stamp: unzip-$(XPI_BASE_FILE)-stamp $(foreach mozilla,$(MOZ_XPI_MOZILLA_DIRS),installlinks-$(mozilla)-stamp)
+autolinks-stamp: $(patsubst %,unzip-%-stamp,$(XPI_BASE_FILE)) $(foreach mozilla,$(MOZ_XPI_MOZILLA_DIRS),installlinks-$(mozilla)-stamp)
$(foreach id,$(call XPI_TARGET_EMIDs,$(TEMPDIR)),dh_link -p$(MOZ_EXTENSION_PKG) /usr/$(lib_share_dir)/$(MOZ_EXTENSION_PKG) /usr/lib/mozilla/extensions/$(id)/$(call XPI_EMID,$(TEMPDIR));)
touch $@
@@ -234,7 +238,7 @@ install-%-stamp: unzip-%-stamp
dh_install -p$(MOZ_EXTENSION_PKG) $(wildcard $(TEMPDIR)/*) /usr/$(lib_share_dir)/$(MOZ_EXTENSION_PKG)
touch $@
-xpi-recommends-stamp: unzip-$(XPI_BASE_FILE)-stamp
+xpi-recommends-stamp: $(patsubst %,unzip-%-stamp,$(XPI_BASE_FILE))
if test -f debian/$(MOZ_EXTENSION_PKG).substvars; then sed -i '/^xpi:Recommends=/d' debian/$(MOZ_EXTENSION_PKG).substvars; fi
echo "xpi:Recommends=$(XPI_RECOMMENDS)" | sed "s/ / | /g" >> debian/$(MOZ_EXTENSION_PKG).substvars
ifneq ($(shell grep '$${xpi:Depends}' debian/control),)
@@ -248,7 +252,7 @@ endif
echo "xpi:Enhances=$(XPI_RECOMMENDS)" | sed "s/ /, /g" >> debian/$(MOZ_EXTENSION_PKG).substvars
touch $@
-xpi-install: install-$(XPI_BASE_FILE)-stamp autolinks-stamp xpi-recommends-stamp
+xpi-install: $(patsubst %,install-%-stamp,$(XPI_BASE_FILE)) autolinks-stamp xpi-recommends-stamp
# clean build and remove all .xpi in top-level if a MOZ_XPI_BUILD_COMMAND is defined
clean::