Planned changes to iceweasel/iceape vs. freeze

Mike Hommey mh at glandium.org
Wed Aug 25 12:58:48 UTC 2010


Hi,

To follow up on this, here is the status for the proposed changes so
far. Those from the original message not listed below are still to be
done.

On Mon, Aug 09, 2010 at 04:06:15PM +0200, Mike Hommey wrote:
> I don't remember where I got this idea that the freeze was expected to
> happen somewhen late this month, but I was taken by surprise by the
> freeze happening already. Anyways, the mozilla packages I take care of
> are in a releasable shape already, but there are more changes that I was
> planning to do some time this month, or at least for next upstream
> releases, scheduled for september 7th. I'll list these below, please
> tell me for which I can go forward (hopefully, all ;) )
> 
> - Iceweasel and xulrunner are currently two separate source packages,
>   sharing the exact same tarball. It is the result of the packages
>   history, and it would be better if they were merged, for several
>   reasons:
>   (...)
>   Obviously, only the source packages would be merged. All the resulting
>   binary packages would stay the same.
> - Possibly remove the libmozillainterfaces-java package. It is
>   apparently unused, not really maintained upstream (it's even being
>   removed from current trunk, in favor of a separate repository if a
>   maintainer shows up), and more importantly, not tested.

These two are the main part of what constitutes 3.5.11-2 currently in
unstable. It would probably make sense for you to start reviewing it, so
that further steps get easier to review. I'm attaching a detailed
analysis of the changes in 3.5.11-2. It would be nice to get it into
testing whenever possible, but that depends on sqlite, and also needs to
wait for python-xpcom getting out of NEW...

> - Add an option to dh_xulrunner to add the appropriate xulrunner package to
>   something other than shlibs:Depends.
> - Add a /usr/lib/xulrunner-devel symlink to /usr/lib/xulrunner-devel-

It turns out I don't need these two.

I have some mixed feelings about other of the proposed changes, but
I'll start discussion for these on -devel instead of -release.

Cheers,

Mike
-------------- next part --------------
A non-text attachment was scrubbed...
Name: Use-syscall-for-mmap-and-munmap-and-disable-ncpus-in.patch
Type: text/x-diff
Size: 1777 bytes
Desc: not available
URL: <http://lists.alioth.debian.org/pipermail/pkg-mozilla-maintainers/attachments/20100825/64c6b858/attachment-0001.patch>
-------------- next part --------------
Binary packages differences:
- /usr/lib/iceweasel/blocklist.xml was added, it was missing, before.
- The iceweasel-dbg size significantly grew: As some component files are
  now linked against libxpcomglue_s.a as in the xulrunner build tree, as
  opposed to the file as it is in the xulrunner-dev package, they now
  include debugging info for that file, as libxpcomglue_s.a in
  xulrunner-dev is stripped, and the one in the build tree is not.
- iceweasel dependencies bump for libglib and libgtk, due to
  dpkg-shlibdeps using the Build-Depends information (cf.
  Build-Depends-Package in the symbols file for both libs).
- Removal of the PyXPCOM.h file from xulrunner-dev. It's now included
  in the external python-xpcom.
- Removal of /usr/lib/xulrunner-1.9.1/libjavaxpcomglue.so in
  xulrunner-1.9.1. It's normally only useful for
  libmozillainterfaces-java.

As agreed upon, the source package now doesn't generate python-xpcom nor
libmozillainterfaces-java anymore. python-xpcom is sitting in NEW.

Source packages differences:
- The patch files in debian/patches have been renamed to not include a
  number, this makes it easier to track debian/patches/series changes.
- All the patches from iceweasel and xulrunner were applied, with a few
  exceptions:
  - cleanup patches. As the xulrunner and iceweasel builds now are done
    in a subdirectory, a properly clean "make distclean" is not necessary
    anymore.
  - patches related to python-xpcom and javaxpcom.
- Two patches were named similarly in both iceweasel and xulrunner. They were
  addressing the same issues, in both ends. Each pair has been merged.
  (fixes/Avoid-spurious-Run-items-in-application-handlers-con.patch,
   fixes/Fix-misalignments-in-help-command-line.patch)
- The configure.patch patches that apply configure.in changes were merged.
- The jemalloc patch was modified to use ifndefs where ifdefs were wrongly
  used. (fixes/Use-syscall-for-mmap-and-munmap-and-disable-ncpus-in.patch)
  See attached patch.
- As mentioned above, the iceweasel and xulrunner builds were modified to
  use subdirectories, as it was necessary to build in two passes.
- Some parts of each build scripts have been modified so that variable names
  are unified between both. This implies a lot of file renames and
  s/VAR1/VAR2/ changes, but nothing really important.
- The historical xulrunner changelog was moved in debian/changelog.xulrunner
- The copyright and watch files were taken from 

Below is an attempt at making some sensical patch against both previous
iceweasel and xulrunner packages. The diff for debian/rules is against previous
xulrunner, the diff for debian/changelog is against previous iceweasel.
The other modified files are against whatever they were present in. And the new
files are, well, new. I left off the s/VAR1/VAR2/ changes (it's actually
s/BASE_VERSION/GRE_VERSION/g only).
For the record, the debian/rules diff against previous iceweasel is at the
bottom.

diff --git a/debian/control b/debian/control
index 25aace7..9a13008 100644
--- a/debian/control
+++ b/debian/control
@@ -1,10 +1,10 @@
-Source: xulrunner
-Section: devel
+Source: iceweasel
+Section: web
 Priority: optional
 Maintainer: Maintainers of Mozilla-related packages <pkg-mozilla-maintainers at lists.alioth.debian.org>
 Uploaders: Mike Hommey <glandium at debian.org>
-Build-Depends: debhelper (>= 7.0.50~),
-               autotools-dev,
+Build-Depends: autotools-dev,
+               debhelper (>= 7.2.3),
                libx11-dev,
                libxt-dev,
                libidl-dev,
@@ -20,8 +20,7 @@ Build-Depends: debhelper (>= 7.0.50~),
                zlib1g-dev,
                libbz2-dev,
                libreadline-dev | libreadline5-dev,
-               python-dev,
-               python-support (>= 0.3),
+               python,
                dpkg-dev (>= 1.13.19),
                libnspr4-dev (>= 4.8),
                libnss3-dev (>= 3.12.6),
@@ -37,11 +36,56 @@ Build-Depends: debhelper (>= 7.0.50~),
                xfonts-base,
                xauth,
                ttf-bitstream-vera,
-               ttf-freefont
-Build-Depends-Indep: default-jdk | java-gcj-compat-dev (>= 1.0.56)
-Build-Conflicts: libhildonmime-dev,
+               ttf-freefont,
+               imagemagick,
+               librsvg2-bin,
+               sharutils,
+               xsltproc
+Build-Conflicts: graphicsmagick-imagemagick-compat,
+                 libhildonmime-dev,
                  libosso-dev
 Standards-Version: 3.9.0.0
+Vcs-Git: git://git.debian.org/git/pkg-mozilla/iceweasel.git
+Vcs-Browser: http://git.debian.org/?p=pkg-mozilla/iceweasel.git
+
+Package: iceweasel
+Architecture: any
+Depends: ${shlibs:Depends},
+         ${misc:Depends},
+         fontconfig,
+         procps,
+         debianutils (>= 1.16),
+         xulrunner-1.9.1 (>= 1.9.1.11)
+Suggests: ttf-lyx | latex-xft-fonts,
+          xfonts-mathml,
+          ttf-mathematica4.1,
+          xprint,
+          mozplugger,
+          libgssapi-krb5-2 | libkrb53
+Provides: www-browser,
+          gnome-www-browser
+Description: Web browser based on Firefox
+ Firefox is a redesign of the Mozilla browser component, similar to
+ Galeon, K-Meleon and Camino, but written using the XUL user interface
+ language and designed to be lightweight and cross-platform.
+ .
+ This browser is based on the Firefox source-code, with minor
+ modifications. Historically, this browser was previously known as
+ Firebird and Phoenix.
+
+Package: iceweasel-dbg
+Architecture: any
+Priority: extra
+Section: debug
+Depends: ${misc:Depends},
+         iceweasel (= ${binary:Version}),
+         xulrunner-1.9.1-dbg
+Description: debugging symbols for iceweasel
+ Iceweasel is a redesign of the Mozilla browser component, similar to
+ Galeon, K-Meleon and Camino, but written using the XUL user interface
+ language and designed to be lightweight and cross-platform.
+ .
+ This package contains the debugging symbols for iceweasel.
 
 Package: xulrunner-1.9.1
 Section: libs
@@ -144,10 +188,10 @@ Section: libdevel
 Architecture: any
 Depends: ${shlibs:Depends},
          ${misc:Depends},
-         xulrunner-1.9.1 (>= ${source:Upstream-Version}),
+         xulrunner-1.9.1 (>= ${binary:Version}),
          libnss3-dev,
          libnspr4-dev,
-         libmozjs-dev (>= ${source:Version})
+         libmozjs-dev (>= ${binary:Version})
 Description: Development files for the Gecko engine library
  This library provides an  API for XUL applications and Gecko embedders.
  The Gecko engine is the core of the mozilla.org applications such as
@@ -168,14 +212,8 @@ Package: xulrunner-1.9.1-dbg
 Section: debug
 Priority: extra
 Architecture: any
