summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--README7
-rw-r--r--debian/changelog20
-rw-r--r--debian/control2
-rw-r--r--src/Makefile1
-rw-r--r--src/firefox-3.0-full.mk.in1
-rw-r--r--src/firefox-3.0.mk.in1
-rw-r--r--src/firefox-4.0.mk.in69
-rw-r--r--src/mozclient.mk.in82
8 files changed, 168 insertions, 15 deletions
diff --git a/README b/README
index bd93796..4b1dcb4 100644
--- a/README
+++ b/README
@@ -61,9 +61,11 @@ They contain the following parameters:
- MOZCLIENT_TARGET (mandatory): a label, usually 'project-orig'
- MOZCLIENT_APPNAME (mandatory): package name
- MOZCLIENT_MODULES (optional): list of modules/directories for direct checkout
-- MOZCLIENT_PROJECT (mandatory): CVS project name. If $(NULL), then
+- MOZCLIENT_VCS (optional): VCS (hg, git, cvs, svn..). (default: cvs)
+- MOZCLIENT_PROJECT (mandatory): VCS project name. If $(NULL), then
$(MOZCLIENT_MODULES) becomes mandatory
-- MOZCLIENT_BRANCH (optional): CVS branch name
+- MOZCLIENT_BRANCH (optional): VCS branch name
+- MOZCLIENT_POSTCOCMD (optional): a shell command that is executed after checkout
- MOZCLIENT_FILE (mandatory): source file containing the version
- MOZCLIENT_GETVERSION (mandatory): how to transform the version
- MOZCLIENT_URL (mandatory): an URL (usually on Bonsai) listing commits
@@ -71,6 +73,7 @@ They contain the following parameters:
- MOZCLIENT_EMBEDDED (optional): create an embedded tarball (default: 0)
- MOZCLIENT_WANTMOZDIR (optional): should the root dir be 'mozilla'?
(default: 0 unless MOZCLIENT_EMBEDDED=1)
+- MOZCLIENT_WANTPATCH (optional): should we use the patch system? (default: 0)
Example with firefox-3.0:
diff --git a/debian/changelog b/debian/changelog
index e4498c4..fdfc006 100644
--- a/debian/changelog
+++ b/debian/changelog
@@ -13,6 +13,26 @@ mozilla-devscripts (0.08) UNRELEASED; urgency=low
Preserve legacy mozclient-status
- update src/mozclient.mk.in
- update README
+ + add support for Mercurial (hg) in addition to cvs.
+ Add MOZCLIENT_VCS variable (default to cvs). Add mercurial to Depends.
+ The preferred way to fetch a particular hg snapshot is to use a revision
+ number, it's better than a date.
+ - update deban/control
+ - update src/mozclient.mk.in
+ - update README
+ + make the mozclient patch system optional by introducing a new variable
+ called MOZCLIENT_WANTPATCH. Set it only for firefox 3.
+ - update src/firefox-3.0-full.mk.in
+ - update src/firefox-3.0.mk.in
+ - update src/mozclient.mk.in
+ + add project firefox-4.0 using Mercurial. It needs python (>= 2.4) so add
+ python | python2.4 to Depends. It also needs a post checkout script to
+ fetch dependencies (nspr/nss/tamarin) so introduce a new variable called
+ MOZCLIENT_POSTCOCMD. We now use hgweb instead of bonsai to get revision
+ ids and dates.
+ - update deban/control
+ - add src/firefox-4.0.mk.in
+ - update src/Makefile
-- Fabien Tassin <fta@sofaraway.org> Sat, 19 Apr 2008 14:43:47 +0200
diff --git a/debian/control b/debian/control
index 18e1a6c..3812049 100644
--- a/debian/control
+++ b/debian/control
@@ -9,7 +9,7 @@ Vcs-Bzr: https://code.launchpad.net/~mozillateam/mozclient/mozclient.dev
Package: mozilla-devscripts
Architecture: all
-Depends: cvs, wget, quilt, libxml-xpath-perl, unzip, dpkg-dev, fakeroot
+Depends: cvs, mercurial, wget, quilt, libxml-xpath-perl, unzip, dpkg-dev, fakeroot, python | python2.4
Description: Collection of dev scripts used by Ubuntu Mozilla packages
This package contains mozilla-devscripts, a collection of scripts
based on Makefile inheritance which provides targets usable by Mozilla
diff --git a/src/Makefile b/src/Makefile
index 94c5beb..8ed101b 100644
--- a/src/Makefile
+++ b/src/Makefile
@@ -24,6 +24,7 @@ DATADIR = $(PREFIX)/share/mozilla-devscripts
mk_files = \
firefox-3.0.mk \
firefox-3.0-full.mk \
+ firefox-4.0.mk \
lightning-sunbird.mk \
nspr.mk \
nss.mk \
diff --git a/src/firefox-3.0-full.mk.in b/src/firefox-3.0-full.mk.in
index 5b4e39e..0debd7d 100644
--- a/src/firefox-3.0-full.mk.in
+++ b/src/firefox-3.0-full.mk.in
@@ -26,6 +26,7 @@ MOZCLIENT_URL := 'http://bonsai.mozilla.org/cvsquery.cgi?treeid=default&m
MOZCLIENT_GETDATE = wget -O - -q --read-timeout=10 --user-agent='' --tries=3 $(MOZCLIENT_URL) 2> /dev/null | grep "href='http://webtools" | head -1 | tr '<>' '@' | cut -d@ -f5 | tr -d ':-' | sed -e 's/&nbsp;/t/'
MOZCLIENT_EMBEDDED := 1
MOZCLIENT_WANTMOZDIR := 1
+MOZCLIENT_WANTPATCH := 1
include mozclient.mk.in
diff --git a/src/firefox-3.0.mk.in b/src/firefox-3.0.mk.in
index a297d0c..9730f55 100644
--- a/src/firefox-3.0.mk.in
+++ b/src/firefox-3.0.mk.in
@@ -26,6 +26,7 @@ MOZCLIENT_URL := 'http://bonsai.mozilla.org/cvsquery.cgi?treeid=default&m
MOZCLIENT_GETDATE = wget -O - -q --read-timeout=10 --user-agent='' --tries=3 $(MOZCLIENT_URL) 2> /dev/null | grep "href='http://webtools" | head -1 | tr '<>' '@' | cut -d@ -f5 | tr -d ':-' | sed -e 's/&nbsp;/t/'
MOZCLIENT_EMBEDDED := 1
MOZCLIENT_WANTMOZDIR := 1
+MOZCLIENT_WANTPATCH := 1
include mozclient.mk.in
diff --git a/src/firefox-4.0.mk.in b/src/firefox-4.0.mk.in
new file mode 100644
index 0000000..cb71924
--- /dev/null
+++ b/src/firefox-4.0.mk.in
@@ -0,0 +1,69 @@
+# -*- mode: makefile; coding: utf-8 -*-
+
+# Copyright (c) 2008 Fabien Tassin <fta@sofaraway.org>
+# Description: Project firefox 4.0
+#
+# This program is free software; you can redistribute it and/or
+# modify it under the terms of the GNU General Public License as
+# published by the Free Software Foundation; either version 2, or (at
+# your option) any later version.
+#
+# This program is distributed in the hope that it will be useful, but
+# WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+# General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License along
+# with this program; if not, write to the Free Software Foundation, Inc.,
+# 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
+
+MOZCLIENT_TARGET := firefox-4.0-orig
+MOZCLIENT_APPNAME := firefox-4.0
+MOZCLIENT_PROJECT := mozilla-central
+MOZCLIENT_FILE := mozilla/browser/config/version.txt
+MOZCLIENT_GETVERSION := sed -e 's/pre//; s/\([ab]\)\([0-9]*\)/~\1\2/' $(MOZCLIENT_FILE)
+MOZCLIENT_VCS := hg
+MOZCLIENT_POSTCOCMD := cd mozilla && python client.py checkout
+MOZCLIENT_URL := http://hg.mozilla.org/index.cgi/$(MOZCLIENT_PROJECT)/log
+MOZCLIENT_GETDATE = wget -O - -q --read-timeout=10 --user-agent='' --tries=3 $(MOZCLIENT_URL) 2> /dev/null | \
+ grep cite | head -1 | sed -e 's,.*</cite>,,' | \
+ perl -e '$$m = { "Jan" => 1, "Feb" => 2, "Mar" => 3, "Apr" => 4, "May" => 5, "Jun" => 6, \
+ "Jul" => 7, "Aug" => 8, "Sep" => 9, "Oct" => 10, "Nov" => 11, "Dec" => 12 } ; $$a = <>; \
+ $$a =~ m/^ - \S+,\s+(\d+) (\S+) (\d+) \S+ \S+ - rev (\d+)/ && do { \
+ printf "%d~%04d%02d%02d\n", $$4, $$3, $$$$m{$$2}, $$1 }; '
+MOZCLIENT_EMBEDDED := 1
+MOZCLIENT_WANTMOZDIR := 1
+
+include mozclient.mk.in
+
+COMPARE_FILTER_PRE_IN := sed \
+ -e 's,foo,bar,' \
+ $(NULL)
+
+COMPARE_FILTER_PRE_OUT := sed \
+ -e 's,^usr/lib/firefox-4.0[^/]*/,,' \
+ $(NULL)
+
+COMPARE_FILTER_IN := sed \
+ -e 's,^usr/lib/firefox-4.0[^/]*/searchplugins,usr/lib/firefox-addons/searchplugins,' \
+ -e 's,^usr/lib/firefox-4.0[^/]*/extensions/inspector@mozilla.org/.*,,' \
+ -e 's,^usr/lib/firefox-4.0[^/]*/extensions,usr/lib/xulrunner-addons/extensions,' \
+ -e 's,^usr/lib/firefox-4.0[^/]*/defaults/profile,etc/firefox-4.0/profile,' \
+ -e 's,^usr/lib/firefox-4.0[^/]*/\(old-homepage-default.properties\|README.txt\|removed-files\),,' \
+ -e 's,^usr/lib/firefox-4.0[^/]*/.autoreg,,' \
+ -e 's,^etc/firefox-4.0[^/]*/.autoreg,,' \
+ $(NULL)
+
+COMPARE_FILTER_OUT := sed \
+ -e 's,^DEBIAN/.*,,' \
+ -e 's,^usr/lib/debug/.*,,' \
+ -e 's,^usr/share/doc/.*,,' \
+ -e 's,^usr/share/menu/.*,,' \
+ -e 's,^usr/share/applications/.*,,' \
+ -e 's,^usr/share/bug/firefox-4.0/presubj,,' \
+ -e 's,^etc/firefox-4.0/\(firefoxrc\|pref/firefox.js\),,' \
+ -e 's,^usr/lib/firefox-addons/searchplugins/\(debsearch\|wikipedia\).\(gif\|src\),,' \
+ -e 's,^usr/lib/firefox-4.0[^/]*/\(firefox-4.0-restart-required.update-notifier\|firefox.cfg\|firefox.sh\|ffox-4-beta-profile-migration-dialog\),,' \
+ $(NULL)
+
+include compare.mk.in
diff --git a/src/mozclient.mk.in b/src/mozclient.mk.in
index 0e551b1..e7db88a 100644
--- a/src/mozclient.mk.in
+++ b/src/mozclient.mk.in
@@ -40,9 +40,11 @@
# - MOZCLIENT_TARGET (mandatory): a label, usually 'project-orig'
# - MOZCLIENT_APPNAME (mandatory): package name
# - MOZCLIENT_MODULES (optional): list of modules/directories for direct checkout
-# - MOZCLIENT_PROJECT (mandatory): CVS project name. If $(NULL), then
+# - MOZCLIENT_VCS (optional): VCS (hg, git, cvs, svn..). (default: cvs)
+# - MOZCLIENT_PROJECT (mandatory): VCS project name. If $(NULL), then
#  $(MOZCLIENT_MODULES) becomes mandatory
-# - MOZCLIENT_BRANCH (optional): CVS branch name
+# - MOZCLIENT_BRANCH (optional): VCS branch name
+# - MOZCLIENT_POSTCOCMD (optional): a shell command that is executed after checkout
# - MOZCLIENT_FILE (mandatory): source file containing the version
# - MOZCLIENT_GETVERSION (mandatory): how to transform the version
# - MOZCLIENT_URL (mandatory): an URL (usually on Bonsai) listing commits
@@ -50,6 +52,7 @@
# - MOZCLIENT_EMBEDDED (optional): create an embedded tarball (default: 0)
# - MOZCLIENT_WANTMOZDIR (optional): should the root dir be 'mozilla'?
# (default: 0 unless MOZCLIENT_EMBEDDED=1)
+# - MOZCLIENT_WANTPATCH (optional): should we use the patch system? (default: 0)
# Example with firefox-3.0:
#
@@ -78,16 +81,29 @@
MOZ_CLIENT = mozilla/client.mk
MOZCLIENT_CVS_LOC = :pserver:anonymous@cvs-mirror.mozilla.org:/cvsroot
+MOZCLIENT_HG_LOC = http://hg.mozilla.org/
MOZCLIENT_STAMP ?= stamped
MOZCLIENT_TMP := mozclient-tmp
+MOZCLIENT_VCS ?= cvs
+
MOZCLIENT_PATCHES := ../patches
MOZCLIENT_EXCLUDE_SCRIPT := ../../remove.binonly.sh
NOBINONLY := nobinonly
+ifeq ($(MOZCLIENT_VCS),cvs)
TAR_EXCLUDE := --exclude=CVS --exclude=.cvsignore
+else
+ifeq ($(MOZCLIENT_VCS),hg)
+TAR_EXCLUDE := --exclude=.hg
+else
+TAR_EXCLUDE := $(NULL)
+endif
+endif
+
DATE_FILTER := sed -e 's,\(....\)\(..\)\(..\)[rt]\(..\)\(..\),\1/\2/\3 \4:\5 PST,'
+REVISION_FILTER := sed -e 's,^\([0-9]*\).*,\1,'
ifdef DEBIAN_TAG
DEBIAN_DATE = $(NULL)
@@ -109,6 +125,7 @@ endif
mozclient-deps:
@if [ ! -f /usr/bin/cvs ] ; then echo "**ERROR** Depends on missing cvs. Abort"; exit 1; fi
+ @if [ ! -f /usr/bin/hg ] ; then echo "**ERROR** Depends on missing mercurial. Abort"; exit 1; fi
@if [ ! -f /usr/bin/quilt ] ; then echo "**ERROR** Depends on missing quilt. Abort"; exit 1; fi
@if [ ! -f /usr/bin/wget ] ; then echo "**ERROR** Depends on missing wget. Abort"; exit 1; fi
@@ -123,15 +140,21 @@ else
$(MOZ_CLIENT): MOZCLIENT_TBRANCH = $(NULL)
endif
$(MOZ_CLIENT): mozclient-deps mozclient-dir
+ifeq ($(MOZCLIENT_VCS),cvs)
cd $(MOZCLIENT_TMP) && cvs -d $(MOZCLIENT_CVS_LOC) co $(MOZCLIENT_TBRANCH) $(DEBIAN_CO_DATE) $(DEBIAN_CO_TAG) $@
+endif
mozclient-client: $(MOZCLIENT_TMP)/$(MOZCLIENT_STAMP)
# List all tags
-list-tags: mozclient-status
-mozclient-status: mozclient-deps mozclient-dir
+mozclient-status: list-tags
+list-tags: mozclient-deps mozclient-dir
+ifeq ($(MOZCLIENT_VCS),cvs)
cd $(MOZCLIENT_TMP) && cvs -d $(MOZCLIENT_CVS_LOC) co $(MOZCLIENT_FILE)
cd $(MOZCLIENT_TMP)/mozilla && cvs status -v $(subst mozilla/,,$(MOZCLIENT_FILE))
+else
+ $(error '$@' not supported for '$(MOZCLIENT_VCS)' yet)
+endif
rm -rf $(MOZCLIENT_TMP)
# Patch
@@ -139,10 +162,12 @@ mozclient-status: mozclient-deps mozclient-dir
mozclient-patch: $(MOZCLIENT_TMP)/$(MOZCLIENT_STAMP)
$(MOZCLIENT_TMP)/$(MOZCLIENT_STAMP): $(MOZ_CLIENT)
+ifneq (,$(MOZCLIENT_WANTPATCH))
ifeq (,$(MOZCLIENT_BRANCH))
if [ ! -L $(MOZCLIENT_TMP)/patches ] ; then ln -s $(MOZCLIENT_PATCHES) $(MOZCLIENT_TMP)/patches ; fi
cd $(MOZCLIENT_TMP) && quilt --quiltrc /dev/null push -a || test $$? = 2
endif
+endif
touch $(MOZCLIENT_TMP)/$(MOZCLIENT_STAMP)
# Unpatch
@@ -163,33 +188,66 @@ ifneq (,$(MOZCLIENT_PROJECT))
ifneq (,$(DEBIAN_TAG))
mozclient-checkout: MOZCLIENT_DATE = $(NULL)
else
-ifneq (,$(DEBIAN_DATE))
-mozclient-checkout: MOZCLIENT_DATE = MOZ_CO_DATE="$(shell echo $(DEBIAN_DATE) | $(DATE_FILTER))"
-else
+ifeq (,$(DEBIAN_DATE))
mozclient-checkout: DEBIAN_DATE = $(shell $(MOZCLIENT_GETDATE))
+endif
+ifeq ($(MOZCLIENT_VCS),cvs)
mozclient-checkout: MOZCLIENT_DATE = MOZ_CO_DATE="$(shell echo $(DEBIAN_DATE) | $(DATE_FILTER))"
+else
+ifeq ($(MOZCLIENT_VCS),hg)
+mozclient-checkout: MOZCLIENT_DATE = -r $(shell echo $(DEBIAN_DATE) | $(REVISION_FILTER))
+else
+mozclient-checkout:
+ $(error '$@' not supported for '$(MOZCLIENT_VCS)' yet)
endif
endif
mozclient-checkout:
+ifeq ($(MOZCLIENT_VCS),cvs)
@if [ "Z$(DEBIAN_TAG)" = "Z" ] && [ "Z$(DEBIAN_DATE)" = "Z" ] ; then echo "*Error* DEBIAN_DATE is empty, MOZCLIENT_GETDATE failed ?" ; exit 1 ; fi
cd $(MOZCLIENT_TMP) && make -f $(MOZ_CLIENT) checkout MOZ_CO_PROJECT=$(MOZCLIENT_PROJECT) $(MOZCLIENT_DATE) $(DEBIAN_MOZ_CO_TAG)
+else
+ifeq ($(MOZCLIENT_VCS),hg)
+ cd $(MOZCLIENT_TMP) && hg clone $(MOZCLIENT_DATE) $(MOZCLIENT_HG_LOC)$(MOZCLIENT_PROJECT)/ mozilla
+else
+ $(error '$@' not supported for '$(MOZCLIENT_VCS)' yet)
+endif
+endif
echo $(DEBIAN_DATE) > $(MOZCLIENT_TMP)/.date
+endif
else
ifneq (,$(DEBIAN_TAG))
mozclient-checkout: MOZCLIENT_DATE = $(NULL)
else
-ifneq (,$(DEBIAN_DATE))
-mozclient-checkout: MOZCLIENT_DATE = -D "$(shell echo $(DEBIAN_DATE) | $(DATE_FILTER))"
-else
+ifeq (,$(DEBIAN_DATE))
mozclient-checkout: DEBIAN_DATE = $(shell $(MOZCLIENT_GETDATE))
+endif
+ifeq ($(MOZCLIENT_VCS),cvs)
mozclient-checkout: MOZCLIENT_DATE = -D "$(shell echo $(DEBIAN_DATE) | $(DATE_FILTER))"
+else
+ifeq ($(MOZCLIENT_VCS),hg)
+mozclient-checkout: MOZCLIENT_DATE = -r $(shell echo $(DEBIAN_DATE) | $(REVISION_FILTER))
+else
+mozclient-checkout:
+ $(error '$@' not supported for '$(MOZCLIENT_VCS)' yet)
+endif
endif
endif
mozclient-checkout:
@if [ "Z$(DEBIAN_TAG)" = "Z" ] && [ "Z$(DEBIAN_DATE)" = "Z" ] ; then echo "*Error* DEBIAN_DATE is empty, MOZCLIENT_GETDATE failed ?" ; exit 1 ; fi
- cd $(MOZCLIENT_TMP) && cvs -d :pserver:anonymous@cvs-mirror.mozilla.org:/cvsroot -q -z 3 co -P -A $(MOZCLIENT_DATE) $(DEBIAN_CO_TAG) $(MOZCLIENT_MODULES)
+ifeq ($(MOZCLIENT_VCS),cvs)
+ cd $(MOZCLIENT_TMP) && cvs -d $(MOZCLIENT_CVS_LOC) -q -z 3 co -P -A $(MOZCLIENT_DATE) $(DEBIAN_CO_TAG) $(MOZCLIENT_MODULES)
+else
+ifeq ($(MOZCLIENT_VCS),hg)
+ cd $(MOZCLIENT_TMP) && hg clone $(MOZCLIENT_DATE) $(foreach module,$(MOZCLIENT_MODULES),http://hg.mozilla.org/$(MOZCLIENT_PROJECT)/$(module)/) mozilla
+else
+ $(error '$@' not supported for '$(MOZCLIENT_VCS)' yet)
+endif
+endif
echo $(DEBIAN_DATE) > $(MOZCLIENT_TMP)/.date
endif
+ifneq (,$(MOZCLIENT_POSTCOCMD))
+ cd $(MOZCLIENT_TMP) && $(MOZCLIENT_POSTCOCMD)
+endif
# Remove bin-only files using the remove.binonly.sh script.
# Keep a log in REMOVED+nobinonly.txt
@@ -204,7 +262,7 @@ mozclient-remove-bin:
ifneq (,$(DEBIAN_TAG))
mozclient-pack: MOZCLIENT_TVERSION = $(DEBIAN_DTAG)
else
-mozclient-pack: MOZCLIENT_TVERSION = $(shell cd $(MOZCLIENT_TMP) && $(MOZCLIENT_GETVERSION))~cvs$(shell cat $(MOZCLIENT_TMP)/.date)
+mozclient-pack: MOZCLIENT_TVERSION = $(shell cd $(MOZCLIENT_TMP) && $(MOZCLIENT_GETVERSION))~$(MOZCLIENT_VCS)$(shell cat $(MOZCLIENT_TMP)/.date)
endif
mozclient-pack: MOZCLIENT_VERSION = $(MOZCLIENT_TVERSION)$(shell test -f $(MOZCLIENT_TMP)/mozilla/REMOVED+$(NOBINONLY).txt && echo "+$(NOBINONLY)")
mozclient-pack: