[seamonkey/el6] update to 2.13.1

Dmitry Butskoy buc at fedoraproject.org
Mon Oct 15 14:29:46 UTC 2012


commit f8dd6e09a917c72696797fa02f012012b60c4db5
Author: Dmitry Butskoy <Dmitry at Butskoy.name>
Date:   Mon Oct 15 18:29:46 2012 +0400

    update to 2.13.1

 .gitignore          |    2 +
 moz-grab-langpacks  |  197 +++++++++++++++++++++++++++++++++++++++++++++++++++
 seamonkey-mozconfig |    2 +-
 seamonkey.spec      |   40 ++++++-----
 sources             |    4 +-
 5 files changed, 224 insertions(+), 21 deletions(-)
---
diff --git a/.gitignore b/.gitignore
index d31ea84..7fd964d 100644
--- a/.gitignore
+++ b/.gitignore
@@ -36,3 +36,5 @@ seamonkey-2.0.6.source.tar.bz2
 /seamonkey-langpacks-2.9-20120427.tar.xz
 /seamonkey-2.9.1.source.tar.bz2
 /seamonkey-langpacks-2.9.1-20120502.tar.xz
+/seamonkey-2.13.1.source.tar.bz2
+/seamonkey-langpacks-2.13.1-20121015.tar.xz
diff --git a/moz-grab-langpacks b/moz-grab-langpacks
new file mode 100755
index 0000000..247cb43
--- /dev/null
+++ b/moz-grab-langpacks
@@ -0,0 +1,197 @@
+#!/usr/bin/python
+# moz-grab-langpacks - A script to grab langpacks for Mozilla products
+#
+# Copyright (C) 2011 Red Hat, Inc.
+# Author(s): Christopher Aillon <caillon at redhat.com>
+# 
+# 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 of the License, or (at your
+# option) any later version.  See http://www.gnu.org/copyleft/gpl.html for
+# the full text of the license.
+
+import argparse
+import pyrpkg
+import os
+import sys
+import subprocess
+import glob
+import shutil
+import datetime
+import tempfile
+from xml.parsers import expat
+
+def parse_cmdline():
+	parser = argparse.ArgumentParser(description = 'Mozilla Langpack Grabber',
+	                                 prog = 'moz-grab-langpacks')
+
+	parser.add_argument('-a', '--app', default=None, nargs=2, metavar=('APP', 'VERSION'),
+	                    help='Specify an app name and version. Required if the current working directory is not a fedora package directory')
+
+	parser.add_argument('-b', '--build-number', type=int, default=0,
+	                    help='Specify the build number to grab langpacks for, useful for guessing the XPI URL if it is not passed.')
+
+	parser.add_argument('-u', '--url', default=None,
+	                    help='DEPRECATED: Specify a URL to download langpacks from')
+
+	parser.add_argument('--bz2', action='store_true',
+	                    help='If passed, creates a tar.bz2 instead of tar.xz')
+
+	return parser.parse_args()
+
+def find_appversion():
+	try:
+		fedpkg = pyrpkg.PackageModule(os.getcwd(), None)
+		return (fedpkg.module, fedpkg.ver)
+	except pyrpkg.FedpkgError, e:
+		makeverrel = ['make', 'verrel']
+		nvr = subprocess.check_output(makeverrel, stderr=None)
+		nvrlist = nvr.split('-')
+		count = len(nvrlist)
+		version = nvrlist[count - 2]
+		# Get rid of the release, and the version, so we're left with the name
+		nvrlist.pop(count - 1)
+		nvrlist.pop(count - 2)
+		appname = '-'.join(nvrlist)
+		return (appname, version)
+
+def guess_seamonkey_xpi_url(app, version, build_number):
+	if build_number > 0:
+		url = "ftp://ftp.mozilla.org/pub/mozilla.org/seamonkey/nightly/%s-candidates/build%d/langpack/" % (version, build_number)
+	else:
+		url = "ftp://ftp.mozilla.org/pub/mozilla.org/seamonkey/releases/%s/langpack/" % version
+	return url
+
+def guess_xpi_url(app, version, build_number):
+	if app == "seamonkey":
+		return guess_seamonkey_xpi_url(app, version, build_number)
+
+	if build_number > 0:
+		url = "ftp://ftp.mozilla.org/pub/mozilla.org/%s/nightly/%s-candidates/build%d/linux-i686/xpi/" % (app, version, build_number)
+	else:
+		url = "ftp://ftp.mozilla.org/pub/mozilla.org/%s/releases/%s/linux-i686/xpi/" % (app, version)
+	return url
+
+class LangpackXPIParser:
+	LANGPACK_ERROR_UNKNOWN    = -1
+	LANGPACK_OK               =  0
+	LANGPACK_ERROR_XMLDECL    =  1
+	LANGPACK_ERROR_US_ENGLISH =  2
+
+	def __init__(self, xpi):
+		self._xpi = xpi
+		self._error = self.LANGPACK_OK
+		self._parser = expat.ParserCreate()
+		self._parser.XmlDeclHandler = self._xml_handler
+		self._parser.StartElementHandler = self._elem_handler
+		self._haveXMLDeclaration = False
+
+	def _extract_langpack(self):
+		self._tmpdir = tempfile.mkdtemp()
+		unzipcmd = ['unzip', '-qq', '-d', self._tmpdir, self._xpi]
+		subprocess.call(unzipcmd)
+
+	def _xml_handler(self, version, encoding, standalone):
+		self._haveXMLDeclaration = True
+
+	def _elem_handler(self, name, attrs):
+		if name == "Description" and "em:name" in attrs:
+			if attrs["em:name"] == "English (US) Language Pack":
+				self._error = self.LANGPACK_ERROR_US_ENGLISH
+	def parse(self):
+		try:
+			self._extract_langpack()
+			installRDF = "%s/install.rdf" % self._tmpdir
+			self._file = open(installRDF, 'r')
+			self._parser.ParseFile(self._file)
+			if not self._haveXMLDeclaration:
+				self._error = self.LANGPACK_ERROR_XMLDECL
+		except expat.ExpatError, e:
+			self._error = self.LANGPACK_ERROR_UNKNOWN
+		self._file.close()
+		return self._error
+
+	def destroy(self):
+		shutil.rmtree(self._tmpdir)
+
+def create_langpack_tarball(app, version, url, use_xz=True):
+	cwd = os.getcwd()
+	tempdir = tempfile.mkdtemp()
+	os.chdir(tempdir)
+
+	langpackdir="%s-langpacks" % app
+	os.mkdir(langpackdir)
+	os.chdir(langpackdir)
+
+	# Gotta catch em all!
+	print 'Downloading .xpi files...'
+	acclist = '??.xpi,???.xpi,??-??.xpi,*.langpack.xpi'
+	rejlist = 'en-US.xpi,*en-US.langpack.xpi'
+	wgetcmd = ['wget', '--quiet', '-r', '-nd', '-np', '--accept', acclist, '--reject', rejlist, url]
+	subprocess.call(wgetcmd)
+
+	# But we don't gotta keep em all
+	print 'Checking validity of .xpi files...'
+	readme = open('README', 'w')
+	readme.write('Generated by moz-grab-langpacks\n\n')
+	xpis = glob.glob('*.xpi')
+	xpis.sort()
+	for xpi in xpis:
+		parser = LangpackXPIParser(xpi)
+		rv = parser.parse()
+		parser.destroy()
+		if rv == LangpackXPIParser.LANGPACK_OK:
+			readme.write('%s ACCEPTED\n' % xpi)
+		elif rv == LangpackXPIParser.LANGPACK_ERROR_XMLDECL:
+			readme.write('%s REJECTED because the first node is not an XML Declaration\n' % xpi)
+		elif rv == LangpackXPIParser.LANGPACK_ERROR_US_ENGLISH:
+			readme.write('%s REJECTED because it claims to be US English\n' % xpi)
+		else:
+			readme.write('%s REJECTED: Unknown Error\n' % xpi)
+		if rv != LangpackXPIParser.LANGPACK_OK:
+			os.remove(xpi)
+	readme.close()
+
+	# Tar them up
+	print 'Creating tarball...'
+	os.chdir(tempdir)
+
+	if use_xz:
+		suffix = 'xz'
+		tarflags = '-cJf'
+	else:
+		suffix = 'bz2'
+		tarflags = '-cjf'
+
+	now = datetime.datetime.now().strftime("%Y%m%d")
+	tarballname = '%s-langpacks-%s-%s.tar.%s' % (app, version, now, suffix)
+	tarcmd = ['tar', tarflags, tarballname, langpackdir ]
+	subprocess.call(tarcmd)
+	shutil.move(tarballname, cwd)
+
+	print "Created %s" % tarballname
+	os.chdir(cwd)
+	shutil.rmtree(tempdir)
+
+if __name__ == '__main__':
+	args = parse_cmdline()
+	if not args.app:
+		try:
+			args.app = find_appversion()
+		except:
+			print "Error: Re-run this script from a fedora package directory.\n" \
+			      "Alternatively, you can pass --app on the command line."
+			sys.exit(1)
+
+	(app, version) = args.app
+	if app not in ('firefox', 'thunderbird', 'seamonkey'):
+		print "Error: App name must be one of 'firefox', 'thunderbird', 'seamonkey'"
+		sys.exit(1)
+
+	if not args.url:
+		args.url = guess_xpi_url(app, version, args.build_number)
+
+	use_xz = not args.bz2
+	create_langpack_tarball(app, version, args.url, use_xz)
+	sys.exit(0)
+
diff --git a/seamonkey-mozconfig b/seamonkey-mozconfig
index a36e9a0..b432bc0 100644
--- a/seamonkey-mozconfig
+++ b/seamonkey-mozconfig
@@ -40,5 +40,5 @@ export BUILD_OFFICIAL=1
 export MOZILLA_OFFICIAL=1
 mk_add_options BUILD_OFFICIAL=1
 mk_add_options MOZILLA_OFFICIAL=1