-Depends: xulrunner-1.9.1 (= ${binary:Version})
-         | python-xpcom (= ${binary:Version}),
+Depends: xulrunner-1.9.1 (= ${binary:Version}),
          ${misc:Depends}
-Conflicts: xulrunner-1.9-dbg,
-           xulrunner-1.9.1 (<< ${binary:Version}),
-           xulrunner-1.9.1 (>> ${binary:Version}),
-           python-xpcom (<< ${binary:Version}),
-           python-xpcom (>> ${binary:Version})
 Description: Debugging symbols for the Gecko engine library
  This library provides an  API for XUL applications and Gecko embedders.
  The Gecko engine is the core of the mozilla.org applications such as
@@ -185,50 +223,6 @@ Description: Debugging symbols for the Gecko engine library
  support, XBL, XUL, SVG, XSLT, XML Extras (XMLHttpRequest and DOMParser),
  Web Services (SOAP), accessibility support, IPC services, gtkmozembed, etc.
  .
- This package provides the debugging symbols for the library, and for the
- xulrunner-1.9.1 and python-xpcom packages.
+ This package provides the debugging symbols for the xulrunner-1.9.1
+ package.
 Homepage: http://wiki.mozilla.org/XUL:Lib_XUL
-
-Package: libmozillainterfaces-java
-Section: java
-Priority: extra
-Architecture: all
-Depends: xulrunner-1.9.1,
-         ${misc:Depends},
-         gij | java2-runtime
-Description: XPCOM bindings for Java
- JavaXPCOM allows for communication between Java and XPCOM, such that a
- Java application can access XPCOM objects, and XPCOM can access any Java
- class that implements an XPCOM interface.
- With JavaXPCOM, a developer can talk to XPCOM or embed Gecko from a Java
- application. JavaXPCOM is very similar to XPConnect (JavaScript-XPCOM
- bridge), and uses XPIDL
- .
- Install this package if you wish to access XPCOM objects from Java or
- the other way around.
- .
- This package also provides the JavaXPCOM interfaces sources.
-Homepage: http://developer.mozilla.org/en/docs/JavaXPCOM
-
-Package: python-xpcom
-Section: python
-Priority: extra
-Architecture: any
-Provides: ${python:Provides}
-Depends: ${shlibs:Depends},
-         ${misc:Depends},
-         ${python:Depends}
-Pre-Depends: xulrunner-1.9.1
-Breaks: epiphany-gecko (<< 2.28)
-XB-Python-Version: ${python:Versions}
-Description: XPCOM bindings for Python
- PyXPCOM allows for communication between Python and XPCOM, such that a
- Python application can access XPCOM objects, and XPCOM can access any
- Python class that implements an XPCOM interface.
- With PyXPCOM, a developer can talk to XPCOM or embed Gecko from a
- Python application. PyXPCOM is similar to JavaXPCOM (Java-XPCOM bridge)
- or XPConnect (JavaScript-XPCOM bridge).
- .
- Install this package if you wish to access XPCOM objects from Python, or
- want to use Python components from XPCOM.
-Homepage: http://developer.mozilla.org/en/docs/pyxpcom
diff --git a/debian/control.in b/debian/control.in
index debaa2c..8f2e4c6 100644
--- a/debian/control.in
+++ b/debian/control.in
@@ -1,10 +1,10 @@
-Source: xulrunner
-Section: devel
+Source: iceweasel
+Section: web
 Priority: optional
 Maintainer: Maintainers of Mozilla-related packages <pkg-mozilla-maintainers at lists.alioth.debian.org>
 Uploaders: Mike Hommey <glandium at debian.org>
-Build-Depends: debhelper (>= 7.0.50~),
-               autotools-dev,
+Build-Depends: autotools-dev,
+               debhelper (>= 7.2.3),
                libx11-dev,
                libxt-dev,
                libidl-dev,
@@ -20,8 +20,7 @@ Build-Depends: debhelper (>= 7.0.50~),
                zlib1g-dev,
                libbz2-dev,
                libreadline-dev | libreadline5-dev,
-               python-dev,
-               python-support (>= 0.3),
+               python,
                dpkg-dev (>= 1.13.19),
                libnspr4-dev (>= 4.8),
                libnss3-dev (>= 3.12.6),
@@ -37,13 +36,58 @@ Build-Depends: debhelper (>= 7.0.50~),
                xfonts-base,
                xauth,
                ttf-bitstream-vera,
-               ttf-freefont
-Build-Depends-Indep: default-jdk | java-gcj-compat-dev (>= 1.0.56)
-Build-Conflicts: libhildonmime-dev,
+               ttf-freefont,
+               imagemagick,
+               librsvg2-bin,
+               sharutils,
+               xsltproc
+Build-Conflicts: graphicsmagick-imagemagick-compat,
+                 libhildonmime-dev,
                  libosso-dev
 Standards-Version: 3.9.0.0
+Vcs-Git: git://git.debian.org/git/pkg-mozilla/iceweasel.git
+Vcs-Browser: http://git.debian.org/?p=pkg-mozilla/iceweasel.git
 
-Package: xulrunner-##BASE_VERSION##
+Package: iceweasel
+Architecture: any
+Depends: ${shlibs:Depends},
+         ${misc:Depends},
+         fontconfig,
+         procps,
+         debianutils (>= 1.16),
+         xulrunner-##GRE_VERSION## (>= ##GRE_MILESTONE##)
+Suggests: ttf-lyx | latex-xft-fonts,
+          xfonts-mathml,
+          ttf-mathematica4.1,
+          xprint,
+          mozplugger,
+          libgssapi-krb5-2 | libkrb53
+Provides: www-browser,
+          gnome-www-browser
+Description: Web browser based on Firefox
+ Firefox is a redesign of the Mozilla browser component, similar to
+ Galeon, K-Meleon and Camino, but written using the XUL user interface
+ language and designed to be lightweight and cross-platform.
+ .
+ This browser is based on the Firefox source-code, with minor
+ modifications. Historically, this browser was previously known as
+ Firebird and Phoenix.
+
+Package: iceweasel-dbg
+Architecture: any
+Priority: extra
+Section: debug
+Depends: ${misc:Depends},
+         iceweasel (= ${binary:Version}),
+         xulrunner-##GRE_VERSION##-dbg
+Description: debugging symbols for iceweasel
+ Iceweasel is a redesign of the Mozilla browser component, similar to
+ Galeon, K-Meleon and Camino, but written using the XUL user interface
+ language and designed to be lightweight and cross-platform.
+ .
+ This package contains the debugging symbols for iceweasel.
+
+Package: xulrunner-##GRE_VERSION##
 Section: libs
 Architecture: any
 Depends: ${shlibs:Depends},
@@ -54,8 +98,8 @@ Depends: ${shlibs:Depends},
          libcairo2 (>= 1.8.8)
 Suggests: ${gnome:Depends}, libgnomeui-0, libcanberra0
 Breaks: iceweasel (<< 3.5.5-1)
-Replaces: xulrunner-##BASE_VERSION##-gnome-support
-Conflicts: xulrunner-##BASE_VERSION##-gnome-support,
+Replaces: xulrunner-##GRE_VERSION##-gnome-support
+Conflicts: xulrunner-##GRE_VERSION##-gnome-support,
            j2re1.4,
            pango-graphite (<< 0.9.3)
 Description: XUL + XPCOM application runner
@@ -144,10 +188,10 @@ Section: libdevel
 Architecture: any
 Depends: ${shlibs:Depends},
          ${misc:Depends},
-         xulrunner-##BASE_VERSION## (>= ${source:Upstream-Version}),
+         xulrunner-##GRE_VERSION## (>= ${binary:Version}),
          libnss3-dev,
          libnspr4-dev,
-         libmozjs-dev (>= ${source:Version})
+         libmozjs-dev (>= ${binary:Version})
 Description: Development files for the Gecko engine library
  This library provides an  API for XUL applications and Gecko embedders.
  The Gecko engine is the core of the mozilla.org applications such as
@@ -164,18 +208,12 @@ Description: Development files for the Gecko engine library
  same form as the one you may find on mozilla.org in /usr/lib/xulrunner/sdk.
 Homepage: http://wiki.mozilla.org/XUL:Lib_XUL
 
-Package: xulrunner-##BASE_VERSION##-dbg
+Package: xulrunner-##GRE_VERSION##-dbg
 Section: debug
 Priority: extra
 Architecture: any
-Depends: xulrunner-##BASE_VERSION## (= ${binary:Version})
-         | python-xpcom (= ${binary:Version}),
+Depends: xulrunner-##GRE_VERSION## (= ${binary:Version}),
          ${misc:Depends}
-Conflicts: xulrunner-1.9-dbg,
-           xulrunner-##BASE_VERSION## (<< ${binary:Version}),
-           xulrunner-##BASE_VERSION## (>> ${binary:Version}),
-           python-xpcom (<< ${binary:Version}),
-           python-xpcom (>> ${binary:Version})
 Description: Debugging symbols for the Gecko engine library
  This library provides an  API for XUL applications and Gecko embedders.
  The Gecko engine is the core of the mozilla.org applications such as
@@ -185,50 +223,6 @@ Description: Debugging symbols for the Gecko engine library
  support, XBL, XUL, SVG, XSLT, XML Extras (XMLHttpRequest and DOMParser),
  Web Services (SOAP), accessibility support, IPC services, gtkmozembed, etc.
  .
