summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAlexander Sack <asac@ubuntu.com>2009-07-27 00:28:57 +0200
committerAlexander Sack <asac@ubuntu.com>2009-07-27 00:28:57 +0200
commit546e791ac2adfb7d3760f48285d4caacd2574653 (patch)
tree97cc850ab30ca3e20ffeff96161b76222f452f2e
parent0ad7551c2413af8011301022ff83a75e34112ba2 (diff)
- add automatic xpi depends .substvars feature based on smart parsing
of install.rdf and checking min/maxVersion for each target application; extensions can now use ${xpi:Depends} to get the right dependencies added; the version/package/targetAppId mapping information is currently maintained in src/xpi.mk itself - thx to Benjamin Drung <bdrung@ubuntu.com> for this - update src/xpi.mk
-rw-r--r--debian/changelog6
-rw-r--r--src/xpi.mk30
2 files changed, 35 insertions, 1 deletions
diff --git a/debian/changelog b/debian/changelog
index ea7cf20..c71a654 100644
--- a/debian/changelog
+++ b/debian/changelog
@@ -8,6 +8,12 @@ mozilla-devscripts (0.14) UNRELEASED; urgency=low
- update src/xpi.mk
- improve rule dependencies; avoid duplicate/circular depends
- update src/xpi.mk
+ - add automatic xpi depends .substvars feature based on smart parsing
+ of install.rdf and checking min/maxVersion for each target application;
+ extensions can now use ${xpi:Depends} to get the right dependencies added;
+ the version/package/targetAppId mapping information is currently maintained
+ in src/xpi.mk itself - thx to Benjamin Drung <bdrung@ubuntu.com> for this
+ - update src/xpi.mk
-- Alexander Sack <asac@ubuntu.com> Sun, 26 Jul 2009 17:14:39 +0200
diff --git a/src/xpi.mk b/src/xpi.mk
index ac7609e..975753f 100644
--- a/src/xpi.mk
+++ b/src/xpi.mk
@@ -62,8 +62,31 @@
# your code to MOZ_XPI_MOZILLA_EXTRA_DIRS
#
+# data for XPI_DEPENDS/CHECK_VERSION magic - targetApplication to package mapping
+target_packages_{ec8030f7-c20a-464f-9b0e-13a3a9e97384}_3.0 := abrowser-3.0 firefox-3.0 iceweasel
+target_packages_{ec8030f7-c20a-464f-9b0e-13a3a9e97384}_3.5 := abrowser-3.5 firefox-3.5 iceweasel
+target_packages_{ec8030f7-c20a-464f-9b0e-13a3a9e97384}_3.6 := abrowser-3.6 firefox-3.6
+target_packages_{3550f703-e582-4d05-9a08-453d09bdfdc6}_2.0 := icedove thunderbird
+
+# data for XPI_DEPENDS/CHECK_VERSION magic - targetApplication versions
+target_versions_{ec8030f7-c20a-464f-9b0e-13a3a9e97384} := 3.0 3.5 3.6
+target_versions_{3550f703-e582-4d05-9a08-453d09bdfdc6} := 2.0
+
+# data for XPI_DEPENDS/CHECK_VERSION magic - targetApplication min-/maxVersions
+# FIXME: find a way to get this information
+target_maxVersion_{ec8030f7-c20a-464f-9b0e-13a3a9e97384} := 3.6a1pre
+target_minVersion_{ec8030f7-c20a-464f-9b0e-13a3a9e97384} := 2.0
+target_maxVersion_{3550f703-e582-4d05-9a08-453d09bdfdc6} := 3.0b3pre
+target_minVersion_{3550f703-e582-4d05-9a08-453d09bdfdc6} := 2.0
+
+# TODO: Use correct comparison
+CHECK_VERSION = $(shell dpkg --compare-versions $(target_minVersion_$(1)) le $(2) && dpkg --compare-versions $(2) le $(target_maxVersion_$(1)) && echo $(target_packages_$(1)_$(2)))
+
MOZ_XPI_BUILD_COMMAND ?= med-xpi-pack $(CURDIR) $(MOZ_EXTENSION_PKG).xpi;
+XPI_DEPENDS = $(sort $(foreach id,$(call XPI_TARGET_EMIDs,$(TEMPDIR)), \
+ $(foreach version,$(target_versions_$(id)),$(call CHECK_VERSION,$(id),$(version)))))
+
TEMPDIR := temp-xpi-unpacked
ifneq (,$(MOZ_XPI_FILE))
@@ -122,10 +145,15 @@ stamp-install-%: stamp-autolinks
stamp-extension-install: stamp-unzip-$(XPI_BASE_FILE) stamp-install-$(XPI_BASE_FILE)
touch $@
+stamp-xpi-depends:
+ if test -f debian/$(MOZ_EXTENSION_PKG).substvars; then grep -v ^xpi:Depends= debian/$(MOZ_EXTENSION_PKG).substvars > debian/$(MOZ_EXTENSION_PKG).substvars~; fi
+ echo "xpi:Depends=$(XPI_DEPENDS)" | sed "s/ / | /g" >> debian/$(MOZ_EXTENSION_PKG).substvars~
+ mv debian/$(MOZ_EXTENSION_PKG).substvars~ debian/$(MOZ_EXTENSION_PKG).substvars
+ touch $@
# only attempt to do things if a pkg was provided; otherwise error out
ifneq (,$(MOZ_EXTENSION_PKG))
-xpi-install: stamp-extension-install
+xpi-install: stamp-extension-install stamp-xpi-depends
xpi-clean:
dh_clean -p$(MOZ_EXTENSION_PKG)