-mk_add_options MOZ_OBJDIR=@TOPSRCDIR@
+mk_add_options MOZ_OBJDIR=@TOPSRCDIR@/objdir
 
diff --git a/seamonkey.spec b/seamonkey.spec
index b4fc729..cb22b22 100644
--- a/seamonkey.spec
+++ b/seamonkey.spec
@@ -20,14 +20,19 @@
 
 Name:           seamonkey
 Summary:        Web browser, e-mail, news, IRC client, HTML editor
-Version:        2.13
+Version:        2.13.1
 Release:        1%{?dist}
 URL:            http://www.mozilla.org/projects/seamonkey/
 License:        MPLv2.0
 Group:          Applications/Internet
 
-Source0:        seamonkey-%{version}%{?prerelease_tag}.source.tar.bz2
-Source1:        seamonkey-langpacks-%{version}-20121009.tar.xz
+Source0:        http://releases.mozilla.org/pub/mozilla.org/seamonkey/releases/%{version}/source/seamonkey-%{version}%{?prerelease_tag}.source.tar.bz2
+
+#  Generate it by moz-grab-langpacks script, which can be obtained from
+#  http://fedorapeople.org/cgit/caillon/public_git/gecko-maint.git/
+#  and probably perform "sed -i 's/pyfedpkg/pyrpkg/g' moz-grab-langpacks"
+Source1:        seamonkey-langpacks-%{version}-20121015.tar.xz
+
 Source3:        seamonkey.sh.in
 Source4:        seamonkey.desktop
 Source7:        seamonkey-make-package.pl