- This package provides the debugging symbols for the library, and for the
- xulrunner-##BASE_VERSION## and python-xpcom packages.
+ This package provides the debugging symbols for the xulrunner-##GRE_VERSION##
+ package.
 Homepage: http://wiki.mozilla.org/XUL:Lib_XUL
-
-Package: libmozillainterfaces-java
-Section: java
-Priority: extra
-Architecture: all
-Depends: xulrunner-##BASE_VERSION##,
-         ${misc:Depends},
-         gij | java2-runtime
-Description: XPCOM bindings for Java
- JavaXPCOM allows for communication between Java and XPCOM, such that a
- Java application can access XPCOM objects, and XPCOM can access any Java
- class that implements an XPCOM interface.
- With JavaXPCOM, a developer can talk to XPCOM or embed Gecko from a Java
- application. JavaXPCOM is very similar to XPConnect (JavaScript-XPCOM
- bridge), and uses XPIDL
- .
- Install this package if you wish to access XPCOM objects from Java or
- the other way around.
- .
- This package also provides the JavaXPCOM interfaces sources.
-Homepage: http://developer.mozilla.org/en/docs/JavaXPCOM
-
-Package: python-xpcom
-Section: python
-Priority: extra
-Architecture: any
-Provides: ${python:Provides}
-Depends: ${shlibs:Depends},
-         ${misc:Depends},
-         ${python:Depends}
-Pre-Depends: xulrunner-##BASE_VERSION##
-Breaks: epiphany-gecko (<< 2.28)
-XB-Python-Version: ${python:Versions}
-Description: XPCOM bindings for Python
- PyXPCOM allows for communication between Python and XPCOM, such that a
- Python application can access XPCOM objects, and XPCOM can access any
- Python class that implements an XPCOM interface.
- With PyXPCOM, a developer can talk to XPCOM or embed Gecko from a
- Python application. PyXPCOM is similar to JavaXPCOM (Java-XPCOM bridge)
- or XPConnect (JavaScript-XPCOM bridge).
- .
- Install this package if you wish to access XPCOM objects from Python, or
- want to use Python components from XPCOM.
-Homepage: http://developer.mozilla.org/en/docs/pyxpcom
diff --git a/debian/extra-stuff/Makefile.in b/debian/extra-stuff/Makefile.in
index 38f0240..a6f19a0 100644
--- a/debian/extra-stuff/Makefile.in
+++ b/debian/extra-stuff/Makefile.in
@@ -19,7 +19,7 @@ places.js: $(topsrcdir)/browser/app/profile/firefox.js
 DEFINES += -DAB_CD=$(MOZ_UI_LOCALE) -DMOZ_APP_NAME=$(MOZ_APP_NAME) -DPREF_DIR=$(PREF_DIR)
 
 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)]/;/^bin\/\(README\.txt\|dictionaries\)/d' > $@
+	$(PYTHON) $(topsrcdir)/config/Preprocessor.py $(DEFINES) $(ACDEFINES) $^ | sed 's/^\[browser\]/[$(MOZ_APP_NAME)]/' > $@
 
 GARBAGE += places.js packages-static jar.mn
 
@@ -27,9 +27,9 @@ libs:: packages-static
 libs::
 	$(SYSINSTALL) $(IFLAGS2) $(srcdir)/reportbug-helper-script $(DIST)/bin
 
-ifeq (,$(wildcard $(JAR_MANIFEST)))
+ifeq (,$(wildcard jar.mn))
 libs::jar.mn
-	$(MAKE) realchrome
+	$(MAKE) realchrome JAR_MANIFEST=jar.mn
 endif
 
 locales:
@@ -38,4 +38,4 @@ locales:
 GARBAGE_DIRS += locales
 
 jar.mn: debUpdateNotifier.properties locales
-	awk 'BEGIN { print "debian.jar:" } { l = $$1; print "% locale debian " l " %locale/" l "/debian/"; print " locale/" l "/debian/$< (locales/" l ")"; $$0=substr($$0,length($$1)+2); print $$0 > "locales/" l}' $< > $@
+	awk 'BEGIN { print "debian.jar:" } { l = $$1 } $$2 == "message" { print "% locale debian " l " %locale/" l "/debian/"; print " locale/" l "/debian/$(notdir $<) (locales/" l ")" } { $$0=substr($$0,length($$1)+2); print $$0 > "locales/" l}' $< > $@
diff --git a/debian/extra-stuff/packages-static.xulrunner b/debian/extra-stuff/packages-static.xulrunner
index 56d6ed8..5d8633d 100644
--- a/debian/extra-stuff/packages-static.xulrunner
+++ b/debian/extra-stuff/packages-static.xulrunner
@@ -8,15 +8,6 @@ bin/xpt_dump
 bin/xpt_link
 bin/xulrunner-stub
 
-[pyxpcom]
-bin/libpyxpcom.so
-bin/components/libpyloader.so
-bin/components/pyabout.py
-
-[javaxpcom]
-bin/javaxpcom.jar
-bin/libjavaxpcomglue.so
-
 [debian]
 bin/reportbug-helper-script
 bin/components/addonsInfo.js
diff --git a/debian/libmozillainterfaces-java.install.in b/debian/libmozillainterfaces-java.install.in
deleted file mode 100644
index df6c878..0000000
--- a/debian/libmozillainterfaces-java.install.in
+++ /dev/null
@@ -1,4 +0,0 @@
-usr/lib/xulrunner-##BASE_VERSION##/javaxpcom.jar
-usr/lib/xulrunner-devel-##BASE_VERSION##/sdk/lib/MozillaGlue.jar
-usr/lib/xulrunner-devel-##BASE_VERSION##/sdk/lib/MozillaInterfaces.jar usr/share/java
-usr/lib/xulrunner-devel-##BASE_VERSION##/sdk/lib/MozillaInterfaces-src.jar
diff --git a/debian/libmozillainterfaces-java.links.in b/debian/libmozillainterfaces-java.links.in
deleted file mode 100644
index 4db92b4..0000000
--- a/debian/libmozillainterfaces-java.links.in
+++ /dev/null
@@ -1 +0,0 @@
-usr/share/java/MozillaInterfaces.jar usr/lib/xulrunner-devel-##BASE_VERSION##/sdk/lib/MozillaInterfaces.jar
diff --git a/debian/postinstrm.in b/debian/postinstrm.in
deleted file mode 100644
index fc2984d..0000000
--- a/debian/postinstrm.in
+++ /dev/null
@@ -1,20 +0,0 @@
-#!/bin/sh
-
-set -e
-
-dpkg-trigger --check-supported > /dev/null 2>&1 ||
-if [ "$1" = "configure" ] || [ "$1" = "abort-install" ] ||
-   [ "$1" = "abort-upgrade" ]; then
-    touch /usr/lib/xulrunner-##BASE_VERSION##/.autoreg
-    rm -f /usr/lib/xulrunner-##BASE_VERSION##/components/compreg.dat \
-          /usr/lib/xulrunner-##BASE_VERSION##/components/xpti.dat
-    cd /usr/lib/xulrunner-##BASE_VERSION##
-    export HOME=`mktemp -d`
-    ./run-mozilla.sh ./xpcshell -e "" ||
-    rm -f /usr/lib/xulrunner-##BASE_VERSION##/components/compreg.dat \
-          /usr/lib/xulrunner-##BASE_VERSION##/components/xpti.dat
-    rm -rf "$HOME"
-fi
-
-#DEBHELPER#
-
diff --git a/debian/python-xpcom.dirs b/debian/python-xpcom.dirs
deleted file mode 100644
index dd222db..0000000
--- a/debian/python-xpcom.dirs
+++ /dev/null
@@ -1 +0,0 @@
-usr/share
diff --git a/debian/python-xpcom.install.in b/debian/python-xpcom.install.in
deleted file mode 100644
index d5a92df..0000000
--- a/debian/python-xpcom.install.in
+++ /dev/null
@@ -1,4 +0,0 @@
-usr/lib/xulrunner-##BASE_VERSION##/libpyxpcom.so
-usr/lib/xulrunner-##BASE_VERSION##/components/libpyloader.so
-usr/lib/xulrunner-##BASE_VERSION##/components/pyabout.py
-usr/lib/python*/site-packages
diff --git a/debian/python-xpcom.postinst b/debian/python-xpcom.postinst
deleted file mode 100644
index 9309375..0000000
--- a/debian/python-xpcom.postinst
+++ /dev/null
@@ -1,10 +0,0 @@
-#!/bin/sh
-
-set -e
-
-# xulrunner trigger needs that to happen before running
-if [ "$1" = "configure" ]; then
-	update-python-modules -p
-fi
-
-#DEBHELPER#
diff --git a/debian/python-xpcom.prerm.in b/debian/python-xpcom.prerm.in
deleted file mode 100644
index bb57a17..0000000
--- a/debian/python-xpcom.prerm.in
+++ /dev/null
@@ -1,9 +0,0 @@
-#!/bin/sh
-
-set -e
-
-if [ "$1" = "remove" ]; then
-    rm -f /usr/lib/xulrunner-##BASE_VERSION##/components/pyabout.pyo
-fi
-
-#DEBHELPER#
diff --git a/debian/rules b/debian/rules
index 1d0102c..96b598c 100755
--- a/debian/rules
+++ b/debian/rules
@@ -4,22 +4,19 @@ 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)
 
