diff --git a/Makefile.in b/Makefile.in --- a/Makefile.in +++ b/Makefile.in @@ -4,16 +4,17 @@ # file, You can obtain one at http://mozilla.org/MPL/2.0/. DEPTH = ../.. topsrcdir = @top_srcdir@ srcdir = @srcdir@ VPATH = @srcdir@ include $(DEPTH)/config/autoconf.mk +include $(srcdir)/maxversions.mk PACKAGE_FILE = chatzilla.pkg DIST_FILES = xpi/resources/install.rdf CHATZILLA_VERSION=$(shell grep "const __cz_version" "$(srcdir)/xul/content/static.js" | sed "s|.*\"\([^\"]\{1,\}\)\".*|\1|") XPI_NAME = chatzilla @@ -24,17 +25,20 @@ XPI_PKGNAME = chatzilla-$(CHA include $(topsrcdir)/config/config.mk # always build en-US locale, add build locale if supported BUILD_LOCALES = en-US ifneq (,$(filter $(AB_CD),$(shell cat $(srcdir)/locales/all-locales))) BUILD_LOCALES += $(AB_CD) endif -DEFINES += -DCHATZILLA_VERSION=$(CHATZILLA_VERSION) +DEFINES += -DCHATZILLA_VERSION=$(CHATZILLA_VERSION) \ + -DSEAMONKEY_MAXVERSION=$(SEAMONKEY_MAXVERSION) \ + -DFIREFOX_MAXVERSION=$(FIREFOX_MAXVERSION) \ + $(NULL) include $(topsrcdir)/config/rules.mk libs realchrome:: locales/Makefile @$(EXIT_ON_ERROR) \ for locale in $(BUILD_LOCALES); do \ $(MAKE) -C locales AB_CD=$$locale; \ done diff --git a/locales/Makefile.in b/locales/Makefile.in --- a/locales/Makefile.in +++ b/locales/Makefile.in @@ -5,16 +5,18 @@ DEPTH=../../.. topsrcdir=@top_srcdir@ srcdir=@srcdir@ VPATH=@srcdir@ relativesrcdir = extensions/irc/locales +include $(srcdir)/../maxversions.mk + EXTERNALLY_MANAGED_MAKE_FILE := 1 STANDALONE_MAKEFILE := 1 JAR_MANIFEST := $(srcdir)/jar.mn CHATZILLA_VERSION=$(shell grep "const __cz_version" "$(srcdir)/../xul/content/static.js" | sed "s|.*\"\([^\"]\{1,\}\)\".*|\1|") CHATZILLA_BASE_VERSION=$(shell echo "$(CHATZILLA_VERSION)" | sed "s|\([0-9]\{1,\}\.[0-9]\{1,\}\.[0-9]\{1,\}\).*|\1|") XPI_NAME = chatzilla @@ -24,17 +26,20 @@ XPI_PKGNAME = chatzilla-$(CHA # include config.mk before we override the AB_CD var it sets include $(topsrcdir)/config/config.mk # if the wanted language is not in all-locales, fall back to en-US ifeq (,$(filter $(AB_CD),$(shell cat $(srcdir)/all-locales))) override AB_CD = en-US endif -DEFINES += -DAB_CD=$(AB_CD) +DEFINES += -DAB_CD=$(AB_CD) \ + -DSEAMONKEY_MAXVERSION=$(SEAMONKEY_MAXVERSION) \ + -DFIREFOX_MAXVERSION=$(FIREFOX_MAXVERSION) \ + $(NULL) ifneq (en-US,$(AB_CD)) XPI_NAME = chatzilla-$(AB_CD) INSTALL_EXTENSION_ID = langpack-$(AB_CD)@chatzilla.mozilla.org XPI_PKGNAME = chatzilla-$(CHATZILLA_VERSION).$(AB_CD) DIST_FILES = generic/install.rdf XULPPFLAGS += \ -I$(call EXPAND_LOCALE_SRCDIR,toolkit/locales)/defines.inc \ diff --git a/locales/generic/install.rdf b/locales/generic/install.rdf --- a/locales/generic/install.rdf +++ b/locales/generic/install.rdf @@ -33,28 +33,28 @@ 3.6 is Gecko 1.9.2 4.0 is Gecko 2.0 5.0 is Gecko 5.0 x.0 is Gecko x.0, where x is greater than 5 --> {ec8030f7-c20a-464f-9b0e-13a3a9e97384} 3.5 - 19.0a1 + @FIREFOX_MAXVERSION@ {92650c4d-4b8e-4d2a-b7eb-24ecf4f6b63a} 2.0 - 2.20a1 + @SEAMONKEY_MAXVERSION@ true diff --git a/maxversions.mk b/maxversions.mk new file mode 100644 --- /dev/null +++ b/maxversions.mk @@ -0,0 +1,24 @@ +# +# This Source Code Form is subject to the terms of the Mozilla Public +# License, v. 2.0. If a copy of the MPL was not distributed with this +# file, You can obtain one at http://mozilla.org/MPL/2.0/. + + +SEAMONKEY_VERSION := $(shell cat $(topsrcdir)/../suite/config/version.txt) +FIREFOX_VERSION := $(shell cat $(topsrcdir)/browser/config/version.txt) + +# For extensions we require a max version that is compatible across security releases. +# FIREFOX_MAXVERSION and SEAMONKEY_MAXVERSION is our method for doing that. +# Alpha versions 10.0a1 and 10.0a2 aren't affected +# For Seamonkey, 2.17 becomes 2.17.*, 2.17.1 becomes 2.17.* +# For Firefox, 10.0 becomes 10.*, 10.0.1 becomes 10.* +SEAMONKEY_MAXVERSION := $(SEAMONKEY_VERSION) +ifneq (a,$(findstring a,$(SEAMONKEY_VERSION))) +SEAMONKEY_MAXVERSION := $(shell echo $(SEAMONKEY_VERSION) | sed 's|\(^[0-9]*.[0-9]*\).*|\1|' ).* +endif + +FIREFOX_MAXVERSION := $(FIREFOX_VERSION) +ifneq (a,$(findstring a,$(FIREFOX_VERSION))) +FIREFOX_MAXVERSION := $(shell echo $(FIREFOX_VERSION) | sed 's|\(^[0-9]*\)\.\([0-9]*\).*|\1|' ).* +endif + diff --git a/xpi/makexpi.py b/xpi/makexpi.py --- a/xpi/makexpi.py +++ b/xpi/makexpi.py @@ -16,16 +16,20 @@ import os.path import sys import shutil import re import zipfile from os.path import join as joinpath # Set up settings and paths for finding files. pwd = os.path.dirname(__file__) + +ffversion = '44.*' +smversion = '2.41.*' + if pwd == '': pwd = os.getcwd() else: os.chdir(pwd) def getenv(var, default, dir=False, check=False): """ Grab an environment variable, or a default @@ -37,17 +41,17 @@ def getenv(var, default, dir=False, chec if dir: if not os.path.isabs(value): value = os.path.normpath(joinpath(pwd, value)) else: value = os.path.normpath(value) if check and not os.path.isdir(value): print 'ERROR: Directory %s not found.' % value sys.exit(1) - + return value debug = int(getenv('DEBUG', 0)) configdir = getenv('CONFIGDIR', joinpath(pwd, 'config'), dir=True, check=True) # Display all the settings and paths if we're in debug mode. if debug > 0: @@ -60,25 +64,25 @@ sys.path.append(configdir) from Preprocessor import preprocess from JarMaker import JarMaker ## define functions to replace the OS calls from makexpi.sh def echo(str): """ print a string without a newline or trailing space - + generally used in place of "echo -n" from the original code """ sys.stdout.write(str) def rm(path): """ remove file or directory, recurses on directory - + This will fail silently if the file is not found but any other exceptions will be raised """ try: if os.path.isdir(path): shutil.rmtree(path) else: os.remove(path) @@ -113,17 +117,17 @@ def sed((pattern, replacement), input, o regex = re.compile(pattern) for line in input: line = regex.sub(replacement, line) output.write(line) def zip(filename, source_dir, include=None, exclude=None): """ create a zip file of a directory's contents - + include and exclude are filtering functions, they will be passed the basename of each file in the directory and should either return true or false if the file should be included or excluded respectively """ z = zipfile.ZipFile(filename, 'w', zipfile.ZIP_DEFLATED) for dirpath, dirnames, filenames in os.walk(source_dir): for filename in filenames: @@ -317,96 +321,96 @@ def do_clean(): rm(xpiroot) echo('.') rm(jarroot) print('. done.') def do_build_base(): print 'Beginning build of ChatZilla %s...' % version xpiname = check_xpiname('chatzilla-%s.xpi' % version) - + progress_echo(' Checking XPI structure') progress_mkdir(xpiroot) progress_mkdir(joinpath(xpiroot, 'chrome')) progress_mkdir(joinpath(xpiroot, 'chrome', 'icons')) progress_mkdir(joinpath(xpiroot, 'chrome', 'icons', 'default')) progress_mkdir(joinpath(xpiroot, 'components')) print ' done' - + progress_echo(' Checking JAR structure') progress_mkdir(jarroot) print ' done' - + progress_echo(' Updating extension files') - progress_preprocess(joinpath(xpifiles, 'install.rdf'), joinpath(xpiroot, 'install.rdf'), {'CHATZILLA_VERSION': version}) + progress_preprocess(joinpath(xpifiles, 'install.rdf'), joinpath(xpiroot, 'install.rdf'), {'CHATZILLA_VERSION': version, 'FIREFOX_MAXVERSION': ffversion, 'SEAMONKEY_MAXVERSION': smversion}) progress_copy(joinpath(xpifiles, 'chatzilla-window.ico'), joinpath(xpiroot, 'chrome', 'icons', 'default', 'chatzilla-window.ico')) progress_copy(joinpath(xpifiles, 'chatzilla-window.xpm'), joinpath(xpiroot, 'chrome', 'icons', 'default', 'chatzilla-window.xpm')) progress_copy(joinpath(xpifiles, 'chatzilla-window16.xpm'), joinpath(xpiroot, 'chrome', 'icons', 'default', 'chatzilla-window16.xpm')) print ' done' - + progress_echo(' Constructing JAR package') jm = progress_jarmaker() progress_jarmaker_make(jm, joinpath(fedir, 'jar.mn'), fedir) progress_jarmaker_make(jm, joinpath(fedir, 'sm', 'jar.mn'), joinpath(fedir, 'sm')) progress_jarmaker_make(jm, joinpath(fedir, 'ff', 'jar.mn'), joinpath(fedir, 'ff')) progress_preprocess(joinpath(localedir, 'jar.mn'), joinpath(localedir, 'jar.mn.pp'), {'AB_CD': 'en-US'}) # Define a preprocessor var for the next call to makeJar jm.pp.context['AB_CD'] = 'en-US' progress_jarmaker_make(jm, joinpath(localedir, 'jar.mn.pp'), localedir, [joinpath(localedir, 'en-US')]) progress_rm(joinpath(localedir, 'jar.mn.pp')) print ' done' - + progress_echo(' Constructing XPI package') progress_copy(joinpath(jarroot, 'chatzilla.jar'), joinpath(xpiroot, 'chrome')) progress_copy(joinpath(fedir, 'js', 'lib', 'chatzilla-service.js'), joinpath(xpiroot, 'components')) progress_move(joinpath(jarroot, '..', 'chrome.manifest'), joinpath(xpiroot, 'chrome.manifest')) progress_chmod(joinpath(xpiroot, 'chrome', 'chatzilla.jar'), 0664) progress_chmod(joinpath(xpiroot, 'components', 'chatzilla-service.js'), 0664) progress_zip(xpiroot, joinpath(pwd, xpiname)) print ' done' - + print 'Build of ChatZilla %s... ALL DONE' % version def do_build_locale(): print 'Beginning build of %s locale for ChatZilla %s...' % (locale, version) xpiname = check_xpiname('chatzilla-%s.%s.xpi' % (version, locale)) - + progress_echo(' Checking XPI structure') progress_mkdir(xpiroot) progress_mkdir(joinpath(xpiroot, 'chrome')) print ' done' - + progress_echo(' Checking JAR structure') progress_mkdir(jarroot) print ' done' - + progress_echo(' Updating extension files') - progress_preprocess([joinpath(localedir, locale, 'defines.inc'), joinpath(localedir, 'generic', 'install.rdf')], joinpath(xpiroot, 'install.rdf.pp'), {'CHATZILLA_VERSION': version, 'CHATZILLA_BASE_VERSION': version, 'AB_CD': locale, 'INSTALL_EXTENSION_ID': 'langpack-%s@chatzilla.mozilla.org' % locale, 'MOZ_LANG_TITLE': locale}) + progress_preprocess([joinpath(localedir, locale, 'defines.inc'), joinpath(localedir, 'generic', 'install.rdf')], joinpath(xpiroot, 'install.rdf.pp'), {'CHATZILLA_VERSION': version, 'CHATZILLA_BASE_VERSION': version, 'AB_CD': locale, 'INSTALL_EXTENSION_ID': 'langpack-%s@chatzilla.mozilla.org' % locale, 'MOZ_LANG_TITLE': locale, 'FIREFOX_MAXVERSION': ffversion, 'SEAMONKEY_MAXVERSION': smversion}) progress_sed(joinpath(xpiroot, 'install.rdf.pp'), joinpath(xpiroot, 'install.rdf'), ('chatzilla.jar', 'chatzilla-%s.jar' % locale)) progress_rm(joinpath(xpiroot, 'install.rdf.pp')) print ' done' progress_echo(' Constructing JAR package') jm = progress_jarmaker() progress_preprocess(joinpath(localedir, 'jar.mn'), joinpath(localedir, 'jar.mn.pp'), {'AB_CD': locale}) jm.pp.context['AB_CD'] = locale progress_jarmaker_make(jm, joinpath(localedir, 'jar.mn.pp'), localedir, [joinpath(localedir, locale)]) progress_rm(joinpath(localedir, 'jar.mn.pp')) progress_move(joinpath(jarroot, 'chatzilla.jar'), joinpath(jarroot, 'chatzilla-%s.jar' % locale)) print ' done' - + progress_echo(' Constructing XPI package') progress_copy(joinpath(jarroot, 'chatzilla-%s.jar' % locale), joinpath(xpiroot, 'chrome')) progress_sed(joinpath(jarroot, '..', 'chrome.manifest'), joinpath(xpiroot, 'chrome.manifest'), ('chatzilla.jar', 'chatzilla-%s.jar' % locale)) progress_rm(joinpath(jarroot, '..', 'chrome.manifest')) progress_chmod(joinpath(xpiroot, 'chrome', 'chatzilla-%s.jar' % locale), 0664) progress_zip(xpiroot, joinpath(pwd, xpiname)) print ' done' - + print 'Build of %s locale for ChatZilla %s... ALL DONE' % (locale, version) if clean(): do_clean() elif locale is None: do_build_base() else: diff --git a/xpi/resources/install.rdf b/xpi/resources/install.rdf --- a/xpi/resources/install.rdf +++ b/xpi/resources/install.rdf @@ -26,30 +26,30 @@ 3.6 is Gecko 1.9.2 4.0 is Gecko 2.0 5.0 is Gecko 5.0 x.0 is Gecko x.0, where x is greater than 5 --> {ec8030f7-c20a-464f-9b0e-13a3a9e97384} 3.5 - 35.* + @FIREFOX_MAXVERSION@ {92650c4d-4b8e-4d2a-b7eb-24ecf4f6b63a} 2.0 - 2.32.* + @SEAMONKEY_MAXVERSION@ ChatZilla A clean, easy to use and highly extensible Internet Relay Chat (IRC) client. The ChatZilla Team