summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBenjamin Drung <bdrung@ubuntu.com>2009-12-02 14:00:11 +0100
committerBenjamin Drung <bdrung@ubuntu.com>2009-12-02 14:00:11 +0100
commit61757cd02f584f0b9982221f9d1af8e2979bad1e (patch)
tree8e860ed96af96861320b550a18dc6de70140a9b5
parent55342cec097064091ff15d1fa6ebf243b88c52a5 (diff)
* xpi.mk:
- get rid of temp directory; extract xpi file directly into installation directory - update src/xpi.mk
-rw-r--r--debian/changelog9
-rw-r--r--src/xpi.mk56
2 files changed, 34 insertions, 31 deletions
diff --git a/debian/changelog b/debian/changelog
index ef14c96..630bbac 100644
--- a/debian/changelog
+++ b/debian/changelog
@@ -1,3 +1,12 @@
+mozilla-devscripts (0.19) UNRELEASED; urgency=low
+
+ * xpi.mk:
+ - get rid of temp directory; extract xpi file directly into installation
+ directory
+ - update src/xpi.mk
+
+ -- Benjamin Drung <bdrung@ubuntu.com> Wed, 02 Dec 2009 12:13:19 +0100
+
mozilla-devscripts (0.18) unstable; urgency=low
[ Sasa Bodiroza <jazzva@gmail.com> ]
diff --git a/src/xpi.mk b/src/xpi.mk
index e7e94bf..5592693 100644
--- a/src/xpi.mk
+++ b/src/xpi.mk
@@ -95,15 +95,14 @@ include $(_xpi_makefile_path)/xpi-data-$(MOZ_XPI_DISTRO).mk
# call parameters_
# 1- target app id
# 2- maxVersion | minVersion
-# 3- extension dir
-TARGET_VERSION = $(shell xpath -q -e '//em:targetApplication/Description[em:id="$(1)" or @em:id="$(1)"]/em:$(2)/text() | //em:targetApplication/Description[em:id="$(1)" or @em:id="$(1)"]/@em:$(2) | //RDF:Description[@em:id="$(1)"]/em:$(2)/text() | //RDF:Description[@em:id="$(1)"]/@em:$(2)' $(3)/install.rdf | sed -e 's/.*"\(.*\)"/\1/')
+TARGET_VERSION = $(shell xpath -q -e '//em:targetApplication/Description[em:id="$(1)" or @em:id="$(1)"]/em:$(2)/text() | //em:targetApplication/Description[em:id="$(1)" or @em:id="$(1)"]/@em:$(2) | //RDF:Description[@em:id="$(1)"]/em:$(2)/text() | //RDF:Description[@em:id="$(1)"]/@em:$(2)' $(install_dir)/install.rdf | sed -e 's/.*"\(.*\)"/\1/')
# call parameters_
# 1- target app id
# 2- package name
CHECK_VERSION = $(shell \
- moz-version -cs "$($(2)_eol)" ge $(call TARGET_VERSION,$(1),minVersion,$(TEMPDIR)) && \
- moz-version -cs "$($(2)_sol)" le $(call TARGET_VERSION,$(1),maxVersion,$(TEMPDIR)) && \
+ moz-version -cs "$($(2)_eol)" ge $(call TARGET_VERSION,$(1),minVersion) && \
+ moz-version -cs "$($(2)_sol)" le $(call TARGET_VERSION,$(1),maxVersion) && \
echo $(2))
MOZ_EXTENSION_PKG ?= $(strip $(shell grep ^Package: debian/control | head -n 1 | sed "s/^Package://"))
@@ -112,7 +111,7 @@ MOZ_XPI_ARCH := $(strip $(shell egrep '^Package:|^Architecture:' debian/control
MOZ_XPI_BUILD_COMMAND ?= med-xpi-pack $(CURDIR) $(MOZ_EXTENSION_PKG).xpi
-XPI_RECOMMENDS = $(strip $(foreach id,$(call XPI_TARGET_EMIDs,$(TEMPDIR)), \
+XPI_RECOMMENDS = $(strip $(foreach id,$(XPI_TARGET_EMIDs), \
$(foreach package,$(packages_$(id)),$(call CHECK_VERSION,$(id),$(package)))))
# support for deprecated MOZ_EXT_NAME
@@ -128,8 +127,6 @@ endif
strip_version = $(sort $(foreach package,$(1),$(shell echo $(package) | sed "s/-[0-9.]*$$//")))
XPI_PROVIDES = $(sort $(filter-out $(MOZ_EXTENSION_PKG),$(ADDITIONAL_PROVIDES) $(addsuffix -$(MOZ_XPI_EXT_NAME),xul-ext $(call strip_version,$(XPI_RECOMMENDS)))))
-TEMPDIR := temp-xpi-unpacked
-
ifneq (,$(MOZ_XPI_FILE))
XPI_FILE = $(wildcard $(MOZ_XPI_FILE))
else
@@ -141,27 +138,29 @@ XPI_BASE_FILE = $(notdir $(XPI_FILE))
ifneq (,$(MOZ_XPI_EMID))
XPI_EMID = $(MOZ_XPI_EMID)
else
-XPI_EMID = $(sort $(shell xpath -q -e '/node()/Description/em:id/text() | //RDF:Description[@RDF:about="urn:mozilla:install-manifest"]/em:id/text()' $(1)/install.rdf 2>/dev/null) \
- $(shell xpath -q -e '/node()/Description/@em:id | //RDF:Description[@RDF:about="urn:mozilla:install-manifest"]/@em:id' $(1)/install.rdf 2>/dev/null | sed -e 's/.*"\(.*\)"/\1/'))
+XPI_EMID = $(sort $(shell xpath -q -e '/node()/Description/em:id/text() | //RDF:Description[@RDF:about="urn:mozilla:install-manifest"]/em:id/text()' $(install_dir)/install.rdf 2>/dev/null) \
+ $(shell xpath -q -e '/node()/Description/@em:id | //RDF:Description[@RDF:about="urn:mozilla:install-manifest"]/@em:id' $(install_dir)/install.rdf 2>/dev/null | sed -e 's/.*"\(.*\)"/\1/'))
endif
ifeq (,$(MOZ_XPI_DISABLE_AUTOLINKS))
-RDF_RESOURCES = $(shell xpath -q -e '//em:targetApplication/@RDF:resource' $(1)/install.rdf 2>/dev/null | sed -e 's/.*="\(.*\)"/\1/')
+RDF_RESOURCES = $(shell xpath -q -e '//em:targetApplication/@RDF:resource' $(install_dir)/install.rdf 2>/dev/null | sed -e 's/.*="\(.*\)"/\1/')
XPI_TARGET_EMIDs = \
- $(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) \
- $(foreach resource,$(RDF_RESOURCES),$(shell xpath -q -e '//RDF:Description[@RDF:about="$(resource)"]/@em:id' $(1)/install.rdf 2>/dev/null | sed -e 's/.*"\(.*\)"/\1/'))
+ $(shell xpath -q -e '//em:targetApplication//@em:id' $(install_dir)/install.rdf 2>/dev/null | sed -e 's/.*"\(.*\)"/\1/') \
+ $(shell xpath -q -e '//em:targetApplication//em:id/text()' $(install_dir)/install.rdf 2>/dev/null) \
+ $(foreach resource,$(RDF_RESOURCES),$(shell xpath -q -e '//RDF:Description[@RDF:about="$(resource)"]/@em:id' $(install_dir)/install.rdf 2>/dev/null | sed -e 's/.*"\(.*\)"/\1/'))
endif
# local vars
# + lib_share_dir - for arch all this is "share"; otherwise "lib"
ifeq (all, $(MOZ_XPI_ARCH))
-lib_share_dir = share
+lib_share_dir := share
else
-lib_share_dir = lib
+lib_share_dir := lib
endif
+install_dir := debian/$(MOZ_EXTENSION_PKG)/usr/$(lib_share_dir)/$(MOZ_EXTENSION_PKG)
+
# ### cdbs hooks
# build xpi using MOZ_XPI_BUILD_COMMAND if defined
build/$(MOZ_EXTENSION_PKG)::
@@ -172,43 +171,39 @@ endif
install/$(MOZ_EXTENSION_PKG):: xpi-install
# ### general helper targets
-unzip-%-stamp: $(XPI_FILE)
+install-%-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)
+ mkdir -p $(install_dir)
ifneq (,$(MOZ_XPI_DOCUMENTED_LICENSE_FILES))
- unzip -o -d $(TEMPDIR) $^ -x $(MOZ_XPI_DOCUMENTED_LICENSE_FILES)
+ unzip -o -d $(install_dir) $^ -x $(MOZ_XPI_DOCUMENTED_LICENSE_FILES)
else
- unzip -o -d $(TEMPDIR) $^
+ unzip -o -d $(install_dir) $^
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
+ cd $(install_dir) && 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: $(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))
+installlinks-%-stamp: $(patsubst %,install-%-stamp,$(XPI_BASE_FILE))
+ dh_link -p$(MOZ_EXTENSION_PKG) /usr/$(lib_share_dir)/$(MOZ_EXTENSION_PKG) /usr/lib/$*/extensions/$(XPI_EMID)
touch $@
-autolinks-stamp: $(patsubst %,unzip-%-stamp,$(XPI_BASE_FILE)) $(foreach mozilla,$(MOZ_XPI_MOZILLA_DIRS),installlinks-$(mozilla)-stamp)
+autolinks-stamp: $(patsubst %,install-%-stamp,$(XPI_BASE_FILE)) $(foreach mozilla,$(MOZ_XPI_MOZILLA_DIRS),installlinks-$(mozilla)-stamp)
$(if $(XPI_FILE),,@echo "xpi.mk: No xpi file found. Did you create one?"; \
echo "xpi.mk: Please check MOZ_XPI_BUILD_COMMAND and maybe MOZ_XPI_FILE!"; \
exit 2)
- $(if $(call XPI_EMID,$(TEMPDIR)),,@echo "xpi.mk: Detecting the extension manager ID failed."; \
+ $(if $(XPI_EMID),,@echo "xpi.mk: Detecting the extension manager ID failed."; \
echo "xpi.mk: This is either a bug in the install.rdf file or in mozilla-devscripts."; \
echo "xpi.mk: Patch the install.rdf file or use MOZ_XPI_EMID as workaround."; \
exit 3)
- $(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 $@
-
-install-%-stamp: unzip-%-stamp
- dh_install -p$(MOZ_EXTENSION_PKG) $(wildcard $(TEMPDIR)/*) /usr/$(lib_share_dir)/$(MOZ_EXTENSION_PKG)
+ $(foreach id,$(XPI_TARGET_EMIDs),dh_link -p$(MOZ_EXTENSION_PKG) /usr/$(lib_share_dir)/$(MOZ_EXTENSION_PKG) /usr/lib/mozilla/extensions/$(id)/$(XPI_EMID);)
touch $@
-xpi-recommends-stamp: $(patsubst %,unzip-%-stamp,$(XPI_BASE_FILE))
+xpi-recommends-stamp: $(patsubst %,install-%-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),)
@@ -228,7 +223,6 @@ xpi-install: $(patsubst %,install-%-stamp,$(XPI_BASE_FILE)) autolinks-stamp xpi-
clean::
dh_testdir
dh_clean
- rm -rf $(TEMPDIR)
ifeq ($(shell expr $(shell cat debian/compat) '<' 7),1)
rm -f *-stamp
endif