-BASE_VERSION := 1.9.1
+UPSTREAM_VERSION := $(shell cat browser/config/version.txt)
+GRE_VERSION := 1.9.1
+GRE_MILESTONE := $(shell config/milestone.pl --topsrcdir .|sed 's/[a-z]/~&/')
 SO_VERSION := $(shell awk -F'[\t =]+' '$$1 == "SO_VERSION" {print $$2}' js/src/Makefile.in)
 
-PYVER := $(shell pyversions -d)
+LIB_DIR := /usr/lib/iceweasel
+SHARE_DIR := /usr/share/iceweasel
 
 CFLAGS := -g
 MAIN_LDFLAGS := -Wl,--as-needed
 
 AUTOCONF_DIRS := build/autoconf js/src/build/autoconf
 
-JAVA_VARS := \
-	MOZ_JAVAXPCOM=1 \
-	JAVA_INCLUDE_PATH=$(CURDIR)/sun-java/stubs/include \
-	JAVAC=javac \
-	JAR=jar \
-
 ifneq (,$(filter noopt,$(DEB_BUILD_OPTIONS)))
 	CONFIGURE_FLAGS += --disable-optimize
 endif
@@ -47,53 +44,48 @@ ifeq (,$(shell dpkg --compare-versions $(shell $(CXX) -dumpversion) '>=' 4.4 ||
 CXXFLAGS += -std=gnu++0x
 endif
 
+export CFLAGS CXXFLAGS
+
 JS_LDFLAGS := $(MAIN_LDFLAGS)
 JS_LDFLAGS += -Wl,--version-script=$(CURDIR)/debian/symbols.filter
 
-COMPONENT_PACKAGES := python-xpcom
-COMPONENT_SCRIPTS := $(COMPONENT_PACKAGES:%=debian/%.postinst) $(COMPONENT_PACKAGES:%=debian/%.postrm)
-MAINT_SCRIPTS := $(COMPONENT_SCRIPTS) debian/xulrunner-$(BASE_VERSION).postinst
-GENERATED_FILES := $(MAINT_SCRIPTS)
-$(COMPONENT_SCRIPTS): %: debian/postinstrm
-	cp $^ $@
-
-debian/xulrunner-$(BASE_VERSION).postinst: debian/postinstrm
-	sed 's/abort-install/triggered/;/^dpkg-trigger/d' $^ > $@
-
 GENERATED_FILES += debian/dh/dh_xulrunner.1
 
 debian/dh/dh_xulrunner.1: debian/dh/dh_xulrunner
-	pod2man -c Debhelper -r $(BASE_VERSION) $^ > $@
+	pod2man -c Debhelper -r $(GRE_VERSION) $^ > $@
 
 IN_FILES := $(wildcard debian/*.in debian/dh/*.in)
 define preprocess
-$(subst SO_VERSION,$(SO_VERSION),$(subst BASE_VERSION,$(BASE_VERSION),$(1:.in=))): $(1)
-PREPROCESSED_FILES += $(subst SO_VERSION,$(SO_VERSION),$(subst BASE_VERSION,$(BASE_VERSION),$(1:.in=)))
+$(subst SO_VERSION,$(SO_VERSION),$(subst GRE_VERSION,$(GRE_VERSION),$(1:.in=))): $(1)
+PREPROCESSED_FILES += $(subst SO_VERSION,$(SO_VERSION),$(subst GRE_VERSION,$(GRE_VERSION),$(1:.in=)))
 endef
 $(foreach f,$(IN_FILES),$(eval $(call preprocess, $(f))))
 
 GENERATED_FILES += $(filter-out debian/control,$(PREPROCESSED_FILES))
 
 $(PREPROCESSED_FILES):
-	sed -e 's/##BASE_VERSION##/$(BASE_VERSION)/g' -e 's/##SO_VERSION##/$(SO_VERSION)/g' $^ > $@
+	sed -e 's/##GRE_VERSION##/$(GRE_VERSION)/g' -e 's/##GRE_MILESTONE##/$(GRE_MILESTONE)/g' -e 's/##SO_VERSION##/$(SO_VERSION)/g' $^ > $@
 
-override_dh_auto_configure: debian/mozconfig
+override_dh_auto_configure:
+
+stamps/prepare-configure::
 	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; \
 		done; \
 	done
 
-	MOZCONFIG=debian/mozconfig \
+stamps/configure-xulrunner:: stamps/prepare-configure
+	mkdir build-xulrunner
+	cd build-xulrunner && \
+	MOZCONFIG=$(CURDIR)/debian/xulrunner.mozconfig \
 	ASFLAGS="-g" \
-	CFLAGS="$(CFLAGS)" \
-	CXXFLAGS="$(CXXFLAGS)" \
-	./configure --host=$(DEB_HOST_GNU_TYPE) --build=$(DEB_BUILD_GNU_TYPE) --prefix=/usr $(CONFIGURE_FLAGS)
-	build/autoconf/make-makefile debian/extra-stuff
-	sed -i '/^OS_LDFLAGS/s|=|& $(MAIN_LDFLAGS)|' config/autoconf.mk
-	sed -i '/^OS_LDFLAGS/s|=|& $(JS_LDFLAGS)|' js/src/config/autoconf.mk
-
-check-system-libs:
+	../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
+
 	@awk -F' *# *| *$$' ' \
 	$$1 ~ /system/ { \
 		if (! $$2) { \
@@ -101,19 +93,32 @@ check-system-libs:
 			error=1; \
 		} else { \
 			split($$2,var,"="); \
-			cmd = "$(MAKE) --no-print-directory echo-variable-" var[1]; \
+			cmd = "$(MAKE) -C build-xulrunner --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/mozconfig.in
+	END { if (error) { exit 1 }}' debian/xulrunner.mozconfig
+
+stamps/build-xulrunner:: stamps/configure-xulrunner
+	dh_auto_build --parallel --builddirectory=build-xulrunner
+	$(MAKE) -C build-xulrunner/debian/extra-stuff
+
+stamps/configure-iceweasel:: stamps/build-xulrunner
+	MOZCONFIG=$(CURDIR)/debian/iceweasel.mozconfig \
+	dh_auto_configure --builddirectory=build-iceweasel -- $(CONFIGURE_FLAGS) \
+		--with-libxul-sdk=$(CURDIR)/build-xulrunner/dist \
+		--with-system-libxul --with-system-nspr --with-system-nss
+	sed -i '/^OS_LDFLAGS/s|=|& $(MAIN_LDFLAGS)|' build-iceweasel/config/autoconf.mk
 
-override_dh_auto_build: check-system-libs
-	dh_auto_build --parallel -- \
-		PYTHON_SO=$(shell objdump -p /usr/lib/lib$(PYVER).so | awk '/SONAME/ {print $$2}') \
-		$(JAVA_VARS) \
-		$(if $(wildcard /usr/bin/javac),,DEB_NO_JAR=1)
-	$(MAKE) -C debian/extra-stuff
+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 $@
+
+override_dh_auto_build: stamps/build-iceweasel
 
 ifeq (,$(filter nocheck,$(DEB_BUILD_OPTIONS)))
 include debian/test.mk
@@ -123,9 +128,11 @@ override_dh_auto_clean::
 	rm -f MPL
 	rm -f debian/libmozjs$(SO_VERSION).symbols.$(DEB_BUILD_ARCH)
 	rm -f $(GENERATED_FILES)
+	rm -rf stamps
 
-	[ ! -f config/autoconf.mk ] || $(MAKE) -C debian/extra-stuff distclean
-	dh_auto_clean --parallel -- $(JAVA_VARS)
+	dh_auto_clean --builddirectory=build-iceweasel
+	dh_auto_clean --builddirectory=build-xulrunner
+	find . -name "*.pyc" | xargs rm -f
 
 	for dir in $(AUTOCONF_DIRS); do \
 		for file in config.guess config.sub; do \
@@ -134,90 +141,121 @@ override_dh_auto_clean::
 	done
 
 override_dh_auto_install:
-	dh_auto_install --sourcedirectory=xulrunner/installer -- MOZ_PKG_MANIFEST=$(CURDIR)/debian/extra-stuff/packages-static
-	rm debian/tmp/usr/include/xulrunner-$(BASE_VERSION)/unstable/TestHarness.h
+	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-$(BASE_VERSION)
+	mv debian/tmp/usr/bin/xulrunner debian/tmp/usr/bin/xulrunner-$(GRE_VERSION)
 
 	# Fixup permissions
 	find debian/tmp/usr/share debian/tmp/usr/include -type f -print0 | xargs -0 chmod 644
 
 	# Replace some installed files by symlinks
-	cd debian/tmp/usr/lib/xulrunner-devel-$(BASE_VERSION)/sdk/lib; \
+	cd debian/tmp/usr/lib/xulrunner-devel-$(GRE_VERSION)/sdk/lib; \
 		for f in *.so; do \
-			rm -f $$f; ln -s /usr/lib/xulrunner-$(BASE_VERSION)/$$f $$f; \
+			rm -f $$f; ln -s /usr/lib/xulrunner-$(GRE_VERSION)/$$f $$f; \
 		done
-	cd debian/tmp/usr/include/xulrunner-$(BASE_VERSION)/stable; \
+	cd debian/tmp/usr/include/xulrunner-$(GRE_VERSION)/stable; \
 		for f in *; do \
 			rm -f ../unstable/$$f; ln -s ../stable/$$f ../unstable/$$f; \
 		done
-	cd debian/tmp/usr/share/idl/xulrunner-$(BASE_VERSION)/stable; \
+	cd debian/tmp/usr/share/idl/xulrunner-$(GRE_VERSION)/stable; \
 		for f in *; do \
 			rm -f ../unstable/$$f; ln -s ../stable/$$f ../unstable/$$f; \
 		done
-	ln -s ../../xulrunner-$(BASE_VERSION) debian/tmp/usr/lib/xulrunner-devel-$(BASE_VERSION)/sdk/bin
+	ln -s ../../xulrunner-$(GRE_VERSION) debian/tmp/usr/lib/xulrunner-devel-$(GRE_VERSION)/sdk/bin
 
-	dh_auto_install --sourcedirectory=js/src -- prefix=/usr MODULE=mozjs FORCE_STATIC_LIB= SCRIPTS=
+	dh_auto_install --sourcedirectory=build-xulrunner/js/src -- prefix=/usr MODULE=mozjs FORCE_STATIC_LIB= SCRIPTS=
 	find debian/tmp/usr/include/mozjs -type f -printf %P\\n | while read f; do \
-		file=$$(echo debian/tmp/usr/include/xulrunner-$(BASE_VERSION)/*/$$(basename $$f)); \
+		file=$$(echo debian/tmp/usr/include/xulrunner-$(GRE_VERSION)/*/$$(basename $$f)); \
 		rm $$file; \
 		ln -s /usr/include/mozjs/$$f $$file; \
 	done
 	for f in /usr/include/nspr/* /usr/include/nss/*; do \
-		ln -s $$f debian/tmp/usr/include/xulrunner-$(BASE_VERSION)/stable/$$(basename $$f); \
-		ln -s $$f debian/tmp/usr/include/xulrunner-$(BASE_VERSION)/unstable/$$(basename $$f); \
+		ln -s $$f debian/tmp/usr/include/xulrunner-$(GRE_VERSION)/stable/$$(basename $$f); \
+		ln -s $$f debian/tmp/usr/include/xulrunner-$(GRE_VERSION)/unstable/$$(basename $$f); \
 	done
-	for h in $$(grep -l -r EXPORTS media | grep Makefile$ | \
+	for h in $$(grep -l -r EXPORTS build-xulrunner/media | grep Makefile$ | \
 		while read f; do $(MAKE) --no-print-directory -C $$(dirname $$f) echo-variable-EXPORTS; done); do \
-		rm -f debian/tmp/usr/include/xulrunner-$(BASE_VERSION)/unstable/$$h; \
+		rm -f debian/tmp/usr/include/xulrunner-$(GRE_VERSION)/unstable/$$h; \
 	done
 
-	rm debian/tmp/usr/lib/xulrunner-$(BASE_VERSION)/libmozjs.so
+	rm debian/tmp/usr/lib/xulrunner-$(GRE_VERSION)/libmozjs.so
 	mv debian/tmp/usr/bin/js debian/tmp/usr/bin/smjs
 
-	install -d -m 755 debian/tmp/usr/lib/$(PYVER)/site-packages
-	tar -C dist/bin/python -chf - .| tar -C debian/tmp/usr/lib/$(PYVER)/site-packages -xf -
-
 	sed -i '/^Cflags/ s,$${includedir}/stable,/usr/include/mozjs,' debian/tmp/usr/lib/pkgconfig/mozilla-js.pc
 
+	dh_auto_install --builddirectory=build-iceweasel -- installdir=$(LIB_DIR)
+	chmod 755 debian/iceweasel-xremote-client
+
 MPL: LICENSE
 	cp -f $< $@
 
 override_dh_installdocs: MPL
 	dh_installdocs -A $^
 
-override_dh_install: debian/dh/dh_xulrunner
-	dh_install -a --fail-missing -XMozillaInterfaces -XMozillaGlue -Xjavaxpcom.jar
-	dh_install -i
-	# Make sure dh_xulrunner is able to spot the current XPCOM standalone glue.
-	perl $< -pxulrunner-$(BASE_VERSION) --no-act -v 2>&1 | grep -q "..*"
+override_dh_install: debian/dh/dh_xulrunner debian/noinstall
+	awk '{print "debian/tmp/" $$1 }' < debian/noinstall | xargs rm -r
+	dh_install --fail-missing
+#Install helpers
+	install -m 755 debian/iceweasel-runner \
+		debian/iceweasel/$(LIB_DIR)/iceweasel
+
+# Install icons
+	install -d -m 755 debian/iceweasel/usr/share/icons/hicolor/16x16/apps
+	install -m 644 build-iceweasel/debian/branding/default16.png \
+		debian/iceweasel/usr/share/icons/hicolor/16x16/apps/iceweasel.png
+	install -d -m 755 debian/iceweasel/usr/share/icons/hicolor/32x32/apps
+	install -m 644 build-iceweasel/debian/branding/default32.png \
+		debian/iceweasel/usr/share/icons/hicolor/32x32/apps/iceweasel.png
+	install -d -m 755 debian/iceweasel/usr/share/icons/hicolor/64x64/apps
+	install -m 644 build-iceweasel/debian/branding/default64.png \
+		debian/iceweasel/usr/share/icons/hicolor/64x64/apps/iceweasel.png
+	install -d -m 755 debian/iceweasel/usr/share/icons/hicolor/scalable/apps
+	install -m 644 debian/branding/iceweasel_icon.svg \
+		debian/iceweasel/usr/share/icons/hicolor/scalable/apps/iceweasel.svg
+
+# Remove unneeded configs
+	rm -f debian/iceweasel/$(SHARE_DIR)/defaults/pref/firefox-l10n.js
+
+# Install vendor preferences
+	install -m 644 debian/vendor.js \
+		debian/iceweasel/$(SHARE_DIR)/defaults/preferences/vendor.js
+
+# Add Debian package version to preferences
+	echo "pref(\"general.useragent.extra.firefoxComment\",\"(like Firefox/$(UPSTREAM_VERSION))\");" \
+		>> debian/iceweasel/$(SHARE_DIR)/defaults/preferences/vendor.js
+
+	sed -i 's/\(MinVersion=$(GRE_VERSION)\).*/\1/;s/\(MaxVersion=$(GRE_VERSION)\).*/\1.*/' debian/iceweasel/$(LIB_DIR)/application.ini
 
-override_dh_installman: debian/dh/dh_xulrunner.1 debian/xulrunner-$(BASE_VERSION).1
-	dh_installman -pspidermonkey-bin debian/smjs.1
-	dh_installman -pxulrunner-dev debian/dh/dh_xulrunner.1
-	dh_installman -pxulrunner-$(BASE_VERSION) debian/xulrunner-$(BASE_VERSION).1
+	# Make sure dh_xulrunner is able to spot the current XPCOM standalone glue.
+	perl $< -pxulrunner-$(GRE_VERSION) --no-act -v 2>&1 | grep -q "..*"
 
 override_dh_strip:
-	dh_strip -a -Nlibmozjs$(SO_VERSION) -Nspidermonkey-bin --dbg-package=xulrunner-$(BASE_VERSION)-dbg
+	dh_strip -a -Niceweasel -Nlibmozjs$(SO_VERSION) -Nspidermonkey-bin --dbg-package=xulrunner-$(GRE_VERSION)-dbg
+	dh_strip -piceweasel --dbg-package=iceweasel-dbg
 	dh_strip -plibmozjs$(SO_VERSION) --dbg-package=libmozjs$(SO_VERSION)-dbg
 	dh_strip -pspidermonkey-bin
 
 override_dh_makeshlibs:
-	if [ "`$(MAKE) --no-print-directory -C js/src echo-variable-ENABLE_JIT`" = 1 ]; then \
+	if [ "`$(MAKE) --no-print-directory -C build-xulrunner/js/src echo-variable-ENABLE_JIT`" = 1 ]; then \
 		echo '#include "libmozjs$(SO_VERSION).symbols.jit"' > debian/libmozjs$(SO_VERSION).symbols.$(DEB_BUILD_ARCH); \
 	fi
 	dh_makeshlibs -plibmozjs$(SO_VERSION) -V 'libmozjs$(SO_VERSION) (>= 1.9.1.4)' -- $(GENSYMBOLS_FLAGS)
 
 override_dh_shlibdeps:
-	dh_shlibdeps -a -l$(CURDIR)/debian/tmp/usr/lib/xulrunner-$(BASE_VERSION) -Xlibmozgnome -Xlibnkgnomevfs -Xlibdbusservice
-	LD_LIBRARY_PATH=$(CURDIR)/debian/tmp/usr/lib/xulrunner-$(BASE_VERSION) dpkg-shlibdeps -Tdebian/xulrunner-$(BASE_VERSION).substvars -dDepends -pgnome $(foreach lib,dbusservice mozgnome nkgnomevfs,debian/xulrunner-$(BASE_VERSION)/usr/lib/xulrunner-$(BASE_VERSION)/components/lib$(lib).so)
+	dh_shlibdeps -a -l$(CURDIR)/debian/tmp/usr/lib/xulrunner-$(GRE_VERSION) -Xlibmozgnome -Xlibnkgnomevfs -Xlibdbusservice
+	LD_LIBRARY_PATH=$(CURDIR)/debian/tmp/usr/lib/xulrunner-$(GRE_VERSION) dpkg-shlibdeps -Tdebian/xulrunner-$(GRE_VERSION).substvars -dDepends -pgnome $(foreach lib,dbusservice mozgnome nkgnomevfs,debian/xulrunner-$(GRE_VERSION)/usr/lib/xulrunner-$(GRE_VERSION)/components/lib$(lib).so)
+
+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')
 
-install binary binary-arch binary-indep: $(MAINT_SCRIPTS) $(PREPROCESSED_FILES)
+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 check-system-libs
+.PHONY: build clean binary-indep binary-arch binary install test $(TESTS) xpcshell-tests-skip
 
 .NOTPARALLEL:
 endif
diff --git a/debian/test.mk b/debian/test.mk
index d6d36c6..12d776f 100755
--- a/debian/test.mk
+++ b/debian/test.mk
@@ -15,7 +15,7 @@ endif
 
 override_dh_auto_test: $(TESTS)
 
-debian/reftest-app/stub: $(CURDIR)/dist/bin/xulrunner-stub
+debian/reftest-app/stub: $(CURDIR)/build-xulrunner/dist/bin/xulrunner-stub
 	ln -s $< $@
 
 ifndef HAS_LOCALE
@@ -24,24 +24,24 @@ 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)/dist/bin
+reftest crashtest: export GRE_HOME = $(CURDIR)/build-xulrunner/dist/bin
 reftest crashtest: XVFB_RUN = xvfb-run -s "-screen 0 1024x768x24"
 
 $(TESTS):
 	GNOME22_USER_DIR="$(CURDIR)/dist/.gnome2" \
 	HOME="$(CURDIR)/dist" \
-	$(XVFB_RUN) $(MAKE) $@ 2>&1 | sed -u 's/^/$@> /'
+	$(XVFB_RUN) $(MAKE) -C build-xulrunner $@ 2>&1 | sed -u 's/^/$@> /'
 
 xpcshell-tests: xpcshell-tests-skip $(if $(HAS_LOCALE),,debian/locales/$(LOCALE))
 
 xpcshell-tests-skip:
 # APNG is not supported
-	rm -f _tests/xpcshell/test_libpr0n/unit/test_encoder_apng.js
+	rm -f build-xulrunner/_tests/xpcshell/test_libpr0n/unit/test_encoder_apng.js
 # This one fails because it relies on a sqlite bug that is fixed in the system one
 # See http://hg.mozilla.org/mozilla-central/raw-rev/1192461c259d
-	rm -f _tests/xpcshell/test_storage/unit/test_storage_combined_sharing.js
+	rm -f build-xulrunner/_tests/xpcshell/test_storage/unit/test_storage_combined_sharing.js
 # This one fails because it supposes some kind of preexisting gnome/mailcap configuration
-	rm -f _tests/xpcshell/test_uriloader_exthandler/unit/test_handlerService.js
+	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
diff --git a/debian/mozconfig.in b/debian/xulrunner.mozconfig
similarity index 90%
rename from debian/mozconfig.in
rename to debian/xulrunner.mozconfig
index ffa4e8a..a97ee67 100644
--- a/debian/mozconfig.in
+++ b/debian/xulrunner.mozconfig
@@ -1,6 +1,5 @@
 . $topsrcdir/xulrunner/config/mozconfig
 ac_add_options --prefix=/usr
-ac_add_options --with-default-mozilla-five-home=/usr/lib/xulrunner-##BASE_VERSION##
 ac_add_options --enable-default-toolkit=cairo-gtk2
 ac_add_options --enable-pango
 ac_add_options --enable-system-cairo # MOZ_TREE_CAIRO=
@@ -20,7 +19,6 @@ ac_add_options --disable-mochitest
 ac_add_options --disable-debug
 ac_add_options --enable-canvas
 ac_add_options --with-readline
-ac_add_options --enable-extensions="default python/xpcom"
 ac_add_options --disable-installer
 ac_add_options --disable-javaxpcom
 ac_add_options --disable-elf-dynstr-gc
diff --git a/debian/noinstall.in b/debian/noinstall.in
new file mode 100644
index 0000000..2398649
--- /dev/null
+++ b/debian/noinstall.in
@@ -0,0 +1,6 @@
+usr/bin/iceweasel
+usr/lib/iceweasel/run-mozilla.sh
+usr/lib/iceweasel/README.txt
+usr/lib/iceweasel/removed-files
+usr/lib/xulrunner-##GRE_VERSION##/README.txt
+usr/lib/xulrunner-##GRE_VERSION##/dictionaries
diff --git a/debian/spidermonkey-bin.manpages b/debian/spidermonkey-bin.manpages
new file mode 100644
index 0000000..70dfe9e
--- /dev/null
+++ b/debian/spidermonkey-bin.manpages
@@ -0,0 +1 @@
+debian/smjs.1
diff --git a/debian/xulrunner-GRE_VERSION.manpages.in b/debian/xulrunner-GRE_VERSION.manpages.in
new file mode 100644
index 0000000..6295f46
--- /dev/null
+++ b/debian/xulrunner-GRE_VERSION.manpages.in
@@ -0,0 +1 @@
+debian/xulrunner-##GRE_VERSION##.1
diff --git a/debian/xulrunner-dev.manpages b/debian/xulrunner-dev.manpages
new file mode 100644
index 0000000..0e94d9b
--- /dev/null
+++ b/debian/xulrunner-dev.manpages
@@ -0,0 +1 @@
+debian/dh/dh_xulrunner.1
diff --git a/debian/changelog b/debian/changelog
index 469b5fb..6693bfa 100644
--- a/debian/changelog
+++ b/debian/changelog
@@ -1,3 +1,78 @@
+iceweasel (3.5.11-2) unstable; urgency=low
+
+  [ iceweasel ]
+  * debian/iceweasel.install, debian/rules: Build in a subdirectory instead
+    of within the source directory.
+  * debian/iceweasel.mozconfig, debian/rules: Move most configure options
+    to a separate mozconfig file.
+  * debian/iceweasel.install: Install blocklist.xml.
+  * debian/noinstall, debian/rules: Remove some installed files from
+    debian/tmp, and use dh_install --fail-missing.
+  * debian/rules: Add --with-system-libxul configure option.
+  * debian/rules: Rename CONFIGURE_OPTIONS to CONFIGURE_FLAGS
+  * debian/control*:
+    - Reformat.
+    - Remove Eric Dorland from the Uploaders field. Given his limited time
+      and lost interest, Eric agreed to formally retire from iceweasel
+      maintenance. Thanks for all these years, Eric.
+
+  * build/Makefile.in, build/automation-build.mk: Revert cleaning patches.
+
+  [ xulrunner ]
+  * debian/control*, debian/extra-stuff/packages-static.xulrunner,
+    debian/mozconfig.in, debian/postinstrm.in, debian/python-xpcom.*,
+    debian/rules, debian/xulrunner-BASE_VERSION.postinst.in: Remove python
+    xpcom, it will be provided by an external package.
+  * debian/control*, debian/extra-stuff/packages-static.xulrunner,
+    debian/libmozillainterfaces-java.*, debian/rules,
+    debian/xulrunner-BASE_VERSION.install.in: Remove unsupported javaxpcom
+    support.
+  * debian/rules, debian/test.mk: Build in a subdirectory instead of within
+    the source directory.
+  * debian/mozconfig*, debian/rules: Move default-mozilla-five-home
+    definition from mozconfig to debian/rules.
+  * debian/mozconfig, debian/rules: Rename mozconfig to xulrunner.mozconfig.
+  * debian/*: Rename BASE_VERSION to GRE_VERSION.
+
+  * Makefile.in, build/Makefile.in, build/automation-build.mk,
+    config/rules.mk, js/src/Makefile.in, js/src/config/rules.mk,
+    js/src/xpconnect/src/Makefile.in, testing/testsuite-targets.mk,
+    xpcom/tests/Makefile.in: Revert cleaning patches.
+  * extensions/java/xpcom/Makefile.in,
+    toolkit/toolkit-makefiles.sh: Revert javaxpcom patches.
+  * extensions/python/xpcom/Makefile.in,
+    extensions/python/xpcom/src/Makefile.in,
+    extensions/python/xpcom/src/loader/Makefile.in,
+    extensions/python/xpcom/src/module/Makefile.in: Revert python-xpcom
+    patches.
+  * memory/jemalloc/jemalloc.c: Properly disable ncpus in jemalloc, which
+    the previous patch didn't do.
+
+  [ merged packages ]
+  * debian/control*, debian/rules: Merged iceweasel and xulrunner source
+    packages. Binary packages are kept as they were before.
+  * debian/copyright, debian/watch: Use Iceweasel's version.
+  * debian/changelog: Keep Iceweasel changelog. Xulrunner's go in a separate
+    debian/changelog.xulrunner file, for historical purpose. The file is not
+    installed in binary packages.
+  * debian/control*: Fix xulrunner-dev dependencies. As ${source:*Version}
+    will return iceweasel version, ${binary:Version} is better to use. It
+    turns out it is safe to use now xulrunner-dev is not Arch: all.
+  * debian/extra-stuff/Makefile.in:
+    - Fix to support subdirectory build.
+    - Avoid duplicated entries in generated jar manifest.
+  * debian/rules:
+    - Set LDFLAGS for iceweasel the same way xulrunner does.
+    - Export CFLAGS and CXXFLAGS directly from rules instead of setting them
+      when calling configure.
+  * debian/extra-stuff/Makefile.in, debian/noinstall*, debian/rules: Use
+    debian/noinstall to avoid installing some xulrunner files, instead of
+    filtering the package manifest.
+  * debian/rules, debian/*.manpages*: Use .manpages files instead of calling
+    dh_installman manually. Iceweasel was doing that, but not xulrunner.
+
+ -- Mike Hommey <glandium at debian.org>  Thu, 19 Aug 2010 18:33:36 +0200
+
 iceweasel (3.5.11-1) unstable; urgency=high
 
   * New upstream release.
diff --git a/debian/iceweasel.install b/debian/iceweasel.install
index 9a23b1a..74e68de 100644
--- a/debian/iceweasel.install
+++ b/debian/iceweasel.install
@@ -10,16 +10,17 @@ debian/tmp/usr/lib/iceweasel/chrome usr/share/iceweasel
 debian/tmp/usr/lib/iceweasel/modules usr/share/iceweasel
 
 debian/tmp/usr/lib/iceweasel/application.ini usr/lib/iceweasel
+debian/tmp/usr/lib/iceweasel/blocklist.xml usr/lib/iceweasel
 
 debian/tmp/usr/lib/iceweasel/defaults/profile etc/iceweasel/
 
 debian/iceweasel.desktop usr/share/applications
 debian/iceweaselrc etc/iceweasel
 
-debian/branding/mozicon16.xpm usr/share/iceweasel/icons/
-debian/branding/mozicon50.xpm usr/share/iceweasel/icons/
-debian/branding/mozicon128.png usr/share/iceweasel/icons/
-debian/branding/document.png usr/share/iceweasel/icons/
+build-iceweasel/debian/branding/mozicon16.xpm usr/share/iceweasel/icons/
+build-iceweasel/debian/branding/mozicon50.xpm usr/share/iceweasel/icons/
+build-iceweasel/debian/branding/mozicon128.png usr/share/iceweasel/icons/
+build-iceweasel/debian/branding/document.png usr/share/iceweasel/icons/
 
 debian/iceweasel.js etc/iceweasel/pref
 
@@ -27,9 +28,9 @@ debian/debsearch.xml usr/share/iceweasel/searchplugins
 
 debian/tmp/usr/lib/iceweasel/extensions/\{972ce4c6-7e08-4474-a285-3208198ce6fd\} usr/lib/iceweasel/extensions
 
-debian/branding/iceweasel.xpm usr/share/pixmaps
+build-iceweasel/debian/branding/iceweasel.xpm usr/share/pixmaps
 
 debian/firefox usr/bin
 
 debian/branding/aboutIce.js usr/lib/iceweasel/components
-dist/bin/chrome/ice.* usr/share/iceweasel/chrome
+build-iceweasel/dist/bin/chrome/ice.* usr/share/iceweasel/chrome
diff --git a/debian/iceweasel.mozconfig b/debian/iceweasel.mozconfig
new file mode 100644
index 0000000..28cd46a
--- /dev/null
+++ b/debian/iceweasel.mozconfig
@@ -0,0 +1,13 @@
+. $topsrcdir/browser/config/mozconfig
+ac_add_options --with-user-appdir=.mozilla
+ac_add_options --disable-installer
+ac_add_options --disable-strip
+ac_add_options --disable-install-strip
+ac_add_options --disable-tests
+ac_add_options --enable-extensions=default
+ac_add_options --enable-single-profile
+ac_add_options --disable-profilesharing
+ac_add_options --disable-updater
+ac_add_options --disable-elf-dynstr-gc
+ac_add_options --with-branding=debian/branding
+ac_add_options --disable-crashreporter

-------------------------------------------------------------------------------------
For the record, the debian/rules diff against previous iceweasel:

diff --git a/debian/rules b/debian/rules
index 70a6957..96b598c 100755
--- a/debian/rules
+++ b/debian/rules
@@ -1,84 +1,214 @@
 #!/usr/bin/make -f
+ifeq (,$(shell dh_testdir || echo no))
+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]/~&/')
-
-AUTOCONF_DIRS := ./nsprpub/build/autoconf/ ./build/autoconf/
+SO_VERSION := $(shell awk -F'[\t =]+' '$$1 == "SO_VERSION" {print $$2}' js/src/Makefile.in)
 
 LIB_DIR := /usr/lib/iceweasel
 SHARE_DIR := /usr/share/iceweasel
 
 CFLAGS := -g
+MAIN_LDFLAGS := -Wl,--as-needed
+
+AUTOCONF_DIRS := build/autoconf js/src/build/autoconf
+
+ifneq (,$(filter noopt,$(DEB_BUILD_OPTIONS)))
+	CONFIGURE_FLAGS += --disable-optimize
+endif
+
+ifeq ($(DEB_BUILD_ARCH),alpha)
+	MAIN_LDFLAGS += -Wl,--no-relax
+endif
 
-CONFIGURE_OPTIONS = \
-	--with-libxul-sdk=/usr/lib/xulrunner-devel-$(GRE_VERSION) \
-	--with-user-appdir=.mozilla \
-	--disable-installer \
-	--disable-strip \
-	--disable-install-strip \
-	--disable-tests \
-	--enable-extensions=default \
-	--enable-single-profile \
-	--disable-profilesharing \
-	--enable-application=browser \
-	--disable-updater \
-	--disable-elf-dynstr-gc \
-	--with-branding=debian/branding \
-	--disable-crashreporter
-
-ifneq (,$(findstring noopt,$(DEB_BUILD_OPTIONS)))
-	CONFIGURE_OPTIONS += --disable-optimize
+ifeq ($(DEB_BUILD_ARCH),ppc64)
+	CFLAGS += -mminimal-toc
 endif
 
-ifneq (,$(findstring debug,$(DEB_BUILD_OPTIONS)))
-	CONFIGURE_OPTIONS += --enable-debug
+ifneq (,$(filter debug,$(DEB_BUILD_OPTIONS)))
+	CONFIGURE_FLAGS += --enable-debug
 endif
+ifeq (,$(filter debug noopt,$(DEB_BUILD_OPTIONS)))
+	GENSYMBOLS_FLAGS := -c4
+endif
+
+ifndef CXX
+CXX := g++
+endif
+CXXFLAGS := $(CFLAGS)
+ifeq (,$(shell dpkg --compare-versions $(shell $(CXX) -dumpversion) '>=' 4.4 || echo no))
+CXXFLAGS += -std=gnu++0x
+endif
+
+export CFLAGS CXXFLAGS
+
+JS_LDFLAGS := $(MAIN_LDFLAGS)
+JS_LDFLAGS += -Wl,--version-script=$(CURDIR)/debian/symbols.filter
 
-IN_FILES := $(wildcard debian/*.in)
-PREPROCESSED_FILES := $(IN_FILES:.in=)
-$(PREPROCESSED_FILES): %: %.in
-	sed -e 's/##GRE_VERSION##/$(GRE_VERSION)/g' -e 's/##GRE_MILESTONE##/$(GRE_MILESTONE)/g' $^ > $@
+GENERATED_FILES += debian/dh/dh_xulrunner.1
+
+debian/dh/dh_xulrunner.1: debian/dh/dh_xulrunner
+	pod2man -c Debhelper -r $(GRE_VERSION) $^ > $@
+
+IN_FILES := $(wildcard debian/*.in debian/dh/*.in)
+define preprocess
+$(subst SO_VERSION,$(SO_VERSION),$(subst GRE_VERSION,$(GRE_VERSION),$(1:.in=))): $(1)
+PREPROCESSED_FILES += $(subst SO_VERSION,$(SO_VERSION),$(subst GRE_VERSION,$(GRE_VERSION),$(1:.in=)))
+endef
+$(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' $^ > $@
 
 override_dh_auto_configure:
+
+stamps/prepare-configure::
 	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 ; \
-		done ; \
+			sed -i '2!b;/^#/ i\exec "/usr/share/misc/'$$file'" "$$@"' $$dir/$$file; \
+		done; \
 	done
-	LDFLAGS="-Wl,--as-needed" \
-	CFLAGS="$(CFLAGS)" \
-	CXXFLAGS="$(CFLAGS) --std=gnu++0x" \
-	dh_auto_configure -- $(CONFIGURE_OPTIONS)
 
-override_dh_auto_clean:
-	rm -f MPL $(filter-out debian/control,$(PREPROCESSED_FILES))
-	dh_auto_clean
+stamps/configure-xulrunner:: stamps/prepare-configure
+	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
+
+	@awk -F' *# *| *$$' ' \
+	$$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; \
+			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
+	dh_auto_build --parallel --builddirectory=build-xulrunner
+	$(MAKE) -C build-xulrunner/debian/extra-stuff
+
+stamps/configure-iceweasel:: stamps/build-xulrunner
+	MOZCONFIG=$(CURDIR)/debian/iceweasel.mozconfig \
+	dh_auto_configure --builddirectory=build-iceweasel -- $(CONFIGURE_FLAGS) \
+		--with-libxul-sdk=$(CURDIR)/build-xulrunner/dist \
+		--with-system-libxul --with-system-nspr --with-system-nss
+	sed -i '/^OS_LDFLAGS/s|=|& $(MAIN_LDFLAGS)|' build-iceweasel/config/autoconf.mk
+
+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 $@
+
+override_dh_auto_build: stamps/build-iceweasel
+
+ifeq (,$(filter nocheck,$(DEB_BUILD_OPTIONS)))
+include debian/test.mk
+endif
+
+override_dh_auto_clean::
+	rm -f MPL
+	rm -f debian/libmozjs$(SO_VERSION).symbols.$(DEB_BUILD_ARCH)
+	rm -f $(GENERATED_FILES)
+	rm -rf stamps
+
+	dh_auto_clean --builddirectory=build-iceweasel
+	dh_auto_clean --builddirectory=build-xulrunner
+	find . -name "*.pyc" | xargs rm -f
 
 	for dir in $(AUTOCONF_DIRS); do \
 		for file in config.guess config.sub; do \
-			sed -i '2!b;/^exec "/ d' $$dir/$$file ; \
-		done ; \
+			sed -i '2!b;/^exec "/ d' $$dir/$$file; \
+		done; \
 	done
 
 override_dh_auto_install:
-	dh_auto_install -- installdir=/usr/lib/iceweasel
+	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)
+
+	# Fixup permissions
+	find debian/tmp/usr/share debian/tmp/usr/include -type f -print0 | xargs -0 chmod 644
+
+	# Replace some installed files by symlinks
+	cd debian/tmp/usr/lib/xulrunner-devel-$(GRE_VERSION)/sdk/lib; \
+		for f in *.so; do \
+			rm -f $$f; ln -s /usr/lib/xulrunner-$(GRE_VERSION)/$$f $$f; \
+		done
+	cd debian/tmp/usr/include/xulrunner-$(GRE_VERSION)/stable; \
+		for f in *; do \
+			rm -f ../unstable/$$f; ln -s ../stable/$$f ../unstable/$$f; \
+		done
+	cd debian/tmp/usr/share/idl/xulrunner-$(GRE_VERSION)/stable; \
+		for f in *; do \
+			rm -f ../unstable/$$f; ln -s ../stable/$$f ../unstable/$$f; \
+		done
+	ln -s ../../xulrunner-$(GRE_VERSION) debian/tmp/usr/lib/xulrunner-devel-$(GRE_VERSION)/sdk/bin
+
+	dh_auto_install --sourcedirectory=build-xulrunner/js/src -- prefix=/usr MODULE=mozjs FORCE_STATIC_LIB= SCRIPTS=
+	find debian/tmp/usr/include/mozjs -type f -printf %P\\n | while read f; do \
+		file=$$(echo debian/tmp/usr/include/xulrunner-$(GRE_VERSION)/*/$$(basename $$f)); \
+		rm $$file; \
+		ln -s /usr/include/mozjs/$$f $$file; \
+	done
+	for f in /usr/include/nspr/* /usr/include/nss/*; do \
+		ln -s $$f debian/tmp/usr/include/xulrunner-$(GRE_VERSION)/stable/$$(basename $$f); \
+		ln -s $$f debian/tmp/usr/include/xulrunner-$(GRE_VERSION)/unstable/$$(basename $$f); \
+	done
+	for h in $$(grep -l -r EXPORTS build-xulrunner/media | grep Makefile$ | \
+		while read f; do $(MAKE) --no-print-directory -C $$(dirname $$f) echo-variable-EXPORTS; done); do \
+		rm -f debian/tmp/usr/include/xulrunner-$(GRE_VERSION)/unstable/$$h; \
+	done
+
+	rm debian/tmp/usr/lib/xulrunner-$(GRE_VERSION)/libmozjs.so
+	mv debian/tmp/usr/bin/js debian/tmp/usr/bin/smjs
+
+	sed -i '/^Cflags/ s,$${includedir}/stable,/usr/include/mozjs,' debian/tmp/usr/lib/pkgconfig/mozilla-js.pc
+
+	dh_auto_install --builddirectory=build-iceweasel -- installdir=$(LIB_DIR)
 	chmod 755 debian/iceweasel-xremote-client
 
-override_dh_install:
-	dh_install
+MPL: LICENSE
+	cp -f $< $@
+
+override_dh_installdocs: MPL
+	dh_installdocs -A $^
+
+override_dh_install: debian/dh/dh_xulrunner debian/noinstall
+	awk '{print "debian/tmp/" $$1 }' < debian/noinstall | xargs rm -r
+	dh_install --fail-missing
 #Install helpers
 	install -m 755 debian/iceweasel-runner \
 		debian/iceweasel/$(LIB_DIR)/iceweasel
 
 # Install icons
 	install -d -m 755 debian/iceweasel/usr/share/icons/hicolor/16x16/apps
-	install -m 644 debian/branding/default16.png \
+	install -m 644 build-iceweasel/debian/branding/default16.png \
 		debian/iceweasel/usr/share/icons/hicolor/16x16/apps/iceweasel.png
 	install -d -m 755 debian/iceweasel/usr/share/icons/hicolor/32x32/apps
-	install -m 644 debian/branding/default32.png \
+	install -m 644 build-iceweasel/debian/branding/default32.png \
 		debian/iceweasel/usr/share/icons/hicolor/32x32/apps/iceweasel.png
 	install -d -m 755 debian/iceweasel/usr/share/icons/hicolor/64x64/apps
-	install -m 644 debian/branding/default64.png \
+	install -m 644 build-iceweasel/debian/branding/default64.png \
 		debian/iceweasel/usr/share/icons/hicolor/64x64/apps/iceweasel.png
 	install -d -m 755 debian/iceweasel/usr/share/icons/hicolor/scalable/apps
 	install -m 644 debian/branding/iceweasel_icon.svg \
@@ -95,23 +225,37 @@ override_dh_install:
 	echo "pref(\"general.useragent.extra.firefoxComment\",\"(like Firefox/$(UPSTREAM_VERSION))\");" \
 		>> debian/iceweasel/$(SHARE_DIR)/defaults/preferences/vendor.js
 
-	sed -i 's/\(MinVersion=$(GRE_VERSION)\).*/\1/;s/\(MaxVersion=$(GRE_VERSION)\).*/\1.*/' debian/iceweasel/usr/lib/iceweasel/application.ini
-
-MPL: LICENSE
-	cp -f $< $@
+	sed -i 's/\(MinVersion=$(GRE_VERSION)\).*/\1/;s/\(MaxVersion=$(GRE_VERSION)\).*/\1.*/' debian/iceweasel/$(LIB_DIR)/application.ini
 
-override_dh_installdocs: MPL
-	dh_installdocs -A MPL
+	# Make sure dh_xulrunner is able to spot the current XPCOM standalone glue.
+	perl $< -pxulrunner-$(GRE_VERSION) --no-act -v 2>&1 | grep -q "..*"
 
 override_dh_strip:
-	dh_strip -a --dbg-package=iceweasel-dbg
+	dh_strip -a -Niceweasel -Nlibmozjs$(SO_VERSION) -Nspidermonkey-bin --dbg-package=xulrunner-$(GRE_VERSION)-dbg
+	dh_strip -piceweasel --dbg-package=iceweasel-dbg
+	dh_strip -plibmozjs$(SO_VERSION) --dbg-package=libmozjs$(SO_VERSION)-dbg
+	dh_strip -pspidermonkey-bin
+
+override_dh_makeshlibs:
+	if [ "`$(MAKE) --no-print-directory -C build-xulrunner/js/src echo-variable-ENABLE_JIT`" = 1 ]; then \
+		echo '#include "libmozjs$(SO_VERSION).symbols.jit"' > debian/libmozjs$(SO_VERSION).symbols.$(DEB_BUILD_ARCH); \
+	fi
+	dh_makeshlibs -plibmozjs$(SO_VERSION) -V 'libmozjs$(SO_VERSION) (>= 1.9.1.4)' -- $(GENSYMBOLS_FLAGS)
 
 override_dh_shlibdeps:
-	dh_shlibdeps -a -l /usr/lib/xulrunner-$(GRE_VERSION)
+	dh_shlibdeps -a -l$(CURDIR)/debian/tmp/usr/lib/xulrunner-$(GRE_VERSION) -Xlibmozgnome -Xlibnkgnomevfs -Xlibdbusservice
+	LD_LIBRARY_PATH=$(CURDIR)/debian/tmp/usr/lib/xulrunner-$(GRE_VERSION) dpkg-shlibdeps -Tdebian/xulrunner-$(GRE_VERSION).substvars -dDepends -pgnome $(foreach lib,dbusservice mozgnome nkgnomevfs,debian/xulrunner-$(GRE_VERSION)/usr/lib/xulrunner-$(GRE_VERSION)/components/lib$(lib).so)
 
-install binary binary-arch binary-indep: $(PREPROCESSED_FILES)
+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')
+
+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
+.PHONY: build clean binary-indep binary-arch binary install test $(TESTS) xpcshell-tests-skip
+
+.NOTPARALLEL:
+endif


More information about the pkg-mozilla-maintainers mailing list