1 [[!meta title="Releasing Iceweasel + Torbrowser patches"]]
8 * Clone the Tor browser
9 [[Git repository|contribute/git#other-repositories]] if you do not
12 * Add (and fetch from) a Git remote for the Debian iceweasel packaging
15 git remote add -f debian git://git.debian.org/git/pkg-mozilla/iceweasel.git
17 * Export the new upstream release to the environment of the one shell
18 or three that will be used:
20 export VERSION=17.0.9esr
22 2. Was Iceweasel updated?
23 =========================
25 It might have been updated in one of these sources:
27 * branch `esr/master` in `git://git.debian.org/git/pkg-mozilla/iceweasel.git`
28 * <http://mozilla.debian.net/pool/iceweasel-esr/i/iceweasel/>
30 **If** it was updated, then skip to [[New Iceweasel release|iceweasel#new-iceweasel-release]].
31 **Else**, skip to [[New Firefox release|iceweasel#new-firefox-release]].
33 <a id="new-firefox-release"></a>
35 3. New Firefox release
36 ======================
38 If Iceweasel was not updated to match the new Firefox release we want,
39 a bit more work is needed.
41 Note that usually, we're doing these steps (usually on Sunday or
42 Monday) *before* the new ESR was officially released (which usually
43 happens on Tuesday). Mozilla make the source available on previous
44 Friday or Saturday, so that downstreams (such as us!) can get their
45 stuff ready in time for the security announce.
47 * Download the Firefox tarball and detached signature from
48 <https://ftp.mozilla.org/pub/mozilla.org/firefox/releases/VERSION/source/>
49 (`VERSION` is the version we want to build, that is something like
51 If it's not ready there yet, look at
52 <https://ftp.mozilla.org/pub/mozilla.org/firefox/candidates/VERSION-candidates/>
53 instead: Mozilla now only moves the tarballs to the `releases` directory after
54 it has passed their internal QA.
55 * Check the signature.
56 * Put the tarball in the parent directory of your Iceweasel Git repository.
57 * Extract the tarball.
58 * `cd` into the extracted directory.
59 * Copy the `debian/` directory from our previous package into the new
60 upstream source directory.
61 * Add a `debian/changelog` entry matching the new
62 upstream version. Use 0 for the Debian packaging version, e.g.
63 `17.0.5esr-0`, to leave room for the official packaging that we will
64 want to merge when it's out:
66 dch -v ${VERSION}-0 "New upstream release."
68 * If you had to download a *candidate* version above, patch
69 `debian/upstream.mk` so that it downloads stuff from the same place,
72 --- a/debian/upstream.mk
73 +++ b/debian/upstream.mk
74 @@ -89,12 +89,12 @@ ifndef L10N_CHANNEL
75 L10N_CHANNEL := $(SOURCE_CHANNEL)
78 -BASE_URL = ftp://ftp.mozilla.org/pub/mozilla.org/$(PRODUCT_NAME)/$(SOURCE_TYPE)
79 +BASE_URL = ftp://ftp.mozilla.org/pub/mozilla.org/$(PRODUCT_NAME)/candidates
81 L10N_FILTER = awk '(NF == 1 || /linux/) && $$1 != "en-US" { print $$1 }'
82 $(call lazy,L10N_LANGS,$$(shell $$(L10N_FILTER) $(PRODUCT)/locales/shipped-locales))
83 ifeq ($(SOURCE_TYPE),releases)
84 -SOURCE_URL = $(BASE_URL)/$(SOURCE_VERSION)/source/$(PRODUCT_NAME)-$(SOURCE_VERSION).source.tar.bz2
85 +SOURCE_URL = $(BASE_URL)/$(SOURCE_VERSION)-candidates/build1/source/$(PRODUCT_NAME)-$(SOURCE_VERSION).source.tar.bz2
86 SOURCE_REV = $(call uc,$(PRODUCT_NAME))_$(subst .,_,$(SOURCE_VERSION))_RELEASE
87 L10N_REV = $(SOURCE_REV)
88 SOURCE_REPO = http://hg.mozilla.org/releases/$(SOURCE_CHANNEL)
90 **Beware**: make sure to replace `build1` with the name of the
91 directory you downloaded the upstream candidate tarball above.
93 * Download and repack the other tarballs:
95 make -f debian/rules download
97 * `cd` into our Iceweasel Git directory.
98 * Checkout the `tails/master` branch.
99 * Unapply all quilt patches and commit:
102 git add . && git reset HEAD .pc && git commit -a -m 'Unapply all quilt patches.'
104 * Get yourself a new upstream branch:
106 git branch -D upstream && \
107 git branch upstream tails/master
109 * Trick the tarball importer to import the correct version:
111 cp ../mozilla-esr24/browser/config/version.txt browser/config/ && \
112 cp ../mozilla-esr24/debian/changelog debian/
114 * Import the new upstream release into the `upstream` branch:
116 make -f debian/rules import
118 * Merge the import commit into `tails/master`:
120 git reset --hard && git merge upstream
122 * Get the `debian` directory back:
124 git checkout HEAD^ -- debian && \
125 git commit -m 'Get Debian packaging directory back.'
127 * Don't ignore `.mozconfig`'s:
129 grep -v -F '/.mozconfig*' .gitignore | sponge .gitignore && \
130 git commit -m "Don't ignore .mozconfig's." .gitignore
132 * Cleanup quilt status:
136 * Apply all quilt patches:
140 It might be that the last patch (`configure.patch`) fails. Ignore it
145 git add . && git reset HEAD .pc && git commit -a -m 'Apply all quilt patches.'
147 <a id="new-iceweasel-release"></a>
149 4. New Iceweasel release
150 =========================
152 Skip this entire stage if you imported a new Firefox release.
154 The way to proceed is different depending on whether Debian's
155 iceweasel was pushed to it yet, or not.
157 If Debian's iceweasel was pushed to Git already
158 -----------------------------------------------
160 * Retrieve the update from the iceweasel Git repository and verify the
161 Git tag you want to import, e.g.
163 git fetch debian && git tag -v debian/17.0.8esr-1
165 * Checkout our `tails/master` branch.
167 * Unapply all Torbrowser patches:
168 - If quilt knows they are applied (`quilt applied` will tell you),
169 then use `quilt pop` as many times as needed.
170 - Else, some manual care is needed so that quilt internal state
171 matches the actual state of the source tree. We need to manually
172 unapply all quilt patches, then reapply them all:
174 for p in $(tac debian/patches/series) ; do
175 patch -p1 -R < "debian/patches/$p"
176 done && quilt push -a
178 ... and then use `quilt pop` as many times as needed to unapply
179 all Torbrowser patches.
181 * `git add` the new files and the modified ones
183 * `git rm` the deleted files
187 git commit -m 'Remove Torbrowser patches.'
189 * Merge the tag, e.g.
191 git merge debian/17.0.8esr-1
193 * Verify with that `tails/master` is in the same state as Debian's
196 git diff --stat debian/17.0.8esr-1..tails/master
198 All expected differences should be:
199 * files modified: `.gitignore`,
200 `debian/{changelog,rules,control,control.in}`,
201 `debian/{browser.mozconfig,xulrunner.mozconfig.in}`
202 * files added: `.mozconfig*`, `debian/tails.*.mozconfig`,
203 `debian/patches/series`, and the Torbrowser patches.
205 If Debian's iceweasel was not pushed to Git yet
206 -----------------------------------------------
208 Then, we have to import the source package into Git ourselves, and
209 merge from Debian's Vcs-Git later.
211 * Download, verify and extract the new iceweasel source package with dget.
213 * Checkout our `tails/master` branch.
215 * Unapply all quilt patches and commit:
219 * `git rm` the deleted files
221 * `git add` the new files and the modified ones
225 git commit -m 'Remove all quilt patches.'
227 * Overwrite the files in the Git checkout with the new ones.
228 Assuming the new extracted iceweasel package is in
229 `iceweasel-17.0.2esr`, and our iceweasel Git repository checkout is
232 rsync --stats -a --exclude=.git --delete iceweasel-17.0.2esr/ git/
234 * `git rm` the deleted files
238 * Add other added or modified files *but* `.pc`.
242 git commit -m "Import $(head -n 1 debian/changelog | sed -e 's,).*,),')"
244 * Verify with `diff` that the current state of the `tails/master` is
245 exactly the same as Debian's iceweasel source package one:
247 diff -Naur --exclude=.git iceweasel-17.0.2esr/ git/
249 * Bring our changes back:
250 * files modified: `.gitignore`,
251 `debian/{changelog,rules,control,control.in}`,
252 `debian/{browser.mozconfig,xulrunner.mozconfig.in}`
253 * files added: `.mozconfig*`, `debian/tails.*.mozconfig`,
254 `debian/patches/series`, and the Torbrowser patches.
256 5. Update Torbrowser patches
257 ============================
259 First, check if the Torbrowser patches were updated since the last
260 time we imported them (that's why we always record in
261 `debian/changelog` the TorBrowser Git commit we are importing from).
263 **If** the Torbrowser patches were not updated, then just apply them
266 quilt push -a && git commit -a -m 'Apply Torbrowser patches.'
268 ... then skip this entire stage.
270 **Else**, proceed with the following steps.
272 * Make sure all quilt patches are applied.
273 * Unapply all Torbrowser patches: use `quilt pop` as many times as
275 * Revert our changes (with `--no-commit`) to
276 `debian/patches/configure.patch` if needed, and deapply it:
278 cat debian/patches/configure.patch | patch -p1 --reverse
280 * `quilt delete` the `configure.patch` if it exists.
282 * Remove all Torbrowser patches from the series:
284 quilt unapplied | grep --color=never '^torbrowser/' | xargs -n 1 quilt delete
286 * Remove Torbrowser patches from Git:
288 git rm -r debian/patches/torbrowser/
292 git commit -a -m 'Remove Torbrowser patches.'
294 * Import the latest TorBrowser patches:
296 - Ensure you have Mike Perry's latest stuff available:
298 git remote add -f mikeperry https://git.torproject.org/user/mikeperry/tor-browser.git
299 git remote add -f ttp https://git.torproject.org/tor-browser.git
301 - Find the most recent commit in ttp/tor-browser-24.2.0esr-1
302 that is an import from Mozilla (see e.g. 5175d069); save its ID:
304 export LAST_MOZILLA_COMMIT=XXX
306 - Export the Torbrowser patches:
308 TORBROWSER_PATCHES_DIR=$(mktemp -d)
309 git format-patch -o "$TORBROWSER_PATCHES_DIR" \
310 "$LAST_MOZILLA_COMMIT..ttp/tor-browser-$VERSION-3.x-1"
312 - Remove from $TORBROWSER_PATCHES_DIR the patches we don't want.
313 See `debian/changelog` for the - list of patches skipped last
314 time, see the TorBrowser Git log to make your opinion about new or
315 updated patches, use common sense. Take note of your decisions and
316 its rationale, you will need it later.
318 - Import the Torbrowser patches:
320 for patch in $(\ls --reverse ${TORBROWSER_PATCHES_DIR}/*.patch) ; do
321 p=$(basename "$patch")
322 quilt import -P "torbrowser/$p" "$patch"
324 git add debian/patches/torbrowser debian/patches/series && \
325 TORBROWSER_COMMIT=$(git rev-parse ttp/tor-browser-$VERSION-3.x-1)
326 git commit -m "Import Torbrowser patches at commit ${TORBROWSER_COMMIT}."
328 * Apply Torbrowser patches:
330 quilt push -a && git add . && git reset HEAD .pc && git commit -a -m 'Apply Torbrowser patches.'
332 * Update `debian/tails.*.mozconfig`:
333 - copy all `ac_add_options` lines from `.mozconfig` into the *Tor
334 Browser's options* section in `debian/tails.common.mozconfig`,
335 *but* the ones that break the xulrunner build, that go into *Tor
336 Browser's options specific to the browser component* section in
337 `debian/tails.browser.mozconfig` instead
338 - review the changes to these settings
339 - if needed, update the `debian/tails.common.mozconfig`'s *Override
340 Tor Browser's options* section
344 git push origin tails/master && git push --tags
349 Update debian/changelog
350 -----------------------
352 * set a version such as `17.0.5esr-0+tails1`, e.g.
354 dch -v "${VERSION}-0+tails1"
356 * list our changes, especially the TorBrowser commit at which the
357 patches were imported, and the ones we skipped
358 * set distribution to unstable
361 git commit debian/changelog \
362 -m "$(head -n 1 debian/changelog | sed -e 's,).*,),')"
367 DEB_VERSION=$(dpkg-parsechangelog -SVersion)
368 git tag -s -m "$(head -n 1 debian/changelog | sed -e 's,).*,),')" "debian/${DEB_VERSION}"
370 Clean up the source tree
371 ------------------------
373 git clean -fdx -e /.pc/
378 If you have no available non-Tails setup to comfortably test these
379 packages, then skip this step.
381 * Build for unstable and the architecture you can test on (most likely
382 amd64), e.g. using our [[contribute/Debian_package_builder]].
383 **Note:** if building locally in a ramdisk, it needs to be at least
385 * Copy `browser/app/profile/000-tor-browser.js` into
386 `/etc/iceweasel/pref/` on the test system.
387 * Install and test the resulting packages.
389 Build for wheezy-backports
390 --------------------------
392 * Checkout the `tails/wheezy` branch and merge the tag:
394 git checkout tails/wheezy && git merge "debian/${DEB_VERSION}"
396 * Add a wheezy-backport changelog entry:
404 git commit debian/changelog \
405 -m "$(head -n 1 debian/changelog | sed -e 's,).*,),')"
409 git tag -s -m "$(head -n 1 debian/changelog | sed -e 's,).*,),')" \
410 "debian/$(dpkg-parsechangelog -SVersion | sed -e 's,~,_,')"
412 * Build for wheezy-backports and i386, e.g. using our
413 [[contribute/Debian_package_builder]]. You may also do it yourself
414 using `pbuilder`. Note that this repo is *not* adapted to be built
415 with `git-buildpackage` or `git-pbuilder`.
416 * Integrate these debs into your apt-cacher cache. That's one cp to
417 `/var/cache/apt-cacher-ng/_import/` away, + 1 click in the
419 * Test the resulting packages in Tails.
420 * Make sure the `.orig.*` tarballs are included in the `.changes`
421 file. FIXME: check if that's needed, or done automatically by the
423 * Upload the resulting packages to the relevant suite of our
424 [[contribute/APT repository]].
425 * Merge this APT suite where you need it: generally, that's `devel`,
426 `experimental`, one of `stable` or `testing`, and maybe
430 git push origin tails/wheezy && git push --tags
432 Import bundled preferences
433 --------------------------
435 * Copy `browser/app/profile/000-tor-browser.js` from the tag the
436 Wheezy backport was built from, into
437 `config/chroot_local-includes/etc/iceweasel/pref/`.
438 * Commit this to the branch that is being used to prepare the release:
439 ideally, a topic branch that will be reviewed and merged; in
440 practice, more likely this will be `stable` or `testing`.
442 7. Potential problems (and solutions)
443 =====================================
445 Problems with ./configure
446 -------------------------
448 E.g. `configure.patch` does not apply, or the build fails since
449 `{js/src/,}configure.in` was modified but `{js/src/,}configure` was
452 In a nutshell, the solution is to:
454 1. Make sure the patches that modify `{js/src/,}configure.in` are
455 applied (this is the case after a `quilt push -a`, that is during
456 most of the steps documented above).
458 1. Update `{js/src/,}configure`:
460 sudo apt-get install autoconf2.13
461 make -f client.mk configure
463 The `make` command may fail due to missing dependencies. We don't
464 care, as long as `{js/src/,}configure` have been refreshed.
466 1. Replace `configure.patch` with the diff between the original and
467 updated version of `{js/src/,}configure`:
469 configure_diff=$(mktemp) && \
470 git diff configure js/src/configure > "$configure_diff" && \
471 git reset --hard && \
472 git clean -fdx -e /.pc/ && \
473 quilt import -f -P configure.patch "$configure_diff" && \
474 git commit debian/patches -m "Refresh configure.patch." && \
476 git commit -a -m 'Apply configure.patch.'
478 Note that `configure.patch` must always be the *last* patch in the
479 quilt series file, after the TorBrowser ones.