summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--README19
-rw-r--r--debian/changelog23
-rw-r--r--src/Makefile28
-rw-r--r--src/firefox-3.0-full.mk.in11
-rw-r--r--src/firefox-3.0.mk.in11
-rw-r--r--src/firefox-3.1.mk.in17
-rw-r--r--src/firefox-4.0.mk.in17
-rw-r--r--src/lightning-sunbird.mk.in11
-rw-r--r--src/mozclient.mk.in283
-rwxr-xr-xsrc/mozclient.pl.in716
-rw-r--r--src/mozclient/firefox-3.0-full.conf25
-rw-r--r--src/mozclient/firefox-3.0.conf26
-rw-r--r--src/mozclient/firefox-3.1.conf26
-rw-r--r--src/mozclient/firefox-4.0.conf26
-rw-r--r--src/mozclient/lightning-sunbird.conf26
-rw-r--r--src/mozclient/nspr.conf27
-rw-r--r--src/mozclient/nss.conf27
-rw-r--r--src/mozclient/patches/series (renamed from src/patches/series)0
-rw-r--r--src/mozclient/patches/xulbrowser_target.patch (renamed from src/patches/xulbrowser_target.patch)0
-rw-r--r--src/mozclient/seamonkey-2.0.conf24
-rw-r--r--src/mozclient/thunderbird-2.0.conf26
-rw-r--r--src/mozclient/thunderbird-3.0.conf24
-rw-r--r--src/mozclient/xulrunner-1.8.conf25
-rw-r--r--src/mozclient/xulrunner-1.9.1.conf26
-rw-r--r--src/mozclient/xulrunner-1.9.conf24
-rw-r--r--src/mozclient/xulrunner-2.0.conf26
-rw-r--r--src/nspr.mk.in10
-rw-r--r--src/nss.mk.in12
-rw-r--r--src/seamonkey-2.0.mk.in9
-rw-r--r--src/thunderbird-2.0.mk.in13
-rw-r--r--src/thunderbird-3.0.mk.in9
-rw-r--r--src/xulrunner-1.8.mk.in10
-rw-r--r--src/xulrunner-1.9.1.mk.in17
-rw-r--r--src/xulrunner-1.9.mk.in9
-rw-r--r--src/xulrunner-2.0.mk.in17
35 files changed, 1160 insertions, 440 deletions
diff --git a/README b/README
index 3a5a518..8be97bd 100644
--- a/README
+++ b/README
@@ -48,7 +48,8 @@ To use :
The following targets are then available to the caller of debian/rules:
- get-orig-source
Build a tarball according to parameters from project.mk
- and optionally using either DEBIAN_DATE or DEBIAN_TAG
+ and optionally using either DEBIAN_DATE or DEBIAN_TAG, and optionally
+ DEBIAN_BRANCH
- list-tags
List all the registered VCS tags from upstream server
@@ -64,25 +65,29 @@ Optionally:
DEBIAN_KEEP_VCS to preserve the VCS files (*/CVS, .hg, ...)
ex: DEBIAN_KEEP_VCS=1
-Projects files are stored in /usr/share/mozilla-devscripts as .mk files.
-They contain the following parameters:
+Projects files are stored in /usr/share/mozilla-devscripts/mozclient
+as .conf files. 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_VCS (optional): VCS (hg, git, cvs, svn..). (default: cvs)
-- MOZCLIENT_PROJECT (mandatory): VCS project name. If $(NULL), then
+- MOZCLIENT_VCS (mandatory): VCS (hg, git, cvs, svn..)
+- MOZCLIENT_PROJECT (optional): VCS project name. If $(NULL), then
$(MOZCLIENT_MODULES) becomes mandatory
- 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
- MOZCLIENT_GETDATE (mandatory): get the last commit date for the project
- 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)
+- MOZCLIENT_DYNTAG (optional): paired with MOZCLIENT_DYNTAG_FILES, a shell
+ command that is executed to get a VCS tag
+- MOZCLIENT_DYNTAG_FILES (optional): list of files to get before calling
+ MOZCLIENT_DYNTAG
+- MOZCLIENT_CVS_LOC (optional): cvs location
+- MOZCLIENT_HG_LOC (optional): hg location (an URL)
Example with firefox-3.0:
diff --git a/debian/changelog b/debian/changelog
index f142c12..84c55e4 100644
--- a/debian/changelog
+++ b/debian/changelog
@@ -1,3 +1,26 @@
+mozilla-devscripts (0.09) UNRELEASED; urgency=low
+
+ * [ mozclient ]
+ + Full refactoring of mozclient. It is now written in object-oriented Perl.
+ The makefile version was getting difficult to extend and to maintain.
+ We now have a base class and a set of VCS classes inheriting for it.
+ - add src/mozclient.pl.in
+ - add src/mozclient/${projects}.conf
+ - move src/patches to src/mozclient/patches
+ - update src/${projects}.mk.in
+ - update src/Makefile
+ - update README
+ + nspr and nss are now using a dynamic tag. They used to fetch HEAD
+ which made them tricky to distribute. Now, we take NSPR_CO_TAG and
+ NSS_CO_TAG from mozilla/client.mk (fetched from HEAD or from a tag)
+ and we assign a version like nss-3.12.0.3+1.9~cvs without trailling
+ cvs date (as it's a taggued nss), or nss-3.12.0.3+1.9 when using a
+ taggued mozilla/client.mk
+ - update src/mozclient.pl.in
+ - update src/mozclient/{nspr,nss}.conf
+
+ -- Fabien Tassin <fta@sofaraway.org> Fri, 30 May 2008 15:36:16 +0200
+
mozilla-devscripts (0.08) intrepid; urgency=low
[ Alexander Sack ]
diff --git a/src/Makefile b/src/Makefile
index 31dd5da..52c47a6 100644
--- a/src/Makefile
+++ b/src/Makefile
@@ -21,7 +21,7 @@ PREFIX ?= /usr
DATADIR = $(PREFIX)/share/mozilla-devscripts
-mk_files = \
+subst_files = \
firefox-3.0.mk \
firefox-3.0-full.mk \
firefox-3.1.mk \
@@ -36,21 +36,29 @@ mk_files = \
xulrunner-1.9.1.mk \
xulrunner-2.0.mk \
mozclient.mk \
+ mozclient.pl \
compare.mk \
minefield-packager.mk \
$(NULL)
-extra_mk_files = \
+extra_files = \
remove.binonly.sh \
xpi.mk \
lp-locale-export.mk \
$(NULL)
-extra_mk_dirs = \
- patches \
+extra_dirs = \
+ mozclient \
+ mozclient/patches \
minefield-packager/debian \
$(NULL)
+%.pl: %.pl.in
+ cat $< | sed \
+ -e "s|^\(my \$$mozclient_dir[[:space:]]*= '\)@DATADIR@\(';.*\)|\1$(DATADIR)/\2|" \
+ > $@
+ chmod 755 $@
+
%.mk: %.mk.in
cat $< | sed \
-e "s|^\(include\) \(.*\)\.in|\1 $(DATADIR)/\2|" \
@@ -60,15 +68,15 @@ extra_mk_dirs = \
> $@
chmod 644 $@
-build: $(mk_files)
+build: $(subst_files)
-install: $(mk_files) $(extra_mk_files) $(foreach dir,$(extra_mk_dirs),$(wildcard $(dir)/*))
- install -m 755 -d $(DESTDIR)$(DATADIR) $(foreach dir,$(extra_mk_dirs),$(DESTDIR)$(DATADIR)/$(dir))
- install -m 644 $(mk_files) $(extra_mk_files) $(DESTDIR)$(DATADIR)
+install: $(subst_files) $(extra_files) $(foreach dir,$(extra_dirs),$(wildcard $(dir)/*))
+ install -m 755 -d $(DESTDIR)$(DATADIR) $(foreach dir,$(extra_dirs),$(DESTDIR)$(DATADIR)/$(dir))
+ install -m 644 $(subst_files) $(extra_files) $(DESTDIR)$(DATADIR)
chmod 755 $(DESTDIR)$(DATADIR)/*.sh
- for dir in $(extra_mk_dirs) ; do \
+ for dir in $(extra_dirs) ; do \
install -m 644 `echo $$dir/*` $(DESTDIR)$(DATADIR)/$$dir ; \
done
clean:
- rm -f $(mk_files)
+ rm -f $(subst_files)
diff --git a/src/firefox-3.0-full.mk.in b/src/firefox-3.0-full.mk.in
index 0debd7d..4a5f29d 100644
--- a/src/firefox-3.0-full.mk.in
+++ b/src/firefox-3.0-full.mk.in
@@ -17,16 +17,7 @@
# 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-3.0-full-orig
-MOZCLIENT_APPNAME := firefox-3.0
-MOZCLIENT_PROJECT := browser
-MOZCLIENT_FILE := mozilla/browser/config/version.txt
-MOZCLIENT_GETVERSION := sed -e 's/pre//; s/a\([0-9]*\)/~alpha\1/; s/b\([0-9]*\)/~b\1/' $(MOZCLIENT_FILE)
-MOZCLIENT_URL := 'http://bonsai.mozilla.org/cvsquery.cgi?treeid=default&module=SeaMonkeyBrowser&branch=HEAD&branchtype=match&dir=&file=&filetype=match&who=&whotype=match&sortby=Date&hours=2&date=week&mindate=&maxdate=&cvsroot=%2Fcvsroot'
-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
+MOZCLIENT_PROJECTNAME := firefox-3.0-full
include mozclient.mk.in
diff --git a/src/firefox-3.0.mk.in b/src/firefox-3.0.mk.in
index 9730f55..2f45f55 100644
--- a/src/firefox-3.0.mk.in
+++ b/src/firefox-3.0.mk.in
@@ -17,16 +17,7 @@
# 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-3.0-orig
-MOZCLIENT_APPNAME := firefox-3.0
-MOZCLIENT_PROJECT := xulbrowser
-MOZCLIENT_FILE := mozilla/browser/config/version.txt
-MOZCLIENT_GETVERSION := sed -e 's/pre//; s/a\([0-9]*\)/~alpha\1/; s/b\([0-9]*\)/~b\1/' $(MOZCLIENT_FILE)
-MOZCLIENT_URL := 'http://bonsai.mozilla.org/cvsquery.cgi?treeid=default&module=SeaMonkeyBrowser&branch=HEAD&branchtype=match&dir=&file=&filetype=match&who=&whotype=match&sortby=Date&hours=2&date=week&mindate=&maxdate=&cvsroot=%2Fcvsroot'
-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
+MOZCLIENT_PROJECTNAME := firefox-3.0
include mozclient.mk.in
diff --git a/src/firefox-3.1.mk.in b/src/firefox-3.1.mk.in
index 000e39d..74becad 100644
--- a/src/firefox-3.1.mk.in
+++ b/src/firefox-3.1.mk.in
@@ -17,22 +17,7 @@
# 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-3.1-orig
-MOZCLIENT_APPNAME := firefox-3.1
-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
+MOZCLIENT_PROJECTNAME := firefox-3.1
include mozclient.mk.in
diff --git a/src/firefox-4.0.mk.in b/src/firefox-4.0.mk.in
index cb71924..ccdd100 100644
--- a/src/firefox-4.0.mk.in
+++ b/src/firefox-4.0.mk.in
@@ -17,22 +17,7 @@
# 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
+MOZCLIENT_PROJECTNAME := firefox-4.0
include mozclient.mk.in
diff --git a/src/lightning-sunbird.mk.in b/src/lightning-sunbird.mk.in
index 7a213bb..eff5e84 100644
--- a/src/lightning-sunbird.mk.in
+++ b/src/lightning-sunbird.mk.in
@@ -17,15 +17,6 @@
# with this program; if not, write to the Free Software Foundation, Inc.,
# 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
-MOZCLIENT_TARGET := lightning-sunbird-orig
-MOZCLIENT_APPNAME := lightning-sunbird
-MOZCLIENT_PROJECT := calendar
-MOZCLIENT_BRANCH := MOZILLA_1_8_BRANCH
-MOZCLIENT_FILE := mozilla/calendar/sunbird/config/version.txt
-MOZCLIENT_GETVERSION := tail -1 $(MOZCLIENT_FILE) | sed -e 's/pre//; s/\([ab]\)\([0-9]*\)/~\1\2/'
-MOZCLIENT_URL := 'http://bonsai.mozilla.org/cvsquery.cgi?treeid=default&module=CalendarClient&branch=MOZILLA_1_8_BRANCH&branchtype=match&dir=&file=&filetype=match&who=&whotype=match&sortby=Date&hours=2&date=week&mindate=&maxdate=&cvsroot=%2Fcvsroot'
-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_PROJECTNAME := lightning-sunbird
include mozclient.mk.in
diff --git a/src/mozclient.mk.in b/src/mozclient.mk.in
index b8686f1..2e7eef0 100644
--- a/src/mozclient.mk.in
+++ b/src/mozclient.mk.in
@@ -22,284 +22,35 @@
# Don't include this file directly, include one of the project.mk
# file instead, which will include this file for you.
-# The caller could specify the following parameters:
-# DEBIAN_DATE in the form YYYYMMDDtHHMM
-# ex: DEBIAN_DATE=20070911t1711
-# or
-# DEBIAN_TAG in the form CVS_TAG=debian_version
-# ex: DEBIAN_TAG=FIREFOX_3_0b2_RC1=3.0~b2~rc1
-# Optionally:
-# DEBIAN_KEEP_VCS to preserve the VCS files (*/CVS, .hg, ...)
-# ex: DEBIAN_KEEP_VCS=1
+MOZDEVSCRIPT_DIR = .
-# The following targets are available to the caller:
-# - get-orig-source
-# Build a tarball according to parameters from project.mk
-# and optionally using either DEBIAN_DATE or DEBIAN_TAG
-# - list-tags
-# List all the registered CVS tags from upstream server
-
-# project.mk contains 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_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): 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
-# - MOZCLIENT_GETDATE (mandatory): get the last commit date for the project
-# - 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:
-#
-# - in debian/control, add mozilla-devscripts to Build-Depends
-# - in debian/rules, add:
-# include /usr/share/mozilla-devscripts/firefox-3.0.mk
-#
-# That's it. You've gained get-orig-source.
-#
-# You can now call it:
-# - debian/rules get-orig-source
-# => firefox-3.0_3.0~b2~cvs20071120t1456+nobinonly.orig.tar.gz
-#
-# - debian/rules get-orig-source DEBIAN_DATE=20070914t1713
-# => firefox-3.0_3.0~a8~cvs20070914t1713+nobinonly.orig.tar.gz
-#
-# - debian/rules get-orig-source DEBIAN_TAG=FIREFOX_3_0b2_RC1=3.0~b2~rc1
-# => firefox-3.0_3.0~b2~rc1+nobinonly.orig.tar.gz
-
-# Notes:
-# - the script 'remove.binonly.sh' is applied to all projects, in order
-# to remove binary-only files before packing. Traces of the cleaning
-# are preserved inside that resulting tarball in REMOVED+nobinonly.txt.
-# If nothing has been removed, the log and the "+nobinonly" signature
-# are both dropped.
-
-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
-
-TAR_EXCLUDE := $(NULL)
-ifeq (,$(DEBIAN_KEEP_VCS))
-ifeq ($(MOZCLIENT_VCS),cvs)
-TAR_EXCLUDE := --exclude=CVS --exclude=.cvsignore
-else
-ifeq ($(MOZCLIENT_VCS),hg)
-TAR_EXCLUDE := --exclude=.hg
-endif
+ifeq (.,$(MOZDEVSCRIPT_DIR))
+ EXT=.in
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)
-DEBIAN_LTAG = $(shell echo $(DEBIAN_TAG) | sed -e 's/=.*//')
-DEBIAN_DTAG = $(shell echo $(DEBIAN_TAG) | sed -e 's/.*=//')
-DEBIAN_CO_TAG = -r $(DEBIAN_LTAG)
-DEBIAN_MOZ_CO_TAG = MOZ_CO_TAG=$(DEBIAN_LTAG)
-else
-DEBIAN_MOZ_CO_TAG = $(NULL)
-ifdef DEBIAN_DATE
-DEBIAN_CO_DATE = $(shell echo "-D \"$(DEBIAN_DATE)\"" | $(DATE_FILTER))
-endif
-ifdef DEBIAN_BRANCH
-DEBIAN_CO_TAG = -r $(DEBIAN_BRANCH)
-endif
-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
-
-mozclient-dir:
- rm -rf $(MOZCLIENT_TMP)
- mkdir $(MOZCLIENT_TMP)
-
-# Get the client
-ifneq (,$(MOZCLIENT_BRANCH))
-$(MOZ_CLIENT): MOZCLIENT_TBRANCH = -r $(MOZCLIENT_BRANCH)
-else
-$(MOZ_CLIENT): MOZCLIENT_TBRANCH = $(NULL)
+ ARGS += -t $(DEBIAN_TAG)
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
-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 $(firstword $(subst mozilla/,,$(MOZCLIENT_FILE)))
-else
- $(error '$@' not supported for '$(MOZCLIENT_VCS)' yet)
-endif
- rm -rf $(MOZCLIENT_TMP)
-
-# Get version, and just that
-mozclient-version: mozclient-deps mozclient-dir
- @cd $(MOZCLIENT_TMP) && cvs -d $(MOZCLIENT_CVS_LOC) co $(MOZCLIENT_FILE)
- @cd $(MOZCLIENT_TMP) && echo -n VERSION= && $(MOZCLIENT_GETVERSION)
- @rm -rf $(MOZCLIENT_TMP)
-
-# Patch
-# - don't patch when a branch name is specified
-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
-mozclient-unpatch:
-ifeq (,$(MOZCLIENT_BRANCH))
- cd $(MOZCLIENT_TMP) && quilt --quiltrc /dev/null pop -a -R || test $$? = 2
-endif
- rm -rf $(MOZCLIENT_TMP)/.pc $(MOZCLIENT_TMP)/$(MOZCLIENT_STAMP) $(MOZCLIENT_TMP)/patches
-
-# Clean
-mozclient-clean:
- rm -rf $(MOZCLIENT_TMP)
-
-# Checkout using either a TAG, a date or nothing (last commit date)
-# Use mozclient.mk if $(MOZCLIENT_PROJECT) is specified, otherwise, do a direct cvs checkout
-# using $(MOZCLIENT_MODULES)
-ifneq (,$(MOZCLIENT_PROJECT))
-ifneq (,$(DEBIAN_TAG))
-mozclient-checkout: MOZCLIENT_DATE = $(NULL)
-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
-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
-ifeq ($(MOZCLIENT_VCS),cvs)
- 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
-else
-ifneq (,$(DEBIAN_TAG))
-mozclient-checkout: MOZCLIENT_DATE = $(NULL)
-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
-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),$(MOZCLIENT_HG_LOC)$(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)
+ifdef DEBIAN_DATE
+ ARGS += -d $(DEBIAN_DATE)
endif
-# Remove bin-only files using the remove.binonly.sh script.
-# Keep a log in REMOVED+nobinonly.txt
-mozclient-remove-bin:
- cd $(MOZCLIENT_TMP)/mozilla && sh $(MOZCLIENT_EXCLUDE_SCRIPT) > REMOVED+$(NOBINONLY).txt 2>&1
- if [ ! -s $(MOZCLIENT_TMP)/mozilla/REMOVED+$(NOBINONLY).txt ] ; then rm $(MOZCLIENT_TMP)/mozilla/REMOVED+$(NOBINONLY).txt ; fi
-
-# Pack
-# - only use the +nobinonly suffix is something has been deleted
-# - for embedded tarballs (bzipped), use MOZCLIENT_EMBEDDED=1
-# - to preserve the mozilla root dir, use MOZCLIENT_WANTMOZDIR=1
-ifneq (,$(DEBIAN_TAG))
-mozclient-pack: MOZCLIENT_TVERSION = $(DEBIAN_DTAG)
-else
-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:
- rm -rf $(MOZCLIENT_TMP)/$(MOZCLIENT_APPNAME)-$(MOZCLIENT_VERSION)
-ifneq (,$(findstring 1,$(MOZCLIENT_WANTMOZDIR)$(MOZCLIENT_EMBEDDED)))
- mkdir $(MOZCLIENT_TMP)/$(MOZCLIENT_APPNAME)-$(MOZCLIENT_VERSION)
-endif
-ifeq (1,$(MOZCLIENT_EMBEDDED))
- cd $(MOZCLIENT_TMP) && tar jcf $(MOZCLIENT_APPNAME)-$(MOZCLIENT_VERSION)/$(MOZCLIENT_PROJECT)-$(MOZCLIENT_TVERSION)-source.tar.bz2 $(TAR_EXCLUDE) mozilla
-else
- mv $(MOZCLIENT_TMP)/mozilla $(MOZCLIENT_TMP)/$(MOZCLIENT_APPNAME)-$(MOZCLIENT_VERSION)
+ifdef DEBIAN_BRANCH
+ ARGS += -b $(DEBIAN_BRANCH)
endif
- rm -f $(MOZCLIENT_APPNAME)_$(MOZCLIENT_VERSION).orig.tar.gz
- cd $(MOZCLIENT_TMP) && tar zcf ../$(MOZCLIENT_APPNAME)_$(MOZCLIENT_VERSION).orig.tar.gz $(TAR_EXCLUDE) $(MOZCLIENT_APPNAME)-$(MOZCLIENT_VERSION)
- rm -rf $(MOZCLIENT_TMP)
- -ls -l $(MOZCLIENT_APPNAME)_$(MOZCLIENT_VERSION).orig.tar.gz
-# The real target
-ifneq (,$(MOZCLIENT_PROJECT))
-$(MOZCLIENT_TARGET): $(MOZ_CLIENT) $(MOZCLIENT_TMP)/$(MOZCLIENT_STAMP) mozclient-checkout mozclient-remove-bin mozclient-pack
-else
-$(MOZCLIENT_TARGET): mozclient-deps mozclient-dir mozclient-checkout mozclient-remove-bin mozclient-pack
+ifdef DEBIAN_KEEP_VCS
+ ARGS += -p
endif
-get-orig-source: $(MOZCLIENT_TARGET)
+list-tags:
+ perl $(MOZDEVSCRIPT_DIR)/mozclient.pl$(EXT) -l $(MOZCLIENT_PROJECTNAME)
-.PHONY: mozclient-deps mozclient-dir mozclient-patch mozclient-unpatch mozclient-checkout mozclient-remove-bin mozclient-pack $(MOZCLIENT_TARGET) get-orig-source
+get-orig-source:
+ perl $(MOZDEVSCRIPT_DIR)/mozclient.pl$(EXT) $(ARGS) $(MOZCLIENT_PROJECTNAME)
-.NOTPARALLEL:
+mozclient-version:
+ perl $(MOZDEVSCRIPT_DIR)/mozclient.pl$(EXT) -V $(MOZCLIENT_PROJECTNAME)
+.PHONY: get-orig-source list-tags mozclient-version
diff --git a/src/mozclient.pl.in b/src/mozclient.pl.in
new file mode 100755
index 0000000..78e242a
--- /dev/null
+++ b/src/mozclient.pl.in
@@ -0,0 +1,716 @@
+#!/usr/bin/perl -w
+
+# Copyright (c) 2007-2008 Fabien Tassin <fta@sofaraway.org>
+# Description: The 'mozclient' module of mozilla-devscripts
+#
+# 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.
+
+############################################################################
+
+package MozClient;
+
+# This is the main class. It should not be used directly. VCS specific classes
+# should be instantiated instead. They inherit from this main class and
+# overwrite some methods according to VCS requirements.
+
+use Carp;
+use strict;
+
+my $mozclient_dir = '@DATADIR@'; # Needs to be substituted
+
+chomp($mozclient_dir = `pwd`) if $mozclient_dir eq '@DATADIR@';
+my $pkg_conf_dir = "$mozclient_dir/mozclient";
+my $patches_dir = "$pkg_conf_dir/patches";
+my $work_dir = "mozclient-tmp";
+my $nobinonly = "nobinonly";
+
+my @conf_mandatory = qw(MOZCLIENT_APPNAME MOZCLIENT_FILE MOZCLIENT_GETVERSION
+ MOZCLIENT_GETDATE MOZCLIENT_VCS);
+my @conf_optional = qw(MOZCLIENT_MODULES MOZCLIENT_PROJECT MOZCLIENT_BRANCH
+ MOZCLIENT_POSTCOCMD MOZCLIENT_EMBEDDED
+ MOZCLIENT_WANTMOZDIR MOZCLIENT_WANTPATCH
+ MOZCLIENT_DYNTAG MOZCLIENT_DYNTAG_FILES
+ MOZCLIENT_CVS_LOC MOZCLIENT_HG_LOC);
+my @conf_list = qw(MOZCLIENT_FILE);
+
+# List of dependencies
+my $dependencies = {
+ 'cvs' => '/usr/bin/cvs',
+ 'mercurial' => '/usr/bin/hg',
+ 'quilt' => '/usr/bin/quilt',
+ 'wget' => '/usr/bin/wget',
+};
+
+my $defaults = {
+ 'MOZCLIENT_CVS_LOC' => ':pserver:anonymous@cvs-mirror.mozilla.org:/cvsroot',
+ 'MOZCLIENT_HG_LOC' => 'http://hg.mozilla.org/',
+ 'MOZCLIENT_EXCLUDE_SCRIPT' => 'remove.binonly.sh',
+ 'MOZILLA_CLIENT' => 'mozilla/client.mk',
+ 'MOZCLIENT_PATCHES' => "$patches_dir",
+};
+
+############################################################################
+
+sub new {
+ my $class = shift;
+ my $conf = shift;
+ my $opt = shift;
+
+ my $self = {};
+
+ @{$self}{keys %$conf} = values %$conf;
+
+ $self->{'want_branch'} = $$opt{'branch'};
+ $self->{'want_listtags'} = 1 if $$opt{'list-tags'};
+ $self->{'want_tag'} = $$opt{'tag'};
+ $self->{'have_date'} = $$opt{'date'};
+ $self->{'preserve_vcs'} = $$opt{'preserve-vcs'};
+ $self->{'debug'} = $$opt{'debug'};
+
+ $self->{'want_branch'} = $$conf{'MOZCLIENT_BRANCH'}
+ if defined $$conf{'MOZCLIENT_BRANCH'} && !defined $self->{'want_branch'};
+
+ bless($self, $class);
+ $self;
+}
+
+sub vcs {
+ my $self = shift;
+
+ $self->{'MOZCLIENT_VCS'};
+}
+
+sub debug {
+ my $self = shift;
+
+ $self->{'debug'} = shift if @_;
+ $self->{'debug'};
+}
+
+sub LOG {
+ my $self = shift;
+ my $str = shift;
+
+ printf "LOG: $str\n", @_ if $self->debug;
+}
+
+sub LOG2 {
+ my $self = shift;
+ my $str = shift;
+
+ printf "$str\n", @_;
+}
+
+sub check_dependencies {
+ my $self = shift;
+
+ $self->LOG("MozClient::check_dependencies()");
+ my $missing = [];
+ map { push @$missing, $_ unless -x $$dependencies{$_}} keys %$dependencies;
+ carp "# Error: missing dependencies. Please install " .
+ (join ", ", @$missing) . "\n" if $#$missing >= 0;
+ 1;
+}
+
+sub cleanup_dir {
+ my $self = shift;
+
+ if (-d $work_dir) {
+ $self->LOG("MozClient::cleanup_dir()");
+ $self->exec("rm -rf $work_dir");
+ }
+}
+
+sub prepare_dir {
+ my $self = shift;
+
+ $self->LOG("MozClient::prepare_dir()");
+ $self->cleanup_dir();
+ $self->mkdir($work_dir, 0755);
+}
+
+sub exec {
+ my $self = shift;
+
+ $self->LOG2("\$ %s", @_);
+ my $cmd = sprintf "%s", @_;
+ my $args = &main::_split_args($cmd);
+ my $ret = system(@$args);
+ $ret == 0 || carp "Can't run '$cmd': error code $ret\n";
+}
+
+sub exec2 {
+ my $self = shift;
+
+ $self->LOG2("\$ %s", @_);
+ my $cmd = shift;
+ return `$cmd`;
+}
+
+sub chdir {
+ my $self = shift;
+
+ $self->LOG2("\$ cd %s", @_);
+ my $dir = shift;
+ CORE::chdir($dir) || carp "Can't chdir($dir): $!\n";
+}
+
+sub unlink {
+ my $self = shift;
+
+ $self->LOG2("\$ rm %s", @_);
+ my $file = shift;
+
+ CORE::unlink($file) || carp "Can't unlink($file): $!\n";
+}
+
+sub mkdir {
+ my $self = shift;
+ my $dir = shift;
+ my $mode = shift;
+ $self->LOG2("\$ mkdir %s", $dir);
+ CORE::mkdir($dir, $mode) || carp "Can't mkdir($dir, $mode): $!\n";
+}
+
+sub want_list_tags {
+ my $self = shift;
+
+ defined $self->{'want_listtags'} && $self->{'want_listtags'};
+}
+
+sub list_tags {
+ my $self = shift;
+
+ $self->LOG("MozClient::list_tags()");
+ die "Error: list_tags() not supported for " . $self->vcs;
+}
+
+# Execute the command defined in MOZCLIENT_POSTCOCMD after the checkout
+sub do_post_co_commands {
+ my $self = shift;
+
+ $self->LOG("MozClient::do_post_co_commands()");
+ $self->chdir($work_dir);
+ $self->exec2($self->{'MOZCLIENT_POSTCOCMD'});
+ $self->chdir("..");
+}
+
+sub get_client {
+ my $self = shift;
+
+ $self->LOG("MozClient::get_client()");
+ die "Can't MozClient::get_client() for " . $self->vcs;
+}
+
+sub set_revdate {
+ my $self = shift;
+
+ $self->LOG("MozClient::set_revdate()");
+ die "Can't MozClient::set_revdate() for " . $self->vcs;
+}
+
+sub convert_revdate {
+ my $self = shift;
+
+ $self->LOG("MozClient::convert_revdate()");
+ die "Can't MozClient::convert_revdate() for " . $self->vcs;
+}
+
+sub do_dynamic_tag {
+ my $self = shift;
+
+ $self->LOG("MozClient::do_dynamic_tag()");
+ die "Error: do_dynamic_tag() not supported for " . $self->vcs;
+}
+
+sub setup {
+ my $self = shift;
+
+ $self->LOG("MozClient::setup()");
+ $self->{'mozclient_date'} = "";
+ $self->{'moz_co_tag'} = "";
+
+ if (!defined $self->{'want_tag'} && defined $self->{'MOZCLIENT_DYNTAG'}) {
+ $self->do_dynamic_tag();
+ }
+
+ if (defined $self->{'want_tag'}) {
+ # We want a tag, we can either let mozclient compute the version or
+ # specify our own (using -t TAG=version)
+ if (defined $self->{'have_date'}) {
+ warn "Warning: can't use -d and -t together. Ignoring -d";
+ undef $self->{'have_date'};
+ }
+ $self->{'want_tag'} =~ m/([^=]*)(=?)(.*)/;
+ $self->{'ltag'} = $1;
+ $self->{'dtag'} = $3;
+ $self->{'co_tag'} = "-r $1";
+ $self->{'moz_co_tag'} = "MOZ_CO_TAG=$1";
+ }
+ else {
+ # we don't want a specific tag, so go for a date and possibly a branch
+ if (!defined $self->{'have_date'}) {
+ chomp($self->{'have_date'} = `$self->{'MOZCLIENT_GETDATE'}`);
+ }
+ $self->{'mozclient_date'} =
+ '-D "' . $self->convert_revdate($self->{'have_date'}) . '"';
+ $self->{'co_tag'} = '';
+ $self->{'co_tag'} =
+ "-r " . $self->{'want_branch'} if defined $self->{'want_branch'};
+ }
+}
+
+sub checkout {
+ my $self = shift;
+
+ $self->LOG("MozClient::checkout()");
+ die "Can't MozClient::checkout() for " . $self->vcs;
+}
+
+sub nobin_cleanup {
+ my $self = shift;
+
+ $self->LOG("MozClient::nobin_cleanup()");
+
+ $self->chdir("$work_dir/mozilla");
+ my $cmd = sprintf "sh ../../%s > REMOVED+${nobinonly}.txt 2>&1",
+ $self->{'MOZCLIENT_EXCLUDE_SCRIPT'};
+ $self->exec2($cmd);
+ $self->unlink("REMOVED+${nobinonly}.txt")
+ unless -s "REMOVED+${nobinonly}.txt";
+ $self->chdir("../..");
+}
+
+sub tar_exclude {
+ my $self = shift;
+
+ $self->LOG("MozClient::tar_exclude()");
+ # nothing
+ [];
+}
+
+sub pack {
+ my $self = shift;
+
+ $self->LOG("MozClient::pack()");
+
+ my $tar_exclude = "";
+ unless ($self->{'preserve_vcs'}) {
+ my $dirs = $self->tar_exclude();
+
+ $tar_exclude = join " ", @$dirs;
+ }
+
+ my $tversion;
+ if (defined $self->{'want_tag'} &&
+ defined $self->{'dtag'} && length $self->{'dtag'} > 0) {
+ $tversion = $self->{'dtag'};
+ }
+ else {
+ $self->chdir($work_dir);
+ chomp($tversion = `$self->{'MOZCLIENT_GETVERSION'}`);
+ $tversion .= '~' . $self->{'MOZCLIENT_VCS'} . $self->{'have_date'}
+ unless defined $self->{'want_tag'};
+ $self->LOG2("\$ tversion=`" . $self->{'MOZCLIENT_GETVERSION'} .
+ "` # => $tversion");
+ $self->chdir("..");
+ }
+ my $version = $tversion;
+ $version .= "+${nobinonly}"
+ if -f "$work_dir/mozilla/REMOVED+${nobinonly}.txt";
+ $self->exec("rm -rf $work_dir/" . $self->{'MOZCLIENT_APPNAME'} .
+ "-$version");
+ if ($self->{'MOZCLIENT_EMBEDDED'} || $self->{'MOZCLIENT_WANTMOZDIR'}) {
+ $self->mkdir("$work_dir/" . $self->{'MOZCLIENT_APPNAME'} . "-$version",
+ 0755);
+ }
+ if ($self->{'MOZCLIENT_EMBEDDED'}) {
+ $self->chdir($work_dir);
+ my $cmd = sprintf "tar jcf %s-%s/%s-%s-source.tar.bz2 %s mozilla",
+ $self->{'MOZCLIENT_APPNAME'}, $version, $self->{'MOZCLIENT_PROJECT'},
+ $tversion, $tar_exclude;
+ $self->exec($cmd);
+ $self->chdir("..");
+ }
+ else {
+ $self->exec("mv $work_dir/mozilla $work_dir/" .
+ $self->{'MOZCLIENT_APPNAME'} . "-$version/");
+ }
+ $self->unlink($self->{'MOZCLIENT_APPNAME'} . "_$version.orig.tar.gz")
+ if -f $self->{'MOZCLIENT_APPNAME'} . "_$version.orig.tar.gz";
+ $self->chdir($work_dir);
+ my $cmd = sprintf "tar zcf ../%s_%s.orig.tar.gz %s %s-%s",
+ $self->{'MOZCLIENT_APPNAME'}, $version, $tar_exclude,
+ $self->{'MOZCLIENT_APPNAME'}, $version;
+ $self->exec2($cmd);
+ $self->chdir("..");
+ $self->exec("rm -rf $work_dir");
+ $self->exec("ls -l " . $self->{'MOZCLIENT_APPNAME'} .
+ "_$version.orig.tar.gz");
+}
+
+############################################################################
+
+package MozClient::CVS;
+
+use vars qw(@ISA);
+use strict;
+
+@ISA = ("MozClient");
+
+# Return the list of TAGs known by the VCS for MOZCLIENT_FILE
+sub list_tags {
+ my $self = shift;
+
+ $self->LOG("MozClient::CVS::list_tags()");
+ $self->chdir($work_dir);
+ $self->exec("cvs -d " . $self->{'MOZCLIENT_CVS_LOC'} . " co " .
+ (join ' ', @{$self->{'MOZCLIENT_FILE'}}));
+ my $file = ${$self->{'MOZCLIENT_FILE'}}[0];
+ $file =~ s,^([^/]*)/,,;
+ $self->chdir("$1");
+ $self->exec("cvs status -v $file");
+ $self->chdir("../..");
+}
+
+sub do_dynamic_tag {
+ my $self = shift;
+
+ $self->LOG("MozClient::CVS::do_dynamic_tag()");
+ # We want a dynamic TAG. Fetch files listed in MOZCLIENT_DYNTAG_FILES, then
+ # apply MOZCLIENT_DYNTAG rule to set $want_tag
+ die "Error: Missing MOZCLIENT_DYNTAG_FILES\n"
+ unless defined $self->{'MOZCLIENT_DYNTAG_FILES'};
+ $self->chdir($work_dir);
+ my $date = "";
+ $date = '-D "' . $self->convert_revdate($self->{'have_date'}) . '"'
+ if defined $self->{'have_date'};
+ undef $self->{'have_date'};
+ my $cmd = sprintf "cvs -d %s co %s", $self->{'MOZCLIENT_CVS_LOC'},
+ $self->{'MOZCLIENT_DYNTAG_FILES'};
+ $self->exec($cmd);
+ chomp($self->{'want_tag'} = `$self->{'MOZCLIENT_DYNTAG'}`);
+ $self->LOG2("\$ want_tag=`" . $self->{'MOZCLIENT_DYNTAG'} . "` # => " .
+ $self->{'want_tag'});
+ $self->chdir("..");
+}
+
+sub get_client {
+ my $self = shift;
+
+ $self->LOG("MozClient::CVS::get_client()");
+ my $tbranch = defined $self->{'want_branch'} ?
+ "-r " . $self->{'want_branch'} : "";
+
+ $self->chdir($work_dir);
+ my $cmd = sprintf "cvs -d %s co %s %s %s %s", $self->{'MOZCLIENT_CVS_LOC'},
+ $tbranch, $self->{'mozclient_date'}, $self->{'co_tag'},
+ $self->{'MOZILLA_CLIENT'};
+ $self->exec($cmd);
+ $self->chdir("..");
+
+ if (defined $self->{'MOZCLIENT_WANTPATCH'} &&
+ $self->{'MOZCLIENT_WANTPATCH'}) {
+ $self->exec("ln -s " . $self->{'MOZCLIENT_PATCHES'} .
+ " $work_dir/patches");
+ $self->chdir($work_dir);
+ $self->exec("quilt --quiltrc /dev/null push -a");
+ $self->chdir("..");
+ }
+}
+
+sub convert_revdate {
+ my $self = shift;
+ my $arg = shift;
+
+ $self->LOG("MozClient::CVS::convert_revdate($arg)");
+ $arg =~ s,(....)(..)(..)[rt](..)(..),$1/$2/$3 $4:$5 PST,;
+ $arg;
+}
+
+sub set_revdate {
+ my $self = shift;
+
+ $self->LOG("MozClient::CVS::set_revdate()");
+
+ # We can set a date for CVS
+ if (defined $self->{'MOZCLIENT_PROJECT'}) {
+ $self->{'mozclient_date'} =
+ 'MOZ_CO_DATE="' . $self->convert_revdate($self->{'have_date'}) . '"';
+ }
+ else {
+ $self->{'mozclient_date'} =
+ '-D "' . $self->convert_revdate($self->{'have_date'}) . '"';
+ }
+}
+
+sub checkout {
+ my $self = shift;
+
+ $self->LOG("MozClient:CVS::checkout:()");
+ $self->chdir($work_dir);
+ if (defined $self->{'MOZCLIENT_PROJECT'}) {
+ my $cmd = sprintf "make -f %s checkout MOZ_CO_PROJECT=%s %s %s",
+ $self->{'MOZILLA_CLIENT'}, $self->{'MOZCLIENT_PROJECT'},
+ $self->{'mozclient_date'}, $self->{'moz_co_tag'};
+ $self->exec($cmd);
+ }
+ else {
+ my $cmd = sprintf "cvs -d %s -q -z 3 co -P -A %s %s %s",
+ $self->{'MOZCLIENT_CVS_LOC'}, $self->{'mozclient_date'},
+ $self->{'co_tag'}, $self->{'MOZCLIENT_MODULES'};
+ $self->exec($cmd);
+ }
+ $self->chdir("..");
+}
+
+sub tar_exclude {
+ my $self = shift;
+
+ $self->LOG("MozClient::CVS::tar_exclude()");
+ [ '--exclude CVS', '--exclude .cvsignore' ];
+}
+
+############################################################################
+
+package MozClient::Mercurial;
+
+use vars qw(@ISA);
+use strict;
+
+@ISA = ("MozClient");
+
+sub get_client {
+ my $self = shift;
+
+ $self->LOG("MozClient::Mercurial::get_client()");
+ # nothing to do
+}
+
+sub convert_revdate {
+ my $self = shift;
+ my $arg = shift;
+
+ $self->LOG("MozClient::Mercurial::convert_revdate($arg)");
+ $arg =~ s,^(\d+).*,$1,;
+ $arg;
+}
+
+sub set_revdate {
+ my $self = shift;
+
+ $self->LOG("MozClient::Mercurial::set_revdate()");
+
+ # We can set a revision for hg
+ $self->{'mozclient_date'} =
+ '-r ' . $self->convert_revdate($self->{'have_date'});
+}
+
+sub checkout {
+ my $self = shift;
+
+ $self->LOG("MozClient:Mercurial::checkout:()");
+ $self->chdir($work_dir);
+ my $modules = [];
+ if (defined $self->{'MOZCLIENT_PROJECT'}) {
+ push @$modules,
+ $self->{'MOZCLIENT_HG_LOC'} . $self->{'MOZCLIENT_PROJECT'} . "/";
+ }
+ else {
+ for my $module (@{$self->{'MOZCLIENT_MODULES'}}) {
+ push @$modules, (sprintf " %s%s/%s", $self->{'MOZCLIENT_HG_LOC'},
+ $self->{'MOZCLIENT_PROJECT'}, $module);
+ }
+ }
+ my $cmd = sprintf "hg clone %s %s mozilla", $self->{'mozclient_date'},
+ join " ", @$modules;
+ $self->exec($cmd);
+ $self->chdir("..");
+}
+
+sub tar_exclude {
+ my $self = shift;
+
+ $self->LOG("MozClient::Mercurial::tar_exclude()");
+ [ '--exclude .hg' ];
+}
+
+############################################################################
+
+package main;
+
+use strict;
+use Getopt::Long qw(:config no_auto_abbrev no_ignore_case
+ require_order bundling);
+
+sub help {
+ print <<EOF;
+mozclient [-b branch] [-t tag] [-d YYYYMMDDtHHmm] project-name
+mozclient [-l] project-name
+ --list-tags|-l list VCS tags
+ --branch|-b branch checkout from a specific branch
+ --date|-d date checkout by date (YYYYMMDDtHHmm)
+ --tag|-t tag checkout using a tag
+ --tag|-t tag=ver checkout using a tag, hard-coding the version
+ --preserve-vcs|-p preserve VCS files
+ --debug|-D increase debug level
+
+ Examples:
+ mozclient.pl nspr
+ => nspr_4.7.2~beta+1.9~cvs20080516t2119.orig.tar.gz
+
+ mozclient.pl --date 20080101t0000 nspr
+ => nspr_4.7~beta+1.9b3~cvs20080101t0000.orig.tar.gz
+
+ mozclient.pl --tag FIREFOX_3_0rc1_RELEASE nspr
+ => nspr_4.7.1+1.9.orig.tar.gz
+
+ mozclient.pl --tag FIREFOX_3_0rc1_RELEASE=1.2.3 nspr
+ => nspr_1.2.3.orig.tar.gz
+EOF
+ exit(0);
+}
+
+sub _split_args {
+ my $str = shift;
+
+ # We want to split words and quoted strings by blanks
+ my @data;
+ while (length($str)) {
+ $str =~ m/^\s/ && do {
+ $str =~ s/^\s+//;
+ 1;
+ } ||
+ $str =~ m/^'/ && do {
+ $str =~ s/^'(.*?)'//;
+ push @data, $1;
+ 1;
+ } ||
+ $str =~ m/^"/ && do {
+ $str =~ s/^"(.*?)"//;
+ push @data, $1;
+ 1;
+ } ||
+ $str =~ m/^\S+=".*?"/ && do {
+ $str =~ s/^(\S+)="(.*?)"//;
+ push @data, "$1=$2";
+ 1;
+ } || do {
+ $str =~ s/^(\S+)//;
+ push @data, $1;
+ };
+ }
+ return \@data;
+}
+
+# Read the project conf file
+sub read_project_file {
+ my $pkg = shift;
+
+ my $file = sprintf "%s/%s.conf", $pkg_conf_dir, $pkg;
+ my $data = {};
+ open(CONF, "$file") || die "Can't open $file: $!\n";
+ while (defined (my $line = <CONF>)) {
+ $line =~ s/([^\\])#.*/$1/; # drop comments, but not \#
+ $line =~ s/(^\s+|\s+$)//;
+ next if $line =~ m/^#/;
+ next if $line =~ m/^\s*$/;
+ $line =~ m/^(\S+)\s*=\s*(.*)/;
+ $$data{$1} = defined $2 && length($2) ? $2 : undef;
+ }
+ close CONF;
+ # Check all mandatory keywords/variables are there
+ my $missing = [];
+ my $extra = [];
+ my $opts = {};
+ map { $$opts{$_} = 1 } @conf_mandatory, @conf_optional;
+ map { push @$extra, $_ unless defined $$opts{$_} } keys %$data;
+ map { push @$missing, $_ unless defined $$data{$_} } @conf_mandatory;
+ if ($#$extra >= 0) {
+ die "# Error in $file: unknown keywords found: " .
+ (join ", ", @$extra) . "\n";
+ }
+ if ($#$missing >= 0) {
+ die "# Error in $file: mandatory keywords missing: " .
+ (join ", ", @$missing) . "\n";
+ }
+ # Set default values
+ map { $$data{$_} = $$defaults{$_} unless defined $$data{$_} }
+ keys %$defaults;
+ # Transform into lists arguments that are supposed to be lists
+ map { $$data{$_} = _split_args($$data{$_}) if defined $$data{$_} }
+ @conf_list;
+
+ return $data;
+}
+
+############################################################################
+
+# Main
+my $opt = {};
+GetOptions($opt,
+ 'debug|D+',
+ 'list-tags|l',
+ 'branch|b=s',
+ 'date|d=s',
+ 'tag|t=s',
+ 'preserve-vcs|p') || &help();
+
+&help() unless $#ARGV >= 0;
+
+my $conf = &read_project_file(shift @ARGV);
+
+my $client;
+my $vcs = $$conf{'MOZCLIENT_VCS'};
+$vcs eq 'cvs' && do { $client = MozClient::CVS->new($conf, $opt); 1; } ||
+$vcs eq 'hg' && do { $client = MozClient::Mercurial->new($conf, $opt); 1; } ||
+do {
+ die "VCS '$$conf{'MOZCLIENT_VCS'}' not supported yet";
+};
+
+$client->check_dependencies();
+$client->prepare_dir();
+
+if ($client->want_list_tags) {
+ $client->list_tags();
+ $client->cleanup_dir();
+ exit(0);
+}
+
+$client->setup();
+
+# We need the mozilla client if we want to fetch a project
+$client->get_client() if defined $client->{'MOZCLIENT_PROJECT'};
+
+# We also want to checkout using a date or a revision to avoid been
+# caught in mid-air with another commit, unless a tag is requested
+$client->set_revdate() unless defined $client->{'want_tag'};
+
+if (!defined $client->{'have_date'} && !defined $client->{'want_tag'}) {
+ die "Error: neither date nor tag found. Did getdate failed ?";
+}
+
+# Finally do the real checkout
+$client->checkout();
+
+# Do post-co commands if we have to
+$client->do_post_co_commands() if defined $client->{'MOZCLIENT_POSTCOCMD'};
+
+# Remove binary only files and preserve a log file if we indeed removed
+# something. In case we didn't, drop the log file
+$client->nobin_cleanup();
+
+# Create the tarball
+$client->pack();
diff --git a/src/mozclient/firefox-3.0-full.conf b/src/mozclient/firefox-3.0-full.conf
new file mode 100644
index 0000000..e4c28ad
--- /dev/null
+++ b/src/mozclient/firefox-3.0-full.conf
@@ -0,0 +1,25 @@
+# Copyright (c) 2007-2008 Fabien Tassin <fta@sofaraway.org>
+# Project: firefox-3.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_APPNAME = firefox-3.0
+MOZCLIENT_PROJECT = browser
+MOZCLIENT_VCS = cvs
+MOZCLIENT_FILE = mozilla/browser/config/version.txt
+MOZCLIENT_GETVERSION = sed -e 's/pre//; s/a\([0-9]*\)/~alpha\1/; s/b\([0-9]*\)/~b\1/' mozilla/browser/config/version.txt
+MOZCLIENT_GETDATE = wget -O - -q --read-timeout=10 --user-agent='' --tries=3 'http://bonsai.mozilla.org/cvsquery.cgi?treeid=default&module=SeaMonkeyBrowser&branch=HEAD&branchtype=match&dir=&file=&filetype=match&who=&whotype=match&sortby=Date&hours=2&date=week&mindate=&maxdate=&cvsroot=%2Fcvsroot' 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
diff --git a/src/mozclient/firefox-3.0.conf b/src/mozclient/firefox-3.0.conf
new file mode 100644
index 0000000..4213cc9
--- /dev/null
+++ b/src/mozclient/firefox-3.0.conf
@@ -0,0 +1,26 @@
+# Copyright (c) 2007-2008 Fabien Tassin <fta@sofaraway.org>
+# Project: firefox-3.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_APPNAME = firefox-3.0
+MOZCLIENT_PROJECT = xulbrowser
+MOZCLIENT_VCS = cvs
+MOZCLIENT_FILE = mozilla/browser/config/version.txt
+MOZCLIENT_GETVERSION = sed -e 's/pre//; s/a\([0-9]*\)/~alpha\1/; s/b\([0-9]*\)/~b\1/' mozilla/browser/config/version.txt
+MOZCLIENT_GETDATE = wget -O - -q --read-timeout=10 --user-agent='' --tries=3 'http://bonsai.mozilla.org/cvsquery.cgi?treeid=default&module=SeaMonkeyBrowser&branch=HEAD&branchtype=match&dir=&file=&filetype=match&who=&whotype=match&sortby=Date&hours=2&date=week&mindate=&maxdate=&cvsroot=%2Fcvsroot' 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
diff --git a/src/mozclient/firefox-3.1.conf b/src/mozclient/firefox-3.1.conf
new file mode 100644
index 0000000..b4514bf
--- /dev/null
+++ b/src/mozclient/firefox-3.1.conf
@@ -0,0 +1,26 @@
+# Copyright (c) 2008 Fabien Tassin <fta@sofaraway.org>
+# Description: Project firefox 3.1
+#
+# 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_APPNAME = firefox-3.1
+MOZCLIENT_PROJECT = mozilla-central
+MOZCLIENT_VCS = hg
+MOZCLIENT_FILE = mozilla/browser/config/version.txt
+MOZCLIENT_GETVERSION = sed -e 's/pre//; s/\([ab]\)\([0-9]*\)/~\1\2/' mozilla/browser/config/version.txt
+MOZCLIENT_POSTCOCMD = cd mozilla && python client.py checkout
+MOZCLIENT_GETDATE = wget -O - -q --read-timeout=10 --user-agent='' --tries=3 http://hg.mozilla.org/index.cgi/mozilla-central/log 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
diff --git a/src/mozclient/firefox-4.0.conf b/src/mozclient/firefox-4.0.conf
new file mode 100644
index 0000000..49b166e
--- /dev/null
+++ b/src/mozclient/firefox-4.0.conf
@@ -0,0 +1,26 @@
+# 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_APPNAME = firefox-4.0
+MOZCLIENT_PROJECT = mozilla-central
+MOZCLIENT_VCS = hg
+MOZCLIENT_FILE = mozilla/browser/config/version.txt
+MOZCLIENT_GETVERSION = sed -e 's/pre//; s/\([ab]\)\([0-9]*\)/~\1\2/' mozilla/browser/config/version.txt
+MOZCLIENT_POSTCOCMD = cd mozilla && python client.py checkout
+MOZCLIENT_GETDATE = wget -O - -q --read-timeout=10 --user-agent='' --tries=3 http://hg.mozilla.org/index.cgi/mozilla-central/log 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
diff --git a/src/mozclient/lightning-sunbird.conf b/src/mozclient/lightning-sunbird.conf
new file mode 100644
index 0000000..5d5a05d
--- /dev/null
+++ b/src/mozclient/lightning-sunbird.conf
@@ -0,0 +1,26 @@
+# Copyright (c) 2007-2008 Fabien Tassin <fta@sofaraway.org>
+# Description: Project Sunbird 0.* (MOZILLA_1_8_BRANCH)
+#
+# 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_APPNAME = lightning-sunbird
+MOZCLIENT_PROJECT = calendar
+MOZCLIENT_BRANCH = MOZILLA_1_8_BRANCH
+MOZCLIENT_VCS = cvs
+MOZCLIENT_FILE = mozilla/calendar/sunbird/config/version.txt
+MOZCLIENT_GETVERSION = tail -1 mozilla/calendar/sunbird/config/version.txt | sed -e 's/pre//; s/\([ab]\)\([0-9]*\)/~\1\2/'
+MOZCLIENT_GETDATE = wget -O - -q --read-timeout=10 --user-agent='' --tries=3 'http://bonsai.mozilla.org/cvsquery.cgi?treeid=default&module=CalendarClient&branch=MOZILLA_1_8_BRANCH&branchtype=match&dir=&file=&filetype=match&who=&whotype=match&sortby=Date&hours=2&date=week&mindate=&maxdate=&cvsroot=%2Fcvsroot' 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
diff --git a/src/mozclient/nspr.conf b/src/mozclient/nspr.conf
new file mode 100644
index 0000000..36ad1e3
--- /dev/null
+++ b/src/mozclient/nspr.conf
@@ -0,0 +1,27 @@
+# Copyright (c) 2007-2008 Fabien Tassin <fta@sofaraway.org>
+# Project: nspr
+#
+# 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_APPNAME = nspr
+MOZCLIENT_PROJECT = # null
+MOZCLIENT_VCS = cvs
+MOZCLIENT_MODULES = mozilla/nsprpub
+MOZCLIENT_FILE = mozilla/nsprpub/pr/include/prinit.h
+MOZCLIENT_GETVERSION = ( grep -E '^\#define PR_VERSION' mozilla/nsprpub/pr/include/prinit.h | cut -d\" -f2 | tr 'A-Z' 'a-z' | sed -e 's/beta /beta/' -e 's/ */~/g' -e 's/$/+/' ; tail -1 mozilla/config/milestone.txt | sed -e 's/pre/~cvs/') | tr -d '\n'
+MOZCLIENT_GETDATE = wget -O - -q --read-timeout=10 --user-agent='' --tries=3 'http://bonsai.mozilla.org/cvsquery.cgi?treeid=default&module=all&branch=HEAD&branchtype=match&dir=mozilla%2Fnsprpub&file=&filetype=match&who=&whotype=match&sortby=Date&hours=2&date=explicit&mindate=1177522884&maxdate=1588258884&cvsroot=%2Fcvsroot' 2> /dev/null | grep "href='http://webtools" | head -1 | tr '<>' '@' | cut -d@ -f5 | tr -d ':-' | sed -e 's/&nbsp;/t/'
+MOZCLIENT_WANTMOZDIR = 1
+MOZCLIENT_DYNTAG_FILES = mozilla/client.mk mozilla/config/milestone.txt
+MOZCLIENT_DYNTAG = grep ^NSPR_CO_TAG mozilla/client.mk | awk '{ print $3 }'
diff --git a/src/mozclient/nss.conf b/src/mozclient/nss.conf
new file mode 100644
index 0000000..14a7a3e
--- /dev/null
+++ b/src/mozclient/nss.conf
@@ -0,0 +1,27 @@
+# Copyright (c) 2007-2008 Fabien Tassin <fta@sofaraway.org>
+# Project: nss
+#
+# 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_APPNAME = nss
+MOZCLIENT_PROJECT = # null
+MOZCLIENT_VCS = cvs
+MOZCLIENT_MODULES = mozilla/dbm mozilla/security/coreconf mozilla/security/dbm mozilla/security/nss
+MOZCLIENT_FILE = mozilla/security/nss/lib/nss/nss.h
+MOZCLIENT_GETVERSION = ( grep '^\#define NSS_VERSION' mozilla/security/nss/lib/nss/nss.h | cut -d'"' -f2 | sed -e 's,$,+,' ; tail -1 mozilla/config/milestone.txt | sed -e 's/pre/~cvs/') | tr -d '\n'
+MOZCLIENT_GETDATE = wget -O - -q --read-timeout=10 --user-agent='' --tries=3 'http://bonsai.mozilla.org/cvsquery.cgi?treeid=NSS&module=all&branch=HEAD&branchtype=match&dir=mozilla%2Fdbm+mozilla%2Fsecurity%2Fnss+mozilla%2Fsecurity%2Fcoreconf+mozilla%2Fsecurity%2Fdbm&file=&filetype=match&who=&whotype=match&sortby=Date&hours=2&date=month&mindate=&maxdate=&cvsroot=%2Fcvsroot' 2> /dev/null | grep "href='http://webtools" | head -1 | tr '<>' '@' | cut -d@ -f5 | tr -d ':-' | sed -e 's/&nbsp;/t/'
+MOZCLIENT_WANTMOZDIR = 1
+MOZCLIENT_DYNTAG_FILES = mozilla/client.mk mozilla/config/milestone.txt
+MOZCLIENT_DYNTAG = grep ^NSS_CO_TAG mozilla/client.mk | awk '{ print $3 }'
diff --git a/src/patches/series b/src/mozclient/patches/series
index 9ab520f..9ab520f 100644
--- a/src/patches/series
+++ b/src/mozclient/patches/series
diff --git a/src/patches/xulbrowser_target.patch b/src/mozclient/patches/xulbrowser_target.patch
index 5355c88..5355c88 100644
--- a/src/patches/xulbrowser_target.patch
+++ b/src/mozclient/patches/xulbrowser_target.patch
diff --git a/src/mozclient/seamonkey-2.0.conf b/src/mozclient/seamonkey-2.0.conf
new file mode 100644
index 0000000..ec75a85
--- /dev/null
+++ b/src/mozclient/seamonkey-2.0.conf
@@ -0,0 +1,24 @@
+# Copyright (c) 2007-2008 Fabien Tassin <fta@sofaraway.org>
+# Description: Project SeaMonkey 2.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_APPNAME = seamonkey-2.0
+MOZCLIENT_PROJECT = suite
+MOZCLIENT_VCS = cvs
+MOZCLIENT_FILE = mozilla/suite/config/version.txt
+MOZCLIENT_GETVERSION = tail -1 mozilla/suite/config/version.txt | sed -e 's/pre//; s/\([ab]\)\([0-9]*\)/~\1\2/'
+MOZCLIENT_GETDATE = wget -O - -q --read-timeout=10 --user-agent='' --tries=3 'http://bonsai.mozilla.org/cvsquery.cgi?treeid=default&module=SeaMonkeyBrowser&branch=HEAD&branchtype=match&dir=&file=&filetype=match&who=&whotype=match&sortby=Date&hours=2&date=week&mindate=&maxdate=&cvsroot=%2Fcvsroot' 2> /dev/null | grep "href='http://webtools" | head -1 | tr '<>' '@' | cut -d@ -f5 | tr -d ':-' | sed -e 's/&nbsp;/t/'
+MOZCLIENT_WANTMOZDIR = 0
diff --git a/src/mozclient/thunderbird-2.0.conf b/src/mozclient/thunderbird-2.0.conf
new file mode 100644
index 0000000..e48c4cc
--- /dev/null
+++ b/src/mozclient/thunderbird-2.0.conf
@@ -0,0 +1,26 @@
+# Copyright (c) 2007-2008 Fabien Tassin <fta@sofaraway.org>
+# Description: Project Thunderbird 2.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_APPNAME = thunderbird
+MOZCLIENT_PROJECT = mail
+MOZCLIENT_VCS = cvs
+MOZCLIENT_BRANCH = MOZILLA_1_8_BRANCH
+MOZCLIENT_FILE = mozilla/mail/config/version.txt
+MOZCLIENT_GETVERSION = tail -1 mozilla/mail/config/version.txt | sed -e 's/pre//; s/\([ab]\)\([0-9]*\)/~\1\2/'
+MOZCLIENT_GETDATE = wget -O - -q --read-timeout=10 --user-agent='' --tries=3 'http://bonsai.mozilla.org/cvsquery.cgi?treeid=default&module=all&branch=MOZILLA_1_8_0_BRANCH&branchtype=match&dir=&file=&filetype=match&who=&whotype=match&sortby=Date&hours=2&date=explicit&mindate=2007-12-01+00%3A00%3A00&maxdate=2017-12-10+00%3A00%3A00&cvsroot=%2Fcvsroot' 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
diff --git a/src/mozclient/thunderbird-3.0.conf b/src/mozclient/thunderbird-3.0.conf
new file mode 100644
index 0000000..8af133e
--- /dev/null
+++ b/src/mozclient/thunderbird-3.0.conf
@@ -0,0 +1,24 @@
+# Copyright (c) 2007-2008 Fabien Tassin <fta@sofaraway.org>
+# Description: Project Thunderbird 3.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_APPNAME = thunderbird-3.0
+MOZCLIENT_PROJECT = mail
+MOZCLIENT_VCS = cvs
+MOZCLIENT_FILE = mozilla/mail/config/version.txt
+MOZCLIENT_GETVERSION = tail -1 mozilla/mail/config/version.txt | sed -e 's/pre//; s/\([ab]\)\([0-9]*\)/~\1\2/'
+MOZCLIENT_GETDATE = wget -O - -q --read-timeout=10 --user-agent='' --tries=3 'http://bonsai.mozilla.org/cvsquery.cgi?treeid=default&module=SeaMonkeyMailNews&branch=HEAD&branchtype=match&dir=&file=&filetype=match&who=&whotype=match&sortby=Date&hours=2&date=week&mindate=&maxdate=&cvsroot=%2Fcvsroot' 2> /dev/null | grep "href='http://webtools" | head -1 | tr '<>' '@' | cut -d@ -f5 | tr -d ':-' | sed -e 's/&nbsp;/t/'
+MOZCLIENT_WANTMOZDIR = 1
diff --git a/src/mozclient/xulrunner-1.8.conf b/src/mozclient/xulrunner-1.8.conf
new file mode 100644
index 0000000..aefd8e2
--- /dev/null
+++ b/src/mozclient/xulrunner-1.8.conf
@@ -0,0 +1,25 @@
+# Copyright (c) 2008 Fabien Tassin <fta@sofaraway.org>
+# Description: Project XULRunner 1.8
+#
+# 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_APPNAME = xulrunner
+MOZCLIENT_PROJECT = xulrunner
+MOZCLIENT_VCS = cvs
+MOZCLIENT_BRANCH = MOZILLA_1_8_BRANCH
+MOZCLIENT_FILE = mozilla/config/milestone.txt
+MOZCLIENT_GETVERSION = tail -1 mozilla/config/milestone.txt | sed -e 's/pre//; s/\([ab]\)\([0-9]*\)/~\1\2/'
+MOZCLIENT_GETDATE = wget -O - -q --read-timeout=10 --user-agent='' --tries=3 'http://bonsai.mozilla.org/cvsquery.cgi?treeid=default&module=SeaMonkeyBrowser&branch=MOZILLA_1_8_BRANCH&branchtype=match&dir=&file=&filetype=match&who=&whotype=match&sortby=Date&hours=2&date=week&mindate=&maxdate=&cvsroot=%2Fcvsroot' 2> /dev/null | grep "href='http://webtools" | head -1 | tr '<>' '@' | cut -d@ -f5 | tr -d ':-' | sed -e 's/&nbsp;/t/'
+MOZCLIENT_WANTMOZDIR = 0
diff --git a/src/mozclient/xulrunner-1.9.1.conf b/src/mozclient/xulrunner-1.9.1.conf
new file mode 100644
index 0000000..d65aeba
--- /dev/null
+++ b/src/mozclient/xulrunner-1.9.1.conf
@@ -0,0 +1,26 @@
+# Copyright (c) 2008 Fabien Tassin <fta@sofaraway.org>
+# Description: Project XULRunner 1.9.1
+#
+# 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_APPNAME = xulrunner-1.9.1
+MOZCLIENT_PROJECT = mozilla-central
+MOZCLIENT_FILE = mozilla/config/milestone.txt
+MOZCLIENT_GETVERSION = tail -1 mozilla/config/milestone.txt | sed -e 's/pre//; s/\([ab]\)\([0-9]*\)/~\1\2/'
+MOZCLIENT_VCS = hg
+MOZCLIENT_POSTCOCMD = cd mozilla && python client.py checkout
+MOZCLIENT_GETDATE = wget -O - -q --read-timeout=10 --user-agent='' --tries=3 http://hg.mozilla.org/index.cgi/mozilla-central/log 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
diff --git a/src/mozclient/xulrunner-1.9.conf b/src/mozclient/xulrunner-1.9.conf
new file mode 100644
index 0000000..ad67d4b
--- /dev/null
+++ b/src/mozclient/xulrunner-1.9.conf
@@ -0,0 +1,24 @@
+# Copyright (c) 2007-2008 Fabien Tassin <fta@sofaraway.org>
+# Project: xulrunner-1.9
+#
+# 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_APPNAME = xulrunner-1.9
+MOZCLIENT_PROJECT = xulrunner
+MOZCLIENT_VCS = cvs
+MOZCLIENT_FILE = mozilla/config/milestone.txt
+MOZCLIENT_GETVERSION = tail -1 mozilla/config/milestone.txt | sed -e 's/pre//; s/\([ab]\)\([0-9]*\)/~\1\2/'
+MOZCLIENT_GETDATE = wget -O - -q --read-timeout=10 --user-agent='' --tries=3 'http://bonsai.mozilla.org/cvsquery.cgi?treeid=default&module=SeaMonkeyBrowser&branch=HEAD&branchtype=match&dir=&file=&filetype=match&who=&whotype=match&sortby=Date&hours=2&date=week&mindate=&maxdate=&cvsroot=%2Fcvsroot' 2> /dev/null | grep "href='http://webtools" | head -1 | tr '<>' '@' | cut -d@ -f5 | tr -d ':-' | sed -e 's/&nbsp;/t/'
+MOZCLIENT_WANTMOZDIR = 1
diff --git a/src/mozclient/xulrunner-2.0.conf b/src/mozclient/xulrunner-2.0.conf
new file mode 100644
index 0000000..4d4c865
--- /dev/null
+++ b/src/mozclient/xulrunner-2.0.conf
@@ -0,0 +1,26 @@
+# Copyright (c) 2008 Fabien Tassin <fta@sofaraway.org>
+# Description: Project XULRunner 2.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_APPNAME = xulrunner-2.0
+MOZCLIENT_PROJECT = mozilla-central
+MOZCLIENT_FILE = mozilla/config/milestone.txt
+MOZCLIENT_GETVERSION = tail -1 mozilla/config/milestone.txt | sed -e 's/pre//; s/\([ab]\)\([0-9]*\)/~\1\2/'
+MOZCLIENT_VCS = hg
+MOZCLIENT_POSTCOCMD = cd mozilla && python client.py checkout
+MOZCLIENT_GETDATE = wget -O - -q --read-timeout=10 --user-agent='' --tries=3 http://hg.mozilla.org/index.cgi/mozilla-central/log 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
diff --git a/src/nspr.mk.in b/src/nspr.mk.in
index 4c7c5d8..1653856 100644
--- a/src/nspr.mk.in
+++ b/src/nspr.mk.in
@@ -17,14 +17,6 @@
# with this program; if not, write to the Free Software Foundation, Inc.,
# 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
-MOZCLIENT_TARGET := nspr-orig
-MOZCLIENT_APPNAME := nspr
-MOZCLIENT_PROJECT := $(NULL)
-MOZCLIENT_MODULES := mozilla/nsprpub
-MOZCLIENT_FILE := mozilla/nsprpub/pr/include/prinit.h mozilla/config/milestone.txt
-MOZCLIENT_GETVERSION := ( grep -E '^\#define PR_VERSION' mozilla/nsprpub/pr/include/prinit.h | cut -d\" -f2 | tr 'A-Z' 'a-z' | sed -e 's/beta /beta/' -e 's/ */~/g' -e 's/$$/+/' ; tail -1 mozilla/config/milestone.txt | sed -e 's/pre//') | tr -d '\n'
-MOZCLIENT_URL := 'http://bonsai.mozilla.org/cvsquery.cgi?treeid=default&module=all&branch=HEAD&branchtype=match&dir=mozilla%2Fnsprpub&file=&filetype=match&who=&whotype=match&sortby=Date&hours=2&date=explicit&mindate=1177522884&maxdate=1588258884&cvsroot=%2Fcvsroot'
-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_WANTMOZDIR := 1
+MOZCLIENT_PROJECTNAME := nspr
include mozclient.mk.in
diff --git a/src/nss.mk.in b/src/nss.mk.in
index 7a33ad9..a56fef0 100644
--- a/src/nss.mk.in
+++ b/src/nss.mk.in
@@ -1,6 +1,6 @@
# -*- mode: makefile; coding: utf-8 -*-
-# Copyright (c) 2007 Fabien Tassin <fta@sofaraway.org>
+# Copyright (c) 2007-2008 Fabien Tassin <fta@sofaraway.org>
# Description: Project NSS
#
# This program is free software; you can redistribute it and/or
@@ -17,14 +17,6 @@
# with this program; if not, write to the Free Software Foundation, Inc.,
# 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
-MOZCLIENT_TARGET := nss-orig
-MOZCLIENT_APPNAME := nss
-MOZCLIENT_PROJECT := $(NULL)
-MOZCLIENT_MODULES := mozilla/dbm mozilla/security/coreconf mozilla/security/dbm mozilla/security/nss
-MOZCLIENT_FILE := mozilla/security/nss/lib/nss/nss.h mozilla/config/milestone.txt
-MOZCLIENT_GETVERSION := ( grep -E '^\#define NSS_V(MAJOR|MINOR|PATCH)' $(MOZCLIENT_FILE) | awk '{print $$3}' | tr '\n' '.' | sed -e 's,\.$$,+,' ; tail -1 mozilla/config/milestone.txt | sed -e 's/pre//') | tr -d '\n'
-MOZCLIENT_URL := 'http://bonsai.mozilla.org/cvsquery.cgi?treeid=NSS&module=all&branch=HEAD&branchtype=match&dir=mozilla%2Fdbm+mozilla%2Fsecurity%2Fnss+mozilla%2Fsecurity%2Fcoreconf+mozilla%2Fsecurity%2Fdbm&file=&filetype=match&who=&whotype=match&sortby=Date&hours=2&date=month&mindate=&maxdate=&cvsroot=%2Fcvsroot'
-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_WANTMOZDIR := 1
+MOZCLIENT_PROJECTNAME := nss
include mozclient.mk.in
diff --git a/src/seamonkey-2.0.mk.in b/src/seamonkey-2.0.mk.in
index d934545..fcdb673 100644
--- a/src/seamonkey-2.0.mk.in
+++ b/src/seamonkey-2.0.mk.in
@@ -17,14 +17,7 @@
# with this program; if not, write to the Free Software Foundation, Inc.,
# 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
-MOZCLIENT_TARGET := seamonkey-2.0.orig
-MOZCLIENT_APPNAME := seamonkey-2.0
-MOZCLIENT_PROJECT := suite
-MOZCLIENT_FILE := mozilla/suite/config/version.txt
-MOZCLIENT_GETVERSION := tail -1 $(MOZCLIENT_FILE) | sed -e 's/pre//; s/\([ab]\)\([0-9]*\)/~\1\2/'
-MOZCLIENT_URL := 'http://bonsai.mozilla.org/cvsquery.cgi?treeid=default&module=SeaMonkeyBrowser&branch=HEAD&branchtype=match&dir=&file=&filetype=match&who=&whotype=match&sortby=Date&hours=2&date=week&mindate=&maxdate=&cvsroot=%2Fcvsroot'
-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_WANTMOZDIR := 0
+MOZCLIENT_PROJECTNAME := seamonkey-2.0
include mozclient.mk.in
diff --git a/src/thunderbird-2.0.mk.in b/src/thunderbird-2.0.mk.in
index 1c63cc7..1e1a01f 100644
--- a/src/thunderbird-2.0.mk.in
+++ b/src/thunderbird-2.0.mk.in
@@ -1,6 +1,6 @@
# -*- mode: makefile; coding: utf-8 -*-
-# Copyright (c) 2007 Fabien Tassin <fta@sofaraway.org>
+# Copyright (c) 2007-2008 Fabien Tassin <fta@sofaraway.org>
# Description: Project Thunderbird 2.0
#
# This program is free software; you can redistribute it and/or
@@ -17,15 +17,6 @@
# with this program; if not, write to the Free Software Foundation, Inc.,
# 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
-MOZCLIENT_TARGET := thunderbird-2.0-orig
-MOZCLIENT_APPNAME := thunderbird
-MOZCLIENT_PROJECT := mail
-MOZCLIENT_BRANCH := MOZILLA_1_8_BRANCH
-MOZCLIENT_FILE := mozilla/mail/config/version.txt
-MOZCLIENT_GETVERSION := tail -1 $(MOZCLIENT_FILE) | sed -e 's/pre//; s/\([ab]\)\([0-9]*\)/~\1\2/'
-MOZCLIENT_URL := 'http://bonsai.mozilla.org/cvsquery.cgi?treeid=default&module=all&branch=MOZILLA_1_8_0_BRANCH&branchtype=match&dir=&file=&filetype=match&who=&whotype=match&sortby=Date&hours=2&date=explicit&mindate=2007-12-01+00%3A00%3A00&maxdate=2017-12-10+00%3A00%3A00&cvsroot=%2Fcvsroot'
-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_PROJECTNAME := thunderbird-2.0
include mozclient.mk.in
diff --git a/src/thunderbird-3.0.mk.in b/src/thunderbird-3.0.mk.in
index 98ff0a0..dc9c231 100644
--- a/src/thunderbird-3.0.mk.in
+++ b/src/thunderbird-3.0.mk.in
@@ -17,14 +17,7 @@
# with this program; if not, write to the Free Software Foundation, Inc.,
# 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
-MOZCLIENT_TARGET := thunderbird-3.0-orig
-MOZCLIENT_APPNAME := thunderbird-3.0
-MOZCLIENT_PROJECT := mail
-MOZCLIENT_FILE := mozilla/mail/config/version.txt
-MOZCLIENT_GETVERSION := tail -1 $(MOZCLIENT_FILE) | sed -e 's/pre//; s/\([ab]\)\([0-9]*\)/~\1\2/'
-MOZCLIENT_URL := 'http://bonsai.mozilla.org/cvsquery.cgi?treeid=default&module=SeaMonkeyMailNews&branch=HEAD&branchtype=match&dir=&file=&filetype=match&who=&whotype=match&sortby=Date&hours=2&date=week&mindate=&maxdate=&cvsroot=%2Fcvsroot'
-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_WANTMOZDIR := 1
+MOZCLIENT_PROJECTNAME := thunderbird-3.0
include mozclient.mk.in
diff --git a/src/xulrunner-1.8.mk.in b/src/xulrunner-1.8.mk.in
index ec5eb06..30ced26 100644
--- a/src/xulrunner-1.8.mk.in
+++ b/src/xulrunner-1.8.mk.in
@@ -17,14 +17,6 @@
# with this program; if not, write to the Free Software Foundation, Inc.,
# 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
-MOZCLIENT_TARGET := xulrunner-1.8-orig
-MOZCLIENT_APPNAME := xulrunner
-MOZCLIENT_PROJECT := xulrunner
-MOZCLIENT_BRANCH := MOZILLA_1_8_BRANCH
-MOZCLIENT_FILE := mozilla/config/milestone.txt
-MOZCLIENT_GETVERSION := tail -1 $(MOZCLIENT_FILE) | sed -e 's/pre//; s/\([ab]\)\([0-9]*\)/~\1\2/'
-MOZCLIENT_URL := 'http://bonsai.mozilla.org/cvsquery.cgi?treeid=default&module=SeaMonkeyBrowser&branch=MOZILLA_1_8_BRANCH&branchtype=match&dir=&file=&filetype=match&who=&whotype=match&sortby=Date&hours=2&date=week&mindate=&maxdate=&cvsroot=%2Fcvsroot'
-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_WANTMOZDIR := 0
+MOZCLIENT_PROJECTNAME := xulrunner-1.8
include mozclient.mk.in
diff --git a/src/xulrunner-1.9.1.mk.in b/src/xulrunner-1.9.1.mk.in
index 9552ac3..0396ee5 100644
--- a/src/xulrunner-1.9.1.mk.in
+++ b/src/xulrunner-1.9.1.mk.in
@@ -17,22 +17,7 @@
# with this program; if not, write to the Free Software Foundation, Inc.,
# 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
-MOZCLIENT_TARGET := xulrunner-1.9.1-orig
-MOZCLIENT_APPNAME := xulrunner-1.9.1
-MOZCLIENT_PROJECT := mozilla-central
-MOZCLIENT_FILE := mozilla/config/milestone.txt
-MOZCLIENT_GETVERSION := tail -1 $(MOZCLIENT_FILE) | sed -e 's/pre//; s/\([ab]\)\([0-9]*\)/~\1\2/'
-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
+MOZCLIENT_PROJECTNAME := xulrunner-1.9.1
include mozclient.mk.in
diff --git a/src/xulrunner-1.9.mk.in b/src/xulrunner-1.9.mk.in
index d5705f7..41faf5c 100644
--- a/src/xulrunner-1.9.mk.in
+++ b/src/xulrunner-1.9.mk.in
@@ -17,14 +17,7 @@
# with this program; if not, write to the Free Software Foundation, Inc.,
# 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
-MOZCLIENT_TARGET := xulrunner-1.9-orig
-MOZCLIENT_APPNAME := xulrunner-1.9
-MOZCLIENT_PROJECT := xulrunner
-MOZCLIENT_FILE := mozilla/config/milestone.txt
-MOZCLIENT_GETVERSION := tail -1 $(MOZCLIENT_FILE) | sed -e 's/pre//; s/\([ab]\)\([0-9]*\)/~\1\2/'
-MOZCLIENT_URL := 'http://bonsai.mozilla.org/cvsquery.cgi?treeid=default&module=SeaMonkeyBrowser&branch=HEAD&branchtype=match&dir=&file=&filetype=match&who=&whotype=match&sortby=Date&hours=2&date=week&mindate=&maxdate=&cvsroot=%2Fcvsroot'
-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_WANTMOZDIR := 1
+MOZCLIENT_PROJECTNAME := xulrunner-1.9
include mozclient.mk.in
diff --git a/src/xulrunner-2.0.mk.in b/src/xulrunner-2.0.mk.in
index a29aa5f..6e41cba 100644
--- a/src/xulrunner-2.0.mk.in
+++ b/src/xulrunner-2.0.mk.in
@@ -17,22 +17,7 @@
# with this program; if not, write to the Free Software Foundation, Inc.,
# 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
-MOZCLIENT_TARGET := xulrunner-2.0-orig
-MOZCLIENT_APPNAME := xulrunner-2.0
-MOZCLIENT_PROJECT := mozilla-central
-MOZCLIENT_FILE := mozilla/config/milestone.txt
-MOZCLIENT_GETVERSION := tail -1 $(MOZCLIENT_FILE) | sed -e 's/pre//; s/\([ab]\)\([0-9]*\)/~\1\2/'
-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
+MOZCLIENT_PROJECTNAME := xulrunner-2.0
include mozclient.mk.in