@@ -140,10 +145,6 @@ sed -i -e 's/ *xpcnativewrappers=no//' mozilla/extensions/inspector/jar.mn
 echo "ac_add_options --disable-elf-hack" >> .mozconfig
 %endif
 
-%ifarch ppc64
-echo "ac_add_options --disable-jemalloc" >> .mozconfig
-%endif
-
 %if %{without system_libvpx}
 sed -i -e '/with-system-libvpx/ d' .mozconfig
 %endif
@@ -181,10 +182,10 @@ make -f client.mk build STRIP="/bin/true" MOZ_MAKE_FLAGS="$MOZ_SMP_FLAGS"
 
 cd %{sources_subdir}
 
-DESTDIR=$RPM_BUILD_ROOT make install
+DESTDIR=$RPM_BUILD_ROOT make -C objdir install
 
 # fix omni.jar to actually work
-pushd mozilla/dist/bin
+pushd objdir/mozilla/dist/bin
 zip -d $RPM_BUILD_ROOT/%{mozdir}/omni.ja components/browser.xpt components/mail.xpt components/components.manifest chrome/localized.manifest chrome/nonlocalized.manifest
 
 # this contains only binary componetes which will be not present in the jar
@@ -218,44 +219,44 @@ echo %defattr\(-,root,root\) > %{builddir}/seamonkey.list
 # build all of the default browser components 
 # base Seamonkey package (seamonkey.list) 
 %{SOURCE7} --package xpcom --output-file %{builddir}/seamonkey.list \
-    --package-file suite/installer/package-manifest \
+    --package-file objdir/suite/installer/package-manifest \
     --install-dir $RPM_BUILD_ROOT/%{mozdir} \
     --install-root %{mozdir} \
     --exclude-file=%{SOURCE18}
 
 %{SOURCE7} --package browser --output-file %{builddir}/seamonkey.list \
-    --package-file suite/installer/package-manifest \
+    --package-file objdir/suite/installer/package-manifest \
     --install-dir $RPM_BUILD_ROOT/%{mozdir} \
     --install-root %{mozdir}
 
 %{SOURCE7} --package spellcheck --output-file %{builddir}/seamonkey.list \
-    --package-file suite/installer/package-manifest \
+    --package-file objdir/suite/installer/package-manifest \
     --install-dir $RPM_BUILD_ROOT/%{mozdir} \
     --install-root %{mozdir}
 
 %{SOURCE7} --package psm --output-file %{builddir}/seamonkey.list \
-    --package-file suite/installer/package-manifest \
+    --package-file objdir/suite/installer/package-manifest \
     --install-dir $RPM_BUILD_ROOT/%{mozdir} \
     --install-root %{mozdir} \
     --exclude-file=%{SOURCE17}
 
 %{SOURCE7} --package mail --output-file %{builddir}/seamonkey.list \
-    --package-file suite/installer/package-manifest \
+    --package-file objdir/suite/installer/package-manifest \
     --install-dir $RPM_BUILD_ROOT/%{mozdir} \
     --install-root %{mozdir}
 
 %{SOURCE7} --package chatzilla --output-file %{builddir}/seamonkey.list \
-    --package-file suite/installer/package-manifest \
+    --package-file objdir/suite/installer/package-manifest \
     --install-dir $RPM_BUILD_ROOT/%{mozdir} \
     --install-root %{mozdir}
 
 %{SOURCE7} --package venkman --output-file %{builddir}/seamonkey.list \
-    --package-file suite/installer/package-manifest \
+    --package-file objdir/suite/installer/package-manifest \
     --install-dir $RPM_BUILD_ROOT/%{mozdir} \
     --install-root %{mozdir}
 
 %{SOURCE7} --package inspector --output-file %{builddir}/seamonkey.list \
-    --package-file suite/installer/package-manifest \
+    --package-file objdir/suite/installer/package-manifest \
     --install-dir $RPM_BUILD_ROOT/%{mozdir} \
     --install-root %{mozdir}
 
@@ -466,13 +467,16 @@ fi
 
 
 %changelog
+* Mon Oct 15 2012 Dmitry Butskoy <Dmitry at Butskoy.name> 2.13.1-1
+- update to 2.13.1
+- build with separate objdir
+
 * Thu Oct 11 2012 Dmitry Butskoy <Dmitry at Butskoy.name> 2.13-1
 - update to 2.13
 - add patch to avoid decommit memory on powerpc arches (#852698)
 - add seamonkey-related directories in mozilla-filesystem (#865054)
 - fix build with RHEL6 system nspr-4.9.1 (drop setting nspr thread names,
   as it requires nspr >= 4.9.2, but just can be safely removed from the code)
-- temporary disable jemalloc on powerpc64 (build failed with it)
 
 * Mon Oct  8 2012 Dmitry Butskoy <Dmitry at Butskoy.name> 2.12.1-2
 - drop version from install directories (follow the current
diff --git a/sources b/sources
index 0699c99..f475907 100644
--- a/sources
+++ b/sources
@@ -1,2 +1,2 @@
-fe4c432cf1e88536c06448131739cb1a  seamonkey-2.13.source.tar.bz2
-9252004fc6adfdd808922ace82979229  seamonkey-langpacks-2.13-20121009.tar.xz
+469248830dddd8bbd6a1c5017ebd0fe3  seamonkey-2.13.1.source.tar.bz2
+3ce949ed72a24336397a91452a3ae120  seamonkey-langpacks-2.13.1-20121015.tar.xz


More information about the scm-commits mailing list