[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Pre-approval for next iceweasel upload to unstable



Hi,

As stated in another message, next upstream firefox release is scheduled
for next week. On top of (obviously) the upstream changes, I would like
to apply the attached debian changes, to both code and packaging.

I do realize it's not a good time for big modifications of the build
system, but it will really make my life easier between the (currently)
4 upstream branches packaged.

An summary of the changes:
- Replaced uuencoded files with their binary counterpart.
- Some fixes or enhancements to changes introduced in the unified
  iceweasel/xulrunner package (at build and debugging level, no impact on
  the binaries).
- Minor changes to reduce the differences between 3.5, 3.6 and 4.0
  debian/ directories.
- Minor dependency improvement.
- Warning about smjs.
- Use iceweasel as reftest application instead of a custom xulrunner
  application.
- Various sanity checks.
- Add missing branding file.
- dh_xulrunner is now able to get NPAPI plugins supported mime types
  (though it doesn't work on all plugins yet)
- Removed the transient homepages after upgrade or at first run.
- Installed a nspr-config symlink to the SDK
- Provide a /usr/bin/xulrunner-stub and corresponding manual page.
- Fixes for 590040 and 591512.

More or less, that's all. Some of the previously announced planned
changes are part of this diff, though some of the plans have changed in
the meanwhile (e.g. In the end, I don't think the generic xulrunner
binary to be useful, though the /usr/bin/xulrunner-stub is ; the
transient homepages have been disabled instead of made local)

Obviously, the version number won't be the one in the attached patch.
I don't expect more changes until the 3.5.12-1 package.

Please note that I manually removed the deleted chunks for deleted
files, as it was only adding noise.

Cheers,

Mike
diff --git a/debian/branding/Makefile.in b/debian/branding/Makefile.in
index 4bd9a78..574a09b 100644
--- a/debian/branding/Makefile.in
+++ b/debian/branding/Makefile.in
@@ -17,7 +17,11 @@ DIRS = \
 
 PREF_JS_EXPORTS += $(srcdir)/firefox-branding.js
 
+ifndef BRANDING_TEST
 EXTRA_COMPONENTS := aboutIce.js
+else
+DEFINES += -DBRANDING_TEST
+endif
 
 include $(topsrcdir)/config/rules.mk
 
@@ -41,7 +45,7 @@ export:: $(BROWSER_APP_FILES) iceweasel.xpm
 
 document.png: document_icon.png
 	composite -compose src-over -geometry -2+5 $< \
-		$(topsrcdir)/browser/app/document.png $@
+		$(topsrcdir)/browser/branding/unofficial/document.png $@
 
 mozicon50.xpm: default48.png
 mozicon16.xpm: default16.png
diff --git a/debian/branding/content/Makefile.in b/debian/branding/content/Makefile.in
index 6c808c9..7958b4c 100644
--- a/debian/branding/content/Makefile.in
+++ b/debian/branding/content/Makefile.in
@@ -13,15 +13,11 @@ GARBAGE += $(CHROME_DEPS)
 
 include $(topsrcdir)/config/rules.mk
 
-aboutCredits.png.0 about.png.0: %.0: $(srcdir)/%.uu
-	uudecode -o $@ $<
-GARBAGE += aboutCredits.png.0 about.png.0
-
-aboutCredits.png: %: ../mozicon128.png %.0
+aboutCredits.png: %.png: ../mozicon128.png %-base.png
 	composite -compose src-over -gravity center -geometry +0-7 \
 		$^ $@
 
-about.png: %: ../iceweasel_logo.png %.0
+about.png: %.png: ../iceweasel_logo.png %-base.png
 	composite -compose src-over -gravity center -geometry +0-26 \
 		$^ $@
 
diff --git a/debian/branding/content/about-base.png b/debian/branding/content/about-base.png
new file mode 100644
index 0000000..6d36987
Binary files /dev/null and b/debian/branding/content/about-base.png differ
diff --git a/debian/branding/content/about.png.uu b/debian/branding/content/about.png.uu
deleted file mode 100644
diff --git a/debian/branding/content/aboutCredits-base.png b/debian/branding/content/aboutCredits-base.png
new file mode 100644
index 0000000..0e5d937
Binary files /dev/null and b/debian/branding/content/aboutCredits-base.png differ
diff --git a/debian/branding/content/aboutCredits.png.uu b/debian/branding/content/aboutCredits.png.uu
deleted file mode 100644
diff --git a/debian/branding/content/jar.mn b/debian/branding/content/jar.mn
index 35decd5..6be0c5d 100644
--- a/debian/branding/content/jar.mn
+++ b/debian/branding/content/jar.mn
@@ -2,5 +2,6 @@ browser.jar:
 % content branding %content/branding/ xpcnativewrappers=yes
   content/branding/about.png                     (about.png)
   content/branding/aboutCredits.png              (aboutCredits.png)
+  content/branding/aboutFooter.png               (../../../browser/branding/unofficial/content/aboutFooter.png)
   content/branding/icon48.png                    (icon48.png)
   content/branding/icon64.png                    (icon64.png)
diff --git a/debian/branding/firefox-branding.js b/debian/branding/firefox-branding.js
index 491116c..eccbddf 100644
--- a/debian/branding/firefox-branding.js
+++ b/debian/branding/firefox-branding.js
@@ -1,3 +1,3 @@
-pref("startup.homepage_override_url","http://mozilla.debian.net/%LOCALE%/%APP%/%VERSION%/whatsnew/";);
-pref("startup.homepage_welcome_url","http://mozilla.debian.net/%LOCALE%/%APP%/%VERSION%/firstrun/";);
+pref("startup.homepage_override_url","");
+pref("startup.homepage_welcome_url","");
 pref("app.releaseNotesURL", "http://mozilla.debian.net/%LOCALE%/%APP%/%VERSION%/releasenotes/";);
diff --git a/debian/branding/jar.mn b/debian/branding/jar.mn
index aa6839d..017783e 100644
--- a/debian/branding/jar.mn
+++ b/debian/branding/jar.mn
@@ -1,5 +1,7 @@
+#ifndef BRANDING_TEST
 ice.jar:
 % content ice %content/ice/
 % locale ice en-US %locale/en-US/ice/
   content/ice/ice.xhtml      (ice.xhtml)
   locale/en-US/ice/ice.dtd   (ice.dtd)
+#endif
diff --git a/debian/changelog b/debian/changelog
index 6693bfa..5c22d98 100644
--- a/debian/changelog
+++ b/debian/changelog
@@ -1,3 +1,75 @@
+iceweasel (3.5.11-3) UNRELEASED; urgency=low
+
+  * debian/README.Debian: Move to debian/iceweasel.README.Debian.
+  * debian/branding/Makefile.in: Use browser/branding/unofficial/document.png
+    instead of browser/app/document.png.
+  * debian/branding/content/*.png.uu (removed),
+    debian/branding/content/*-base.png, debian/source/include-binaries,
+    debian/branding/content/Makefile.in: Replace .uu files with their binary
+    counterpart, now that dpkg-dev supports binary files in the debian/
+    directory.
+  * debian/control*:
+    - Remove build dependency on sharutils.
+    - Install libmozjs debug symbols together with the xulrunner ones.
+  * debian/rules:
+    - Refactor file preprocessing.
+    - Actually allow the build sequence to start from intermediate stamps.
+    - Don't fail to build if the build-xulrunner directory exists.
+    - Move .PHONY definitions for test targets to debian/test.mk.
+    - Add some sanity checks on version numbers.
+    - Use the new DEBIAN_RELEASE variable for dh_gencontrol.
+    - Enhance the check-system-libs rule to check in the all autoconf.mk
+      files.
+    - Further split build and install process in several stamped steps.
+    - Actually set CXX in default case, and re-export it.
+    - Move stamps creation at the end, so that "touch" always happens at
+      the end.
+    - Separate dh_xulrunner check from dh_install rule for better debugging.
+  * debian/test.mk:
+    - Move tests HOME directory into build-xulrunner/dist instead of now
+      nonexistent dist.
+    - Don't automatically modify TESTS when TEST_PATH is set.
+    - Force armel JIT to compile ARMv4T instructions during tests.
+    - Define generic -skip rules for tests.
+    - Put all tests requiring an application in a separate variable.
+    - Use iceweasel for reftest/crashtest.
+  * debian/reftest-app: Remove our custom reftest-app.
+  * debian/extra-stuff/Makefile.in:
+    - Preprocess browser/app/profile/firefox.js before creating places.js.
+  * debian/branding/content/jar.mn: Add missing aboutFooter.png to branding.
+  * debian/rules, debian/noinstall.in: Move testsuite related header field
+    removal to noinstall.in.
+  * debian/rules, debian/branding/jar.mn, debian/branding/Makefile.in: Check
+    the iceweasel branding installs all files provided by upstream unofficial
+    branding.
+  * debian/dh/dh_xulrunner.in:
+    - Fix small formatting issue in dh_xulrunner manual page.
+    - Remove debug output in dh_xulrunner.
+  * debian/rules, debian/dh/dh_xulrunner_test, debian/dh/dh_xulrunner.in:
+    Better check for the dh_xulrunner behaviour.
+  * debian/rules, debian/dh/npapi_getinfo.c, debian/dh/dh_xulrunner.in,
+    debian/xulrunner-dev.install.in: New dh_xulrunner feature: return
+    plugins handled mime types in a substvar.
+  * debian/xulrunner-dev.links.in: Install a symlink to nspr-config for the
+    SDK.
+  * debian/branding/firefox-branding.js: Unset startup.homepage_override_url
+    and startup.homepage_welcome_url. In other words, don't display anything
+    special after an upgrade or for the first time the browser is started.
+  * debian/xulrunner-GRE_VERSION.postinst.in,
+    debian/xulrunner-GRE_VERSION.prerm.in,
+    debian/xulrunner-GRE_VERSION.manpages.in,
+    debian/xulrunner-stub-GRE_VERSION.1.in: Add a /usr/bin/xulrunner-stub
+    binary in the form of an alternative, and a corresponding manual page.
+  * debian/smjs.1, debian/control*: Add a note that smjs is not recommended
+    for production use.
+
+  * extensions/auth/nsHttpNegotiateAuth.cpp: Calculate negotiate auth token
+    length after removing padding. bz#592692. Closes: #590040.
+  * gfx/qcms/iccread.c: Fix unaligned reads in qcms. bz#504766.
+    Closes: #591512.
+
+ -- Mike Hommey <glandium@debian.org>  Wed, 01 Sep 2010 22:35:09 +0200
+
 iceweasel (3.5.11-2) unstable; urgency=low
 
   [ iceweasel ]
diff --git a/debian/control b/debian/control
index 9a13008..95a1b52 100644
--- a/debian/control
+++ b/debian/control
@@ -39,7 +39,6 @@ Build-Depends: autotools-dev,
                ttf-freefont,
                imagemagick,
                librsvg2-bin,
-               sharutils,
                xsltproc
 Build-Conflicts: graphicsmagick-imagemagick-compat,
                  libhildonmime-dev,
@@ -171,6 +170,8 @@ Depends: ${shlibs:Depends},
 Description: standalone JavaScript/ECMAScript (ECMA-262) interpreter
  SpiderMonkey is a standalone JavaScript/ECMAScript interpreter. It can either
  take input from files or from a command line driven interface.
+ It is not recommended for production use, as it contains dangerous
+ (security-wise) debugging features.
  .
  ECMAScript (ECMA-262) is a dynamic scripting language supporting prototype
  based object construction. The basic syntax is intentionally similar to
@@ -213,6 +214,7 @@ Section: debug
 Priority: extra
 Architecture: any
 Depends: xulrunner-1.9.1 (= ${binary:Version}),
+         libmozjs2d-dbg (= ${binary:Version}),
          ${misc:Depends}
 Description: Debugging symbols for the Gecko engine library
  This library provides an  API for XUL applications and Gecko embedders.
diff --git a/debian/control.in b/debian/control.in
index 8f2e4c6..68df31a 100644
--- a/debian/control.in
+++ b/debian/control.in
@@ -39,7 +39,6 @@ Build-Depends: autotools-dev,
                ttf-freefont,
                imagemagick,
                librsvg2-bin,
-               sharutils,
                xsltproc
 Build-Conflicts: graphicsmagick-imagemagick-compat,
                  libhildonmime-dev,
@@ -171,6 +170,8 @@ Depends: ${shlibs:Depends},
 Description: standalone JavaScript/ECMAScript (ECMA-262) interpreter
  SpiderMonkey is a standalone JavaScript/ECMAScript interpreter. It can either
  take input from files or from a command line driven interface.
+ It is not recommended for production use, as it contains dangerous
+ (security-wise) debugging features.
  .
  ECMAScript (ECMA-262) is a dynamic scripting language supporting prototype
  based object construction. The basic syntax is intentionally similar to
@@ -213,6 +214,7 @@ Section: debug
 Priority: extra
 Architecture: any
 Depends: xulrunner-##GRE_VERSION## (= ${binary:Version}),
+         libmozjs##SO_VERSION##-dbg (= ${binary:Version}),
          ${misc:Depends}
 Description: Debugging symbols for the Gecko engine library
  This library provides an  API for XUL applications and Gecko embedders.
diff --git a/debian/dh/dh_xulrunner.in b/debian/dh/dh_xulrunner.in
index 3c6b880..18c1e8e 100755
--- a/debian/dh/dh_xulrunner.in
+++ b/debian/dh/dh_xulrunner.in
@@ -16,25 +16,44 @@ B<dh_xulrunner> [S<I<debhelper options>>]
 
 =head1 DESCRIPTION
 
+dh_xulrunner is a debhelper program with two complementary features.
+
 dh_xulrunner adds the xulrunner binary package corresponding to the installed
 xulrunner-dev package to the B<shlibs:Depends> substvar. It only does so for
 packages containing an executable or a library that it detects as containing
 the XPCOM glue (please note the detection is really hackish and error prone,
 though most likely accurate in most cases).
 
-It must be run after dh_shlibdeps.
+For this feature, dh_xulrunner must be run after dh_shlibdeps, and requires a
+build dependency on xulrunner-dev (>= 1.9.1.3-2).
+
+dh_xulrunner also gathers MIME types information from NPAPI plugins it can
+find in the I</usr/lib/mozilla/plugins> directory in packages. The gathered
+information is stored in the B<npapi:Mimetypes> substvar.
 
-Using dh_xulrunner requires a build dependency on xulrunner-dev (>= 1.9.1.3-2).
+For this feature, dh_xulrunner requires a build dependency on
+xulrunner-dev (>= 1.9.1.11-3~) | xulrunner-dev (>= 3.6.8-3~).
 
 You can also use the xulrunner dh sequence addon to integrate in a dh workflow:
+
 	dh --with xulrunner $@
 
 =cut
 
 init();
 
+$ENV{PATH} = join ':', '/usr/lib/xulrunner-##GRE_VERSION##', split ':', $ENV{PATH};
+
+my $ld_lib_path = $ENV{LD_LIBRARY_PATH};
+my @new_ld_lib_path = ();
+push @new_ld_lib_path, split ':', $ld_lib_path if defined $ld_lib_path;
+push @new_ld_lib_path, map { tmpdir($_) . "/usr/lib" } getpackages();
+my %seen;
+@new_ld_lib_path = grep { !$seen{$_}++ } @new_ld_lib_path;
+my $new_ld_lib_path = join ':', @new_ld_lib_path;
+
 foreach my $package (@{$dh{DOPACKAGES}}) {
-	# The following is mostly stolen from dh_shlibdeps
+	# The following is partially stolen from dh_shlibdeps
 	my $tmp=tmpdir($package);
 	my $ff;
 
@@ -44,6 +63,37 @@ foreach my $package (@{$dh{DOPACKAGES}}) {
 	if (defined($dh{EXCLUDE_FIND}) && $dh{EXCLUDE_FIND} ne '') {
 		$find_options="! \\( $dh{EXCLUDE_FIND} \\)";
 	}
+	# Check plugins ; only expect them in /usr/lib/mozilla/plugins
+	if (-d "$tmp/usr/lib/mozilla/plugins") {
+		my @filelist = ();
+		foreach my $file (split(/\n/,`find -L $tmp/usr/lib/mozilla/plugins -type f -name "*.so*" $find_options -print`)) {
+			push @filelist, $file;
+		}
+		my @mimetypes = ();
+		if ($new_ld_lib_path) {
+			$ENV{LD_LIBRARY_PATH} = $new_ld_lib_path;
+			verbose_print("LD_LIBRARY_PATH=$new_ld_lib_path");
+		}
+
+		foreach my $file (@filelist) {
+			# Plugins are not expected to contain the standalone glue
+			# On the other hand, they may contain information we want
+			open NPP, "npapi_getinfo '$file' 2>/dev/null |";
+			while (<NPP>) {
+				chomp;
+				next unless /^MimeTypes: (.*)$/;
+				push @mimetypes, map { s/:.*$//; $_; } split ';', $1;
+			}
+			close NPP;
+			next;
+		}
+		if (defined $ld_lib_path) {
+			$ENV{LD_LIBRARY_PATH} = $ld_lib_path;
+		} else {
+			delete $ENV{LD_LIBRARY_PATH};
+		}
+		addsubstvar($package, "npapi:Mimetypes", join(', ', sort @mimetypes)) if (@mimetypes);
+	}
 	foreach my $file (split(/\n/,`find $tmp -type f \\( -perm +111 -or -name "*.so*" -or -name "*.cmxs" \\) $find_options -print`)) {
 		# Prune directories that contain separated debug symbols.
 		next if $file=~m!^\Q$tmp\E/usr/lib/debug/(lib|lib64|usr|bin|sbin|opt|dev|emul)/!;
@@ -74,7 +124,6 @@ foreach my $package (@{$dh{DOPACKAGES}}) {
 				$buf = join ' ', split(/[^A-Za-z\.\/_]+/, $buf);
 				my $pattern = '(' . join('|', @strings) . ')';
 				my (@matches) = $buf =~ m{$pattern}g;
-				print @matches,"\n";
 				if (!grep { my $s = $_; ! grep { $_ eq $s } @matches } @strings) {
 					addsubstvar($package, "shlibs:Depends", "xulrunner-##GRE_VERSION##");
 					last;
@@ -84,6 +133,8 @@ foreach my $package (@{$dh{DOPACKAGES}}) {
 	}
 }
 
+1;
+
 =head1 SEE ALSO
 
 L<debhelper(7)>
diff --git a/debian/dh/dh_xulrunner_test b/debian/dh/dh_xulrunner_test
new file mode 100644
index 0000000..e760ee2
--- /dev/null
+++ b/debian/dh/dh_xulrunner_test
@@ -0,0 +1,17 @@
+use File::Basename;
+push @INC, dirname($0);
+
+push @ARGV, "--no-act";
+
+use Debian::Debhelper::Dh_Lib;
+package Debian::Debhelper::Dh_Lib;
+
+sub addsubstvar {
+	my $package = shift;
+	my $var = shift;
+	my $value = shift;
+
+	print "addsubstvar(\"$package\", \"$var\", \"$value\");\n";
+}
+
+require 'dh_xulrunner';
diff --git a/debian/dh/npapi_getinfo.c b/debian/dh/npapi_getinfo.c
new file mode 100644
index 0000000..4d097f2
--- /dev/null
+++ b/debian/dh/npapi_getinfo.c
@@ -0,0 +1,43 @@
+#include <stdio.h>
+#include <dlfcn.h>
+#include "npapi.h"
+
+int main(int argc, char *argv[])
+{
+	void *dlh;
+	char* (*NP_GetMIMEDescription_func)();
+	NPError (*NP_GetValue_func)(void*, NPPVariable, void*);
+	char *buf;
+
+	if (argc != 2) {
+		fprintf(stderr, "Usage: %s plugin.so\n", argv[0]);
+		return 1;
+	}
+
+	dlh = dlopen(argv[1], RTLD_LAZY);
+	if (dlh == NULL) {
+		fprintf(stderr, "Failed to open plugin: %s\n", argv[1]);
+		return 1;
+	}
+
+	NP_GetMIMEDescription_func = dlsym(dlh, "NP_GetMIMEDescription");
+	NP_GetValue_func = dlsym(dlh, "NP_GetValue");
+	if ((NP_GetValue_func == NULL) ||
+	    (NP_GetMIMEDescription_func == NULL)) {
+		fprintf(stderr, "It doesn't look like this is a plugin: %s\n", argv[1]);
+		return 1;
+	}
+
+	if (NP_GetValue_func(NULL, NPPVpluginNameString, &buf)
+	    == NPERR_NO_ERROR)
+		printf("Name: %s\n", buf);
+	
+	if (NP_GetValue_func(NULL, NPPVpluginDescriptionString, &buf)
+	    == NPERR_NO_ERROR)
+		printf("Description: %s\n", buf);
+
+	buf = NP_GetMIMEDescription_func();
+		printf("MimeTypes: %s\n", buf);
+
+	return 0;
+}
diff --git a/debian/extra-stuff/Makefile.in b/debian/extra-stuff/Makefile.in
index a6f19a0..2e998cb 100644
--- a/debian/extra-stuff/Makefile.in
+++ b/debian/extra-stuff/Makefile.in
@@ -14,9 +14,10 @@ EXTRA_COMPONENTS := addonsInfo.js debUpdateNotifier.js
 include $(topsrcdir)/config/rules.mk
 
 places.js: $(topsrcdir)/browser/app/profile/firefox.js
-	grep '\(places\.frecency\.\|browser\.\(formfill\.enable\|history_expire_days\|urlbar\.\(restrict\.\|match\.\|default\.behavior\|filter\.javascript\)\)\)' $< > $@
+	$(PYTHON) $(topsrcdir)/config/Preprocessor.py $(DEFINES) $(ACDEFINES) $^ | grep '\(places\.frecency\.\|browser\.\(formfill\.enable\|history_expire_days\|urlbar\.\(restrict\.\|match\.\|default\.behavior\|filter\.javascript\)\)\)' > $@
 
 DEFINES += -DAB_CD=$(MOZ_UI_LOCALE) -DMOZ_APP_NAME=$(MOZ_APP_NAME) -DPREF_DIR=$(PREF_DIR)
+DEFINES += -DAPP_UA_NAME=a -DAPP_VERSION=0
 
 packages-static: $(topsrcdir)/browser/installer/unix/packages-static $(srcdir)/packages-static.$(MOZ_APP_NAME)
 	$(PYTHON) $(topsrcdir)/config/Preprocessor.py $(DEFINES) $(ACDEFINES) $^ | sed 's/^\[browser\]/[$(MOZ_APP_NAME)]/' > $@
diff --git a/debian/README.Debian b/debian/iceweasel.README.Debian
similarity index 100%
rename from debian/README.Debian
rename to debian/iceweasel.README.Debian
diff --git a/debian/noinstall.in b/debian/noinstall.in
index 2398649..b38258d 100644
--- a/debian/noinstall.in
+++ b/debian/noinstall.in
@@ -4,3 +4,4 @@ usr/lib/iceweasel/README.txt
 usr/lib/iceweasel/removed-files
 usr/lib/xulrunner-##GRE_VERSION##/README.txt
 usr/lib/xulrunner-##GRE_VERSION##/dictionaries
+usr/include/xulrunner-##GRE_VERSION##/unstable/TestHarness.h
diff --git a/debian/patches/fixes/Bug-504766.-qcms-Fix-unaligned-reads-in-qcms.-r-jrmu.patch b/debian/patches/fixes/Bug-504766.-qcms-Fix-unaligned-reads-in-qcms.-r-jrmu.patch
new file mode 100644
index 0000000..42bf137
--- /dev/null
+++ b/debian/patches/fixes/Bug-504766.-qcms-Fix-unaligned-reads-in-qcms.-r-jrmu.patch
@@ -0,0 +1,34 @@
+From: Vladimir Vukicevic <vladimir@pobox.com>
+Date: Tue, 8 Sep 2009 11:36:28 -0400
+Subject: Bug 504766. qcms: Fix unaligned reads in qcms. r=jrmuizel
+
+---
+ gfx/qcms/iccread.c |    8 ++++++--
+ 1 files changed, 6 insertions(+), 2 deletions(-)
+
+diff --git a/gfx/qcms/iccread.c b/gfx/qcms/iccread.c
+index 7cc5d7f..6671c73 100644
+--- a/gfx/qcms/iccread.c
++++ b/gfx/qcms/iccread.c
+@@ -87,7 +87,9 @@ static uint32_t read_u32(struct mem_source *mem, size_t offset)
+ 		invalid_source(mem, "Invalid offset");
+ 		return 0;
+ 	} else {
+-		return be32_to_cpu(*(__be32*)(mem->buf + offset));
++		__be32 k;
++		memcpy(&k, mem->buf + offset, sizeof(__be32));
++		return be32_to_cpu(k);
+ 	}
+ }
+ 
+@@ -97,7 +99,9 @@ static uint16_t read_u16(struct mem_source *mem, size_t offset)
+ 		invalid_source(mem, "Invalid offset");
+ 		return 0;
+ 	} else {
+-		return be16_to_cpu(*(__be16*)(mem->buf + offset));
++		__be16 k;
++		memcpy(&k, mem->buf + offset, sizeof(__be16));
++		return be16_to_cpu(k);
+ 	}
+ }
+ 
diff --git a/debian/patches/fixes/Calculate-negotiate-auth-token-length-after-removing.patch b/debian/patches/fixes/Calculate-negotiate-auth-token-length-after-removing.patch
new file mode 100644
index 0000000..c34e19f
--- /dev/null
+++ b/debian/patches/fixes/Calculate-negotiate-auth-token-length-after-removing.patch
@@ -0,0 +1,34 @@
+From: Mike Hommey <mh@glandium.org>
+Date: Wed, 1 Sep 2010 18:03:10 +0200
+Subject: Calculate negotiate auth token length after removing padding
+
+https://bugzilla.mozilla.org/show_bug.cgi?id=592692
+Closes: #590040
+---
+ extensions/auth/nsHttpNegotiateAuth.cpp |    8 ++++----
+ 1 files changed, 4 insertions(+), 4 deletions(-)
+
+diff --git a/extensions/auth/nsHttpNegotiateAuth.cpp b/extensions/auth/nsHttpNegotiateAuth.cpp
+index c81e69d..1e1d9c5 100644
+--- a/extensions/auth/nsHttpNegotiateAuth.cpp
++++ b/extensions/auth/nsHttpNegotiateAuth.cpp
+@@ -257,15 +257,15 @@ nsHttpNegotiateAuth::GenerateCredentials(nsIHttpChannel *httpChannel,
+             challenge++;
+         len = strlen(challenge);
+ 
++        // strip off any padding (see bug 230351)
++        while (challenge[len - 1] == '=')
++            len--;
++
+         inTokenLen = (len * 3)/4;
+         inToken = malloc(inTokenLen);
+         if (!inToken)
+             return (NS_ERROR_OUT_OF_MEMORY);
+ 
+-        // strip off any padding (see bug 230351)
+-        while (challenge[len - 1] == '=')
+-            len--;
+-
+         //
+         // Decode the response that followed the "Negotiate" token
+         //
diff --git a/debian/patches/series b/debian/patches/series
index cdbda17..9993b3e 100644
--- a/debian/patches/series
+++ b/debian/patches/series
@@ -35,6 +35,8 @@ fixes/KDE-Gnome-startup-notification-not-disappearing-when.patch
 fixes/KDE-Gnome-startup-notification-not-disappearing-for-.patch
 fixes/Use-png_set_filter-to-make-libpng-not-use-write-filt.patch
 fixes/Use-syscall-for-mmap-and-munmap-and-disable-ncpus-in.patch
+fixes/Calculate-negotiate-auth-token-length-after-removing.patch
+fixes/Bug-504766.-qcms-Fix-unaligned-reads-in-qcms.-r-jrmu.patch
 iceweasel-branding/Rename-Firefox-to-Iceweasel.patch
 iceweasel-branding/Set-MOZ_APP_NAME-to-iceweasel.patch
 iceweasel-branding/Our-name-should-be-Iceweasel-not-Firefox.patch
diff --git a/debian/reftest-app/application.ini b/debian/reftest-app/application.ini
deleted file mode 100644
diff --git a/debian/reftest-app/defaults/preferences/reftest-app.js b/debian/reftest-app/defaults/preferences/reftest-app.js
deleted file mode 100644
diff --git a/debian/rules b/debian/rules
index 96b598c..dfa72bb 100755
--- a/debian/rules
+++ b/debian/rules
@@ -4,10 +4,37 @@ DEB_HOST_GNU_TYPE   ?= $(shell dpkg-architecture -qDEB_HOST_GNU_TYPE)
 DEB_BUILD_GNU_TYPE  ?= $(shell dpkg-architecture -qDEB_BUILD_GNU_TYPE)
 DEB_BUILD_ARCH  ?= $(shell dpkg-architecture -qDEB_BUILD_ARCH)
 
-UPSTREAM_VERSION := $(shell cat browser/config/version.txt)
 GRE_VERSION := 1.9.1
-GRE_MILESTONE := $(shell config/milestone.pl --topsrcdir .|sed 's/[a-z]/~&/')
+
+# The VERSION_FILTER transforms upstream version patterns to versions
+# useable in debian/changelog. Versions are to be transformed as follows:
+# 4.0      -> 4.0
+# 4.0pre   -> 4.0~pre
+# 4.0b5    -> 4.0~b5
+# 4.0b5pre -> 4.0~b5~pre
+# That should ensure the proper ordering
+VERSION_FILTER := sed 's/\([0-9]\)\([a-z]\)/\1~\2/g'
+UPSTREAM_VERSION := $(shell cat browser/config/version.txt)
+GRE_MILESTONE := $(shell config/milestone.pl --topsrcdir .| $(VERSION_FILTER))
 SO_VERSION := $(shell awk -F'[\t =]+' '$$1 == "SO_VERSION" {print $$2}' js/src/Makefile.in)
+# Last version in debian/changelog
+DEBIAN_VERSION := $(shell dpkg-parsechangelog | sed -n 's/^Version: *// p')
+# Debian part of the above version (anything after the last dash)
+DEBIAN_RELEASE := $(lastword $(subst -, ,$(DEBIAN_VERSION)))
+# Upstream part of the debian/changelog version (anything before the last dash)
+UPSTREAM_RELEASE := $(DEBIAN_VERSION:%-$(DEBIAN_RELEASE)=%)
+
+# Check if the GRE_VERSION defined above matches the actual milestone
+ifeq (,$(filter $(GRE_VERSION).%,$(GRE_MILESTONE)))
+$(error GRE_VERSION ($(GRE_VERSION)) doesn't match GRE_MILESTONE ($(GRE_MILESTONE)))
+endif
+
+# Check if the version in debian/changelog matches actual upstream version
+# as VERSION_FILTER transforms it.
+FILTERED_UPSTREAM_VERSION := $(shell echo $(UPSTREAM_VERSION) | $(VERSION_FILTER))
+ifneq ($(FILTERED_UPSTREAM_VERSION),$(UPSTREAM_RELEASE))
+$(error Upstream version in debian/changelog ($(UPSTREAM_RELEASE)) doesn't match actual upstream version ($(FILTERED_UPSTREAM_VERSION)))
+endif
 
 LIB_DIR := /usr/lib/iceweasel
 SHARE_DIR := /usr/share/iceweasel
@@ -36,7 +63,10 @@ ifeq (,$(filter debug noopt,$(DEB_BUILD_OPTIONS)))
 	GENSYMBOLS_FLAGS := -c4
 endif
 
-ifndef CXX
+ifeq (default,$(origin CC))
+CC := gcc
+endif
+ifeq (default,$(origin CXX))
 CXX := g++
 endif
 CXXFLAGS := $(CFLAGS)
@@ -44,7 +74,7 @@ ifeq (,$(shell dpkg --compare-versions $(shell $(CXX) -dumpversion) '>=' 4.4 ||
 CXXFLAGS += -std=gnu++0x
 endif
 
-export CFLAGS CXXFLAGS
+export CC CXX CFLAGS CXXFLAGS
 
 JS_LDFLAGS := $(MAIN_LDFLAGS)
 JS_LDFLAGS += -Wl,--version-script=$(CURDIR)/debian/symbols.filter
@@ -54,6 +84,9 @@ GENERATED_FILES += debian/dh/dh_xulrunner.1
 debian/dh/dh_xulrunner.1: debian/dh/dh_xulrunner
 	pod2man -c Debhelper -r $(GRE_VERSION) $^ > $@
 
+debian/dh/npapi_getinfo: %: %.c
+	$(CC) -o $@ $< -Imodules/plugin/base/public -ldl
+
 IN_FILES := $(wildcard debian/*.in debian/dh/*.in)
 define preprocess
 $(subst SO_VERSION,$(SO_VERSION),$(subst GRE_VERSION,$(GRE_VERSION),$(1:.in=))): $(1)
@@ -64,11 +97,14 @@ $(foreach f,$(IN_FILES),$(eval $(call preprocess, $(f))))
 GENERATED_FILES += $(filter-out debian/control,$(PREPROCESSED_FILES))
 
 $(PREPROCESSED_FILES):
-	sed -e 's/##GRE_VERSION##/$(GRE_VERSION)/g' -e 's/##GRE_MILESTONE##/$(GRE_MILESTONE)/g' -e 's/##SO_VERSION##/$(SO_VERSION)/g' $^ > $@
+	sed $(foreach var,GRE_VERSION GRE_MILESTONE SO_VERSION,-e 's/##$(var)##/$($(var))/g' )$^ > $@
+
+build-iceweasel/%/Makefile build-xulrunner/%/Makefile:
+	cd $(firstword $(subst /, ,$@)) && ../build/autoconf/make-makefile -t .. $*
 
 override_dh_auto_configure:
 
-stamps/prepare-configure::
+stamps/prepare-configure:: stamps/dummy
 	for dir in $(AUTOCONF_DIRS); do \
 		for file in config.guess config.sub; do \
 			sed -i '2!b;/^#/ i\exec "/usr/share/misc/'$$file'" "$$@"' $$dir/$$file; \
@@ -76,35 +112,43 @@ stamps/prepare-configure::
 	done
 
 stamps/configure-xulrunner:: stamps/prepare-configure
-	mkdir build-xulrunner
+	$(if $(wildcard build-xulrunner),,mkdir build-xulrunner)
 	cd build-xulrunner && \
 	MOZCONFIG=$(CURDIR)/debian/xulrunner.mozconfig \
 	ASFLAGS="-g" \
 	../configure --host=$(DEB_HOST_GNU_TYPE) --build=$(DEB_BUILD_GNU_TYPE) --prefix=/usr $(CONFIGURE_FLAGS) \
 		--with-default-mozilla-five-home=/usr/lib/xulrunner-$(GRE_VERSION)
-	cd build-xulrunner && ../build/autoconf/make-makefile -t .. debian/extra-stuff
 	sed -i '/^OS_LDFLAGS/s|=|& $(MAIN_LDFLAGS)|' build-xulrunner/config/autoconf.mk
 	sed -i '/^OS_LDFLAGS/s|=|& $(JS_LDFLAGS)|' build-xulrunner/js/src/config/autoconf.mk
 
+stamps/configure-check-xulrunner:: stamps/configure-xulrunner
+# Ensure --{with,enable}-system options properly set expected variables
+# according to the definitions in the mozconfig file.
 	@awk -F' *# *| *$$' ' \
+	BEGIN { "find $(CURDIR)/build-xulrunner -name autoconf.mk -printf \"%p \"" | getline confs } \
 	$$1 ~ /system/ { \
 		if (! $$2) { \
 			print FILENAME ": Missing variable for",$$1; \
 			error=1; \
 		} else { \
 			split($$2,var,"="); \
-			cmd = "$(MAKE) -C build-xulrunner --no-print-directory echo-variable-" var[1]; \
-			cmd |  getline value; \
+			cmd = "grep -l " var[1] " " confs; \
+			cmd | getline dir; \
+			sub(/\/[^\/]*$$/, "", dir); \
+			cmd = "$(MAKE) -C " dir " --no-print-directory echo-variable-" var[1]; \
+			cmd | getline value; \
 			if (value != var[2]) { print $$1, "triggered", var[1] "=" value,"instead of",$$2; error=1 } \
 		} \
 	} \
 	END { if (error) { exit 1 }}' debian/xulrunner.mozconfig
 
-stamps/build-xulrunner:: stamps/configure-xulrunner
+stamps/build-xulrunner:: stamps/configure-check-xulrunner
 	dh_auto_build --parallel --builddirectory=build-xulrunner
+
+stamps/build-xulrunner-extra:: stamps/build-xulrunner build-xulrunner/debian/extra-stuff/Makefile
 	$(MAKE) -C build-xulrunner/debian/extra-stuff
 
-stamps/configure-iceweasel:: stamps/build-xulrunner
+stamps/configure-iceweasel:: stamps/build-xulrunner-extra
 	MOZCONFIG=$(CURDIR)/debian/iceweasel.mozconfig \
 	dh_auto_configure --builddirectory=build-iceweasel -- $(CONFIGURE_FLAGS) \
 		--with-libxul-sdk=$(CURDIR)/build-xulrunner/dist \
@@ -114,11 +158,16 @@ stamps/configure-iceweasel:: stamps/build-xulrunner
 stamps/build-iceweasel:: stamps/configure-iceweasel
 	dh_auto_build --builddirectory=build-iceweasel
 
-stamps/prepare-configure $(foreach pkg,iceweasel xulrunner,stamps/configure-$(pkg) stamps/build-$(pkg))::
-	@mkdir -p stamps
-	touch $@
+build-iceweasel/%/filelist: stamps/build-iceweasel build-iceweasel/%/Makefile
+	rm -rf build-iceweasel/$*/dist
+	$(MAKE) -C build-iceweasel/$* MOZ_CHROME_FILE_FORMAT=flat DIST=$(CURDIR)/build-iceweasel/$*/dist BRANDING_TEST=1
+	cd build-iceweasel/$*/dist/bin && find -type f | sort > $(CURDIR)/$@
+
+stamps/build-check-iceweasel:: build-iceweasel/browser/branding/unofficial/filelist build-iceweasel/debian/branding/filelist
+# Ensure the iceweasel branding contains everything it's supposed to
+	diff $^
 
-override_dh_auto_build: stamps/build-iceweasel
+override_dh_auto_build: stamps/build-check-iceweasel
 
 ifeq (,$(filter nocheck,$(DEB_BUILD_OPTIONS)))
 include debian/test.mk
@@ -140,9 +189,10 @@ override_dh_auto_clean::
 		done; \
 	done
 
-override_dh_auto_install:
+override_dh_auto_install: stamps/install-iceweasel stamps/install-xulrunner
+
+stamps/install-xulrunner::
 	dh_auto_install --sourcedirectory=build-xulrunner/xulrunner/installer -- MOZ_PKG_MANIFEST=$(CURDIR)/build-xulrunner/debian/extra-stuff/packages-static
-	rm debian/tmp/usr/include/xulrunner-$(GRE_VERSION)/unstable/TestHarness.h
 
 	mv debian/tmp/usr/bin/xulrunner debian/tmp/usr/bin/xulrunner-$(GRE_VERSION)
 
@@ -184,6 +234,7 @@ override_dh_auto_install:
 
 	sed -i '/^Cflags/ s,$${includedir}/stable,/usr/include/mozjs,' debian/tmp/usr/lib/pkgconfig/mozilla-js.pc
 
+stamps/install-iceweasel::
 	dh_auto_install --builddirectory=build-iceweasel -- installdir=$(LIB_DIR)
 	chmod 755 debian/iceweasel-xremote-client
 
@@ -193,7 +244,7 @@ MPL: LICENSE
 override_dh_installdocs: MPL
 	dh_installdocs -A $^
 
-override_dh_install: debian/dh/dh_xulrunner debian/noinstall
+stamps/dh_install:: debian/dh/dh_xulrunner debian/noinstall debian/dh/npapi_getinfo
 	awk '{print "debian/tmp/" $$1 }' < debian/noinstall | xargs rm -r
 	dh_install --fail-missing
 #Install helpers
@@ -227,8 +278,18 @@ override_dh_install: debian/dh/dh_xulrunner debian/noinstall
 
 	sed -i 's/\(MinVersion=$(GRE_VERSION)\).*/\1/;s/\(MaxVersion=$(GRE_VERSION)\).*/\1.*/' debian/iceweasel/$(LIB_DIR)/application.ini
 
+CMP_AWK := '$$0 !~ /^\t/ { txt = txt ? txt "\n" $$0 : $$0 } END { if (txt != expected) { print "Expected:\n" expected "\nGot:\n" txt; exit 1 }}'
+
+stamps/check-dh_xulrunner-glue:: stamps/dh_install debian/dh/dh_xulrunner
 	# Make sure dh_xulrunner is able to spot the current XPCOM standalone glue.
-	perl $< -pxulrunner-$(GRE_VERSION) --no-act -v 2>&1 | grep -q "..*"
+	perl debian/dh/dh_xulrunner_test -pxulrunner-$(GRE_VERSION) | awk -v expected='addsubstvar("xulrunner-$(GRE_VERSION)", "shlibs:Depends", "xulrunner-$(GRE_VERSION)");' $(CMP_AWK)
+
+stamps/check-dh_xulrunner-npapi:: stamps/dh_install debian/dh/dh_xulrunner debian/dh/npapi_getinfo
+	$(if $(wildcard build-xulrunner/tmp/usr/lib/mozilla),,mkdir -p build-xulrunner/tmp/usr/lib/mozilla/)
+	$(if $(wildcard build-xulrunner/tmp/usr/lib/mozilla/plugins),,ln -s $(CURDIR)/build-xulrunner/dist/bin/plugins build-xulrunner/tmp/usr/lib/mozilla)
+	PATH=debian/dh:$(PATH) perl debian/dh/dh_xulrunner_test -piceweasel -Pbuild-xulrunner/tmp | awk -v expected='addsubstvar("iceweasel", "npapi:Mimetypes", "application/x-print-unix-nsplugin, application/x-test");' $(CMP_AWK)
+
+override_dh_install: stamps/check-dh_xulrunner-glue stamps/check-dh_xulrunner-npapi
 
 override_dh_strip:
 	dh_strip -a -Niceweasel -Nlibmozjs$(SO_VERSION) -Nspidermonkey-bin --dbg-package=xulrunner-$(GRE_VERSION)-dbg
@@ -248,14 +309,18 @@ override_dh_shlibdeps:
 
 override_dh_gencontrol:
 	dh_gencontrol -piceweasel -piceweasel-dbg
-	dh_gencontrol -Niceweasel -Niceweasel-dbg -- -v$(GRE_MILESTONE)-$(shell dpkg-parsechangelog | sed -n 's/^Version: *[^~]*\(~.*\)\?-\(.*\)$$/\2/ p')
+	dh_gencontrol -Niceweasel -Niceweasel-dbg -- -v$(GRE_MILESTONE)-$(DEBIAN_RELEASE)
 
 install binary binary-arch binary-indep: $(GENERATED_FILES)
 
 binary binary-arch binary-indep build clean install:
 	dh $@
 
-.PHONY: build clean binary-indep binary-arch binary install test $(TESTS) xpcshell-tests-skip
+.PHONY: build clean binary-indep binary-arch binary install
 
 .NOTPARALLEL:
+
+$(shell awk -F: '$$1 ~ /^stamps\// { print $$1 }' debian/rules) stamps/dummy::
+	@mkdir -p stamps
+	$(if $(wildcard $@),,touch $@)
 endif
diff --git a/debian/smjs.1 b/debian/smjs.1
index a0086ee..4ab36c5 100644
--- a/debian/smjs.1
+++ b/debian/smjs.1
@@ -1,4 +1,4 @@
-.TH SMJS 1 "7 March 2003"
+.TH SMJS 1 "September 2, 2010"
 .SH NAME
 smjs - javascript shell
 .SH SYNOPSIS
@@ -9,8 +9,13 @@ than a few internal interfaces (some of these internal interfaces could
 be replaced by jsapi.h calls). The js program built from this
 source provides a test vehicle for evaluating scripts and calling functions,
 trying out new debugger primitives, etc.
+
+\fBIt is not recommended for production use\fP, as it contains dangerous
+(security-wise) debugging features.
+
 .SH AUTHOR
 This manpage was originally written by Bastian Kleineidam
-<calvin@debian.org> for the Debian distribution of Spidermonkey.
+<calvin@debian.org> for the Debian distribution of Spidermonkey, further
+modified by Mike Hommey <glandium@debian.org>.
 
 The main author of Spidermonkey is the Mozilla Project.
diff --git a/debian/source/include-binaries b/debian/source/include-binaries
new file mode 100644
index 0000000..1023f00
--- /dev/null
+++ b/debian/source/include-binaries
@@ -0,0 +1,2 @@
+debian/branding/content/about-base.png
+debian/branding/content/aboutCredits-base.png
diff --git a/debian/test.mk b/debian/test.mk
index 12d776f..800a26e 100755
--- a/debian/test.mk
+++ b/debian/test.mk
@@ -7,32 +7,31 @@ debian/locales/%:
 	mkdir -p debian/locales
 	localedef -f $(word 2,$(subst ., ,$(notdir $@))) -i $(word 1,$(subst ., ,$(notdir $@))) $@
 
-ifdef TEST_PATH
-TESTS := xpcshell-tests
-else
-TESTS := check xpcshell-tests reftest crashtest
-endif
+APP_TESTS := reftest crashtest
+TESTS := check xpcshell-tests $(APP_TESTS)
 
 override_dh_auto_test: $(TESTS)
 
-debian/reftest-app/stub: $(CURDIR)/build-xulrunner/dist/bin/xulrunner-stub
-	ln -s $< $@
-
 ifndef HAS_LOCALE
 xpcshell-tests: export LOCPATH = $(CURDIR)/debian/locales
 endif
 xpcshell-tests: export LC_ALL=$(LOCALE)
-reftest crashtest: debian/reftest-app/stub
-reftest crashtest: export EXTRA_TEST_ARGS += --appname=$(CURDIR)/debian/reftest-app/stub
-reftest crashtest: export GRE_HOME = $(CURDIR)/build-xulrunner/dist/bin
-reftest crashtest: XVFB_RUN = xvfb-run -s "-screen 0 1024x768x24"
+$(APP_TESTS): export EXTRA_TEST_ARGS += --appname=$(CURDIR)/build-iceweasel/dist/bin/firefox
+$(APP_TESTS): export GRE_HOME = $(CURDIR)/build-xulrunner/dist/bin
+$(APP_TESTS): XVFB_RUN = xvfb-run -s "-screen 0 1024x768x24"
+
+ifeq ($(DEB_BUILD_ARCH),armel)
+# Force armel JIT to compile ARMv4T instructions at runtime even when the buildd
+# is > ARMv4T
+$(TESTS): export ARM_FORCE_PLATFORM=4
+endif
 
 $(TESTS):
-	GNOME22_USER_DIR="$(CURDIR)/dist/.gnome2" \
-	HOME="$(CURDIR)/dist" \
+	GNOME22_USER_DIR="$(CURDIR)/build-xulrunner/dist/.gnome2" \
+	HOME="$(CURDIR)/build-xulrunner/dist" \
 	$(XVFB_RUN) $(MAKE) -C build-xulrunner $@ 2>&1 | sed -u 's/^/$@> /'
 
-xpcshell-tests: xpcshell-tests-skip $(if $(HAS_LOCALE),,debian/locales/$(LOCALE))
+xpcshell-tests: $(if $(HAS_LOCALE),,debian/locales/$(LOCALE))
 
 xpcshell-tests-skip:
 # APNG is not supported
@@ -44,4 +43,8 @@ xpcshell-tests-skip:
 	rm -f build-xulrunner/_tests/xpcshell/test_uriloader_exthandler/unit/test_handlerService.js
 
 override_dh_auto_clean::
-	rm -rf debian/locales debian/reftest-app/stub
+	rm -rf debian/locales
+
+$(TESTS): %: %-skip
+
+.PHONY: test $(TESTS) $(TESTS:%=%-skip)
diff --git a/debian/xulrunner-GRE_VERSION.manpages.in b/debian/xulrunner-GRE_VERSION.manpages.in
index 6295f46..0304cea 100644
--- a/debian/xulrunner-GRE_VERSION.manpages.in
+++ b/debian/xulrunner-GRE_VERSION.manpages.in
@@ -1 +1,2 @@
 debian/xulrunner-##GRE_VERSION##.1
+debian/xulrunner-stub-##GRE_VERSION##.1
diff --git a/debian/xulrunner-GRE_VERSION.postinst.in b/debian/xulrunner-GRE_VERSION.postinst.in
index 65a3b9f..1b199a8 100644
--- a/debian/xulrunner-GRE_VERSION.postinst.in
+++ b/debian/xulrunner-GRE_VERSION.postinst.in
@@ -15,5 +15,12 @@ if [ "$1" = "configure" ] || [ "$1" = "triggered" ] ||
     rm -rf "$HOME"
 fi
 
+if [ "$1" = "configure" ] || [ "$1" = "abort-upgrade" ] ; then
+    update-alternatives --install /usr/bin/xulrunner-stub \
+        xulrunner-stub /usr/lib/xulrunner-##GRE_VERSION##/xulrunner-stub 100 \
+        --slave /usr/share/man/man1/xulrunner-stub.1.gz xulrunner-stub.1.gz \
+        /usr/share/man/man1/xulrunner-stub-##GRE_VERSION##.1.gz
+fi
+
 #DEBHELPER#
 
diff --git a/debian/xulrunner-GRE_VERSION.prerm.in b/debian/xulrunner-GRE_VERSION.prerm.in
index 265b207..686c48f 100644
--- a/debian/xulrunner-GRE_VERSION.prerm.in
+++ b/debian/xulrunner-GRE_VERSION.prerm.in
@@ -7,4 +7,8 @@ if [ "$1" = "remove" ]; then
           /usr/lib/xulrunner-##GRE_VERSION##/components/xpti.dat
 fi
 
+if [ "$1" = "remove" ] || [ "$1" = "deconfigure" ] ; then
+    update-alternatives --remove xulrunner-stub /usr/lib/xulrunner-##GRE_VERSION##/xulrunner-stub
+fi
+
 #DEBHELPER#
diff --git a/debian/xulrunner-dev.install.in b/debian/xulrunner-dev.install.in
index da54a8e..892fea0 100644
--- a/debian/xulrunner-dev.install.in
+++ b/debian/xulrunner-dev.install.in
@@ -1,5 +1,6 @@
 ../dh/dh_xulrunner usr/bin
 ../dh/xulrunner.pm usr/share/perl5/Debian/Debhelper/Sequence
+../dh/npapi_getinfo usr/lib/xulrunner-##GRE_VERSION##
 usr/include/xulrunner-##GRE_VERSION##
 usr/share/idl
 usr/lib/xulrunner-devel-##GRE_VERSION##
diff --git a/debian/xulrunner-dev.links.in b/debian/xulrunner-dev.links.in
new file mode 100644
index 0000000..80f7da2
--- /dev/null
+++ b/debian/xulrunner-dev.links.in
@@ -0,0 +1 @@
+usr/bin/nspr-config usr/lib/xulrunner-##GRE_VERSION##/nspr-config
diff --git a/debian/xulrunner-stub-GRE_VERSION.1.in b/debian/xulrunner-stub-GRE_VERSION.1.in
new file mode 100644
index 0000000..152c1ed
--- /dev/null
+++ b/debian/xulrunner-stub-GRE_VERSION.1.in
@@ -0,0 +1,24 @@
+.TH XULRUNNER\-STUB 1 "September 2, 2010"
+.SH NAME
+xulrunner\-stub - Generic binary to run xulrunner applications
+
+.SH DESCRIPTION
+xulrunner\-stub is not intended to be executed standalone. Doing so will only
+trigger a "Could not read application.ini" message.
+
+xulrunner\-stub is intended to be copied or symbolic-linked to a xulrunner
+application directory, where an application.ini file lies. It is recommended
+that the symbolic link is named after the application.
+
+An application requiring a specific major version of the xulrunner runtime
+(e.g. ##GRE_VERSION##.*) should target the symbolic link at the corresponding
+specific xulrunner\-stub (e.g. /usr/lib/xulrunner\-##GRE_VERSION##/xulrunner\-stub).
+
+On the other hand, an application with a broad range of supported version
+should target the symbolic link at /usr/bin/xulrunner\-stub.
+
+.SH AUTHOR
+This manpage was originally written by Mike Hommey <glandium@debian.org>
+for the Debian distribution.
+
+The main author of xulrunner is the Mozilla Project.

Reply to: