summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorRemi Collet <fedora@famillecollet.com>2010-05-31 19:12:20 +0200
committerRemi Collet <fedora@famillecollet.com>2010-05-31 19:12:20 +0200
commit5683cf77402a772e3d7d132fec36e31335f77acf (patch)
treee1ed1a61f5d89453ae4b61084a7b2c403da9846f
import thunderbird-enigmail-1.0.1
-rw-r--r--Makefile4
-rw-r--r--enigmail-fixlang.php91
-rwxr-xr-xmozilla-extension-update.sh144
-rw-r--r--mozilla-jemalloc.patch24
-rw-r--r--thunderbird-3.0-ppc64.patch42
-rw-r--r--thunderbird-clipboard-crash.patch116
-rw-r--r--thunderbird-debuginfo-fix-include.patch33
-rw-r--r--thunderbird-enigmail.spec345
-rw-r--r--thunderbird-mozconfig35
-rwxr-xr-xthunderbird-mozconfig-branded1
-rw-r--r--thunderbird-mozconfig-debuginfo5
-rw-r--r--thunderbird-mozconfig.fc425
-rw-r--r--thunderbird-shared-error.patch15
13 files changed, 880 insertions, 0 deletions
diff --git a/Makefile b/Makefile
new file mode 100644
index 0000000..1e65467
--- /dev/null
+++ b/Makefile
@@ -0,0 +1,4 @@
+SRCDIR := $(shell pwd)
+NAME := $(shell basename $(SRCDIR))
+include ../common/Makefile
+
diff --git a/enigmail-fixlang.php b/enigmail-fixlang.php
new file mode 100644
index 0000000..188b558
--- /dev/null
+++ b/enigmail-fixlang.php
@@ -0,0 +1,91 @@
+#!/usr/bin/php
+<?php
+function loaddtd ($file, &$tab) {
+
+ echo "+ Loading $file\n";
+ $tab=array();
+
+ $fic=fopen($file, "r");
+ $prev=false;
+ if ($fic) while ($buf=fgets($fic)) {
+ if (empty($buf) || $buf=="\n") {
+ //echo "+ empty\n";
+ } else if (preg_match('/^<!ENTITY (.*)"(.*)">$/', $buf, $res)) {
+ //echo "+ Line '".$res[1]."'\n";
+ $ind=trim($res[1]);
+ $tab[$ind] = $res[1].'"'.$res[2].'">';
+ $prev=false;
+ } else if (preg_match('/^<!ENTITY (.*)"(.*)$/', $buf, $res)) {
+ //echo "+ Start '".$res[1]."'\n";
+ $ind=trim($res[1]);
+ $tab[$ind] = $res[1].'"'.$res[2];
+ $prev=$ind;
+ } else if ($prev && preg_match('/^(.*)">$/', $buf, $res)) {
+ //echo "+ End '".$prev."'\n";
+ $tab[$prev] .= "\n".$res[1].'">';
+ $prev=false;
+ } else if ($prev && preg_match('/^(.*)$/', $buf, $res)) {
+ //echo "+ Cont. '".$prev."'\n";
+ $tab[$prev] .= "\n".$res[1];
+ } else {
+ die("- unkonwn ($buf) !\n");
+ }
+ }
+}
+function loadprop ($file, &$tab) {
+
+ echo "+ Loading $file\n";
+ $tab=array();
+
+ $fic=fopen($file, "r");
+ if ($fic) while ($buf=fgets($fic)) {
+ if (empty($buf) || $buf=="\n") {
+ //echo "+ empty\n";
+ } else if (preg_match('/^#/', $buf, $res)) {
+ //echo "+ comments\n";
+ } else if (preg_match('/^([A-Za-z0-9._]*)[[:space:]]*=[[:space:]]*(.*)/', $buf, $res)) {
+ //echo "+ Value '".$res[1]."'\n";
+ $ind=trim($res[1]);
+ $tab[$ind] = $res[1].'='.$res[2];
+ } else {
+ echo("\tIgnored ($buf) !\n");
+ }
+ }
+}
+if ($_SERVER["argc"]<3) die ("usage enigmail-fixlang.php fromdir destdir\n");
+$from=$_SERVER["argv"][1];
+$dest=$_SERVER["argv"][2];
+if (!is_file("$from/enigmail.dtd")) die ("$from/enigmail.dtd not found\n");
+if (!is_file("$from/enigmail.properties")) die ("$from/enigmail.properties not found\n");
+if (!is_file("$dest/enigmail.dtd")) die ("$dest/enigmail.dtd not found\n");
+if (!is_file("$dest/enigmail.properties")) die ("$dest/enigmail.properties not found\n");
+
+loaddtd("$from/enigmail.dtd", $endtd);
+loaddtd("$dest/enigmail.dtd", $frdtd);
+
+echo "+ Writing $dest/enigmail.dtd\n";
+$fic=fopen("$dest/enigmail.dtd", "w");
+foreach($endtd as $ind => $line)
+ if (isset($frdtd[$ind])) {
+ fputs($fic, "<!ENTITY ".$frdtd[$ind]."\n");
+ } else {
+ echo "\tAdding missing $ind\n";
+ fputs($fic, "<!ENTITY ".$endtd[$ind]."\n");
+ }
+fclose($fic);
+
+loadprop("$from/enigmail.properties", $enprop);
+loadprop("$dest/enigmail.properties", $frprop);
+
+echo "+ Writing $dest/enigmail.properties\n";
+$fic=fopen("$dest/enigmail.properties", "w");
+foreach($enprop as $ind => $line)
+ if (isset($frprop[$ind])) {
+ fputs($fic, $frprop[$ind]."\n");
+ } else {
+ echo "\tAdding missing $ind\n";
+ fputs($fic, $enprop[$ind]."\n");
+ }
+fclose($fic);
+?>
+
diff --git a/mozilla-extension-update.sh b/mozilla-extension-update.sh
new file mode 100755
index 0000000..1bf15a6
--- /dev/null
+++ b/mozilla-extension-update.sh
@@ -0,0 +1,144 @@
+#!/bin/sh
+#
+# This script is used to add and remove our extension from one of the Mozilla
+# products directory, and is run from 'triggers' when the product is installed or
+# upgraded, as well as when our package is installed. It is needed because
+# Mozilla products are installed into versioned directories in /usr/lib[64]/<product>
+# so we have to make a new symlink into the right directory when the
+# application is installed or upgraded. But we would rather not leave
+# our old symlinks behind, since that will cause the application
+# directories not to be removed. (flash-player leaves its old symlinks behind,
+# but that's no excuse for us to do the same...)
+#
+# Because I don't know any way of finding out what the new version
+# is on installation or old version on uninstallation, we have
+# to do things in a somewhat non-intuitive way
+#
+# The order on upgrade of the mozilla application is:
+#
+# 1. new package installed
+# 2. triggerin for new package - we add all symlinks
+# 3. triggerun for old package - we remove all symlinks
+# 4. old package uninstalled
+# 5. triggerpostun for old package - we add all symlinks
+#
+# Triggers are also run on self-upgrade, in that case we do:
+#
+# 1. new package installed
+# 2. triggerin for new package - we add all symlinks
+# 3. triggerun for old package - we remove all symlinks
+# 4. old package uninstalled
+# 5. postun for old package - we add all symlinks
+# 6. triggerpostun for old package - NOT RUN (contrary to RPM docs)
+#
+#
+# Script arguments:
+# --appname: the mozilla application that this extension should register into.
+# Usually firefox or thunderbird.
+# --extname: the name of the extension. It can be determined by looking at
+# the install.rdf file, in the extension directory. This file
+# contains several <em:id> tags. The extname parameter is the
+# content of the em:id tag which is not contained in the
+# em:targetApplication tag
+# --extpath: the path where the extension will be installed
+# --action: either "install" or "remove"
+# --basedir: the dirname of the directory where the target application is
+# installed. Usually /usr/lib or /usr/lib64>, it defaults to
+# /usr/lib
+#
+#
+# Here's an example implementation in rpm scriptlets:
+#
+# %define tbupdate %{_libdir}/lightning/mozilla-extension-update.sh --appname thunderbird --extname {e2fda1a4-762b-4020-b5ad-a41df1933103} --basedir %{_libdir} --extpath %{_libdir}/lightning --action
+#
+# %post
+# %{tbupdate} install || true
+#
+# %preun
+# # On removal (but not upgrade), remove the extention
+# if [ $1 = 0 ] ; then
+# %{tbupdate} remove || true
+# fi
+#
+# %postun
+# # This is needed not to reverse the effect of our preun, which
+# # is guarded against upgrade, but because of our triggerun,
+# # which is run on self-upgrade, though triggerpostun isn't
+# if [ $1 != 0 ] ; then
+# %{tbupdate} install || true
+# fi
+#
+# %triggerin -- thunderbird
+# %{tbupdate} install || true
+#
+# %triggerun -- thunderbird
+# %{tbupdate} remove || true
+#
+# %triggerpostun -- thunderbird
+# # Guard against being run post-self-uninstall, even though that
+# # doesn't happen currently (see comment above)
+# if [ "$1" != 0 ] ; then
+# %{tbupdate} install || true
+# fi
+
+
+die() {
+ echo >&2 "$@"
+ exit 0
+}
+
+usage() {
+ die "Usage: $0 --appname <application-name> --extname <extension-name> --extpath <extension-path> --action <install|remove> [--basedir </usr/lib|/usr/lib64>]"
+}
+
+appname=
+extname=
+extpath=
+action=
+basedir=/usr/lib
+while [ "$#" -gt "0" ]; do
+ case "$1" in
+ --appname)
+ shift; appname="$1" ;;
+ --extname)
+ shift; extname="$1" ;;
+ --extpath)
+ shift; extpath="$1" ;;
+ --action)
+ shift; action="$1" ;;
+ --basedir)
+ shift; basedir="$1" ;;
+ *) usage ;;
+ esac
+ shift
+done
+
+
+if [ "$action" = "install" ] ; then
+ # Add symlinks to any mozilla directory that looks like it is part of a
+ # currently installed package
+ for d in $basedir/${appname}*; do
+ if [ "$d" = "$basedir/${appname}*" ] ; then
+ continue
+ fi
+ link=$d/extensions/$extname
+ if [ -e $extpath -a -e $d/$appname-bin -a -d $d/extensions -a ! -L $link ] ; then
+ ln -s $extpath $link
+ fi
+ done
+elif [ "$action" = "remove" ] ; then
+ # Remove any symlinks we've created into any mozilla directory
+ for d in $basedir/${appname}*; do
+ if [ "$d" = "$basedir/${appname}*" ] ; then
+ continue
+ fi
+ link=$d/extensions/$extname
+ if [ -L $link ] ; then
+ rm $link
+ fi
+ done
+else
+ usage
+fi
+
+exit 0
diff --git a/mozilla-jemalloc.patch b/mozilla-jemalloc.patch
new file mode 100644
index 0000000..2ef0b97
--- /dev/null
+++ b/mozilla-jemalloc.patch
@@ -0,0 +1,24 @@
+diff -r f1af606531f5 memory/jemalloc/jemalloc.h
+--- mozilla/memory/jemalloc/jemalloc.h Sat Nov 22 20:22:22 2008 +0100
++++ mozilla/memory/jemalloc/jemalloc.h Mon Dec 01 16:53:06 2008 -0500
+@@ -45,14 +45,14 @@
+ } jemalloc_stats_t;
+
+ #ifndef MOZ_MEMORY_DARWIN
+-void *malloc(size_t size);
+-void *valloc(size_t size);
+-void *calloc(size_t num, size_t size);
+-void *realloc(void *ptr, size_t size);
+-void free(void *ptr);
++void *malloc(size_t size) __THROW __attribute_malloc__ __wur;
++void *valloc(size_t size) __THROW __attribute_malloc__ __wur;
++void *calloc(size_t num, size_t size) __THROW __attribute_malloc__ __wur;
++void *realloc(void *ptr, size_t size) __THROW __attribute_malloc__ __wur;
++void free(void *ptr) __THROW __attribute_malloc__ __wur;
+ #endif
+
+-int posix_memalign(void **memptr, size_t alignment, size_t size);
++int posix_memalign(void **memptr, size_t alignment, size_t size) __THROW __attribute_malloc__ __wur;
+ void *memalign(size_t alignment, size_t size);
+ size_t malloc_usable_size(const void *ptr);
+ void jemalloc_stats(jemalloc_stats_t *stats);
diff --git a/thunderbird-3.0-ppc64.patch b/thunderbird-3.0-ppc64.patch
new file mode 100644
index 0000000..394524d
--- /dev/null
+++ b/thunderbird-3.0-ppc64.patch
@@ -0,0 +1,42 @@
+--- configure.in.ppc64 2009-07-21 14:01:25.000000000 +0200
++++ configure.in 2009-07-21 14:01:51.000000000 +0200
+@@ -1451,7 +1451,7 @@
+ CPU_ARCH=sparc
+ ;;
+
+-x86_64 | ia64)
++x86_64 | ia64 | ppc64)
+ CPU_ARCH="$OS_TEST"
+ ;;
+ esac
+@@ -4148,6 +4148,9 @@
+ if test -n "${CPU_ARCH}" -a -n "${TARGET_COMPILER_ABI}"; then
+ TARGET_XPCOM_ABI="${CPU_ARCH}-${TARGET_COMPILER_ABI}"
+ fi
++echo CPU_ARCH=${CPU_ARCH}
++echo TARGET_COMPILER_ABI=${TARGET_COMPILER_ABI}
++echo TARGET_XPCOM_ABI=$TARGET_XPCOM_ABI
+
+ dnl Mozilla specific options
+ dnl ========================================================
+--- mozilla/configure.in.ppc64 2009-07-15 22:36:48.000000000 +0200
++++ mozilla/configure.in 2009-07-21 13:57:46.000000000 +0200
+@@ -1317,7 +1317,7 @@
+ CPU_ARCH=sparc
+ ;;
+
+-x86_64 | ia64)
++x86_64 | ia64 | ppc64)
+ CPU_ARCH="$OS_TEST"
+ ;;
+ esac
+@@ -4033,6 +4033,9 @@
+ if test -n "${CPU_ARCH}" -a -n "${TARGET_COMPILER_ABI}"; then
+ TARGET_XPCOM_ABI="${CPU_ARCH}-${TARGET_COMPILER_ABI}"
+ fi
++echo CPU_ARCH=${CPU_ARCH}
++echo TARGET_COMPILER_ABI=${TARGET_COMPILER_ABI}
++echo TARGET_XPCOM_ABI=$TARGET_XPCOM_ABI
+
+ dnl Mozilla specific options
+ dnl ========================================================
diff --git a/thunderbird-clipboard-crash.patch b/thunderbird-clipboard-crash.patch
new file mode 100644
index 0000000..d2861b8
--- /dev/null
+++ b/thunderbird-clipboard-crash.patch
@@ -0,0 +1,116 @@
+diff -r 7f1f309a34f8 widget/src/gtk2/nsClipboard.cpp
+--- a/mozilla/widget/src/gtk2/nsClipboard.cpp Thu Oct 22 12:45:52 2009 +0800
++++ b/mozilla/widget/src/gtk2/nsClipboard.cpp Fri Nov 13 11:19:27 2009 +0100
+@@ -424,25 +424,25 @@ nsClipboard::HasDataMatchingFlavors(cons
+ for (PRUint32 i = 0; i < aLength && !*_retval; i++) {
+ // We special case text/unicode here.
+ if (!strcmp(aFlavorList[i], kUnicodeMime) &&
+ gtk_selection_data_targets_include_text(selection_data)) {
+ *_retval = PR_TRUE;
+ break;
+ }
+
+ for (PRInt32 j = 0; j < n_targets; j++) {
+ gchar *atom_name = gdk_atom_name(targets[j]);
+- if (!strcmp(atom_name, aFlavorList[i]))
++ if (!g_strcmp0(atom_name, aFlavorList[i]))
+ *_retval = PR_TRUE;
+
+ // X clipboard wants image/jpeg, not image/jpg
+- if (!strcmp(aFlavorList[i], kJPEGImageMime) && !strcmp(atom_name, "image/jpeg"))
++ if (!g_strcmp0(aFlavorList[i], kJPEGImageMime) && !g_strcmp0(atom_name, "image/jpeg"))
+ *_retval = PR_TRUE;
+
+ g_free(atom_name);
+
+ if (*_retval)
+ break;
+ }
+ }
+ gtk_selection_data_free(selection_data);
+ g_free(targets);
+diff -r 7f1f309a34f8 widget/src/gtk2/nsDragService.cpp
+--- a/mozilla/widget/src/gtk2/nsDragService.cpp Thu Oct 22 12:45:52 2009 +0800
++++ b/mozilla/widget/src/gtk2/nsDragService.cpp Fri Nov 13 11:19:27 2009 +0100
+@@ -824,50 +824,47 @@ nsDragService::IsDataFlavorSupported(con
+
+ // check the target context vs. this flavor, one at a time
+ GList *tmp;
+ for (tmp = mTargetDragContext->targets; tmp; tmp = tmp->next) {
+ /* Bug 331198 */
+ GdkAtom atom = GDK_POINTER_TO_ATOM(tmp->data);
+ gchar *name = NULL;
+ name = gdk_atom_name(atom);
+ PR_LOG(sDragLm, PR_LOG_DEBUG,
+ ("checking %s against %s\n", name, aDataFlavor));
+- if (name && (strcmp(name, aDataFlavor) == 0)) {
++ if (g_strcmp0(name, aDataFlavor) == 0) {
+ PR_LOG(sDragLm, PR_LOG_DEBUG, ("good!\n"));
+ *_retval = PR_TRUE;
+ }
+ // check for automatic text/uri-list -> text/x-moz-url mapping
+ if (*_retval == PR_FALSE &&
+- name &&
+- (strcmp(name, gTextUriListType) == 0) &&
+- (strcmp(aDataFlavor, kURLMime) == 0)) {
++ (g_strcmp0(name, gTextUriListType) == 0) &&
++ (g_strcmp0(aDataFlavor, kURLMime) == 0)) {
+ PR_LOG(sDragLm, PR_LOG_DEBUG,
+ ("good! ( it's text/uri-list and \
+ we're checking against text/x-moz-url )\n"));
+ *_retval = PR_TRUE;
+ }
+ // check for automatic _NETSCAPE_URL -> text/x-moz-url mapping
+ if (*_retval == PR_FALSE &&
+- name &&
+- (strcmp(name, gMozUrlType) == 0) &&
+- (strcmp(aDataFlavor, kURLMime) == 0)) {
++ (g_strcmp0(name, gMozUrlType) == 0) &&
++ (g_strcmp0(aDataFlavor, kURLMime) == 0)) {
+ PR_LOG(sDragLm, PR_LOG_DEBUG,
+ ("good! ( it's _NETSCAPE_URL and \
+ we're checking against text/x-moz-url )\n"));
+ *_retval = PR_TRUE;
+ }
+ // check for auto text/plain -> text/unicode mapping
+ if (*_retval == PR_FALSE &&
+- name &&
+- (strcmp(name, kTextMime) == 0) &&
+- ((strcmp(aDataFlavor, kUnicodeMime) == 0) ||
+- (strcmp(aDataFlavor, kFileMime) == 0))) {
++ (g_strcmp0(name, kTextMime) == 0) &&
++ ((g_strcmp0(aDataFlavor, kUnicodeMime) == 0) ||
++ (g_strcmp0(aDataFlavor, kFileMime) == 0))) {
+ PR_LOG(sDragLm, PR_LOG_DEBUG,
+ ("good! ( it's text plain and we're checking \
+ against text/unicode or application/x-moz-file)\n"));
+ *_retval = PR_TRUE;
+ }
+ g_free(name);
+ }
+ return NS_OK;
+ }
+
+@@ -974,21 +971,21 @@ nsDragService::IsTargetContextList(void)
+
+ GList *tmp;
+
+ // walk the list of context targets and see if one of them is a list
+ // of items.
+ for (tmp = mTargetDragContext->targets; tmp; tmp = tmp->next) {
+ /* Bug 331198 */
+ GdkAtom atom = GDK_POINTER_TO_ATOM(tmp->data);
+ gchar *name = NULL;
+ name = gdk_atom_name(atom);
+- if (strcmp(name, gMimeListType) == 0)
++ if (g_strcmp0(name, gMimeListType) == 0)
+ retval = PR_TRUE;
+ g_free(name);
+ if (retval)
+ break;
+ }
+ return retval;
+ }
+
+ // Maximum time to wait for a "drag_received" arrived, in microseconds
+ #define NS_DND_TIMEOUT 500000
diff --git a/thunderbird-debuginfo-fix-include.patch b/thunderbird-debuginfo-fix-include.patch
new file mode 100644
index 0000000..843a46a
--- /dev/null
+++ b/thunderbird-debuginfo-fix-include.patch
@@ -0,0 +1,33 @@
+diff -up comm-central/mozilla/toolkit/crashreporter/google-breakpad/src/client/linux/handler/exception_handler.cc.include comm-central/mozilla/toolkit/crashreporter/google-breakpad/src/client/linux/handler/exception_handler.cc
+--- comm-central/mozilla/toolkit/crashreporter/google-breakpad/src/client/linux/handler/exception_handler.cc.include 2009-09-16 02:57:07.000000000 +0200
++++ comm-central/mozilla/toolkit/crashreporter/google-breakpad/src/client/linux/handler/exception_handler.cc 2009-10-12 09:47:59.000000000 +0200
+@@ -33,6 +33,7 @@
+ #include <sys/stat.h>
+ #include <sys/types.h>
+ #include <unistd.h>
++#include <stdio.h>
+
+ #include <cassert>
+ #include <cstdlib>
+diff -up comm-central/mozilla/toolkit/crashreporter/google-breakpad/src/client/linux/handler/minidump_generator.cc.include comm-central/mozilla/toolkit/crashreporter/google-breakpad/src/client/linux/handler/minidump_generator.cc
+--- comm-central/mozilla/toolkit/crashreporter/google-breakpad/src/client/linux/handler/minidump_generator.cc.include 2009-09-16 02:57:07.000000000 +0200
++++ comm-central/mozilla/toolkit/crashreporter/google-breakpad/src/client/linux/handler/minidump_generator.cc 2009-10-12 09:47:59.000000000 +0200
+@@ -37,6 +37,7 @@
+ #include <unistd.h>
+ #include <sys/utsname.h>
+ #include <sys/wait.h>
++#include <stdio.h>
+
+ #include <cstdlib>
+ #include <ctime>
+diff -up comm-central/mozilla/toolkit/crashreporter/google-breakpad/src/common/linux/dump_symbols.cc.include comm-central/mozilla/toolkit/crashreporter/google-breakpad/src/common/linux/dump_symbols.cc
+--- comm-central/mozilla/toolkit/crashreporter/google-breakpad/src/common/linux/dump_symbols.cc.include 2009-09-16 02:57:07.000000000 +0200
++++ comm-central/mozilla/toolkit/crashreporter/google-breakpad/src/common/linux/dump_symbols.cc 2009-10-12 10:09:56.000000000 +0200
+@@ -41,6 +41,7 @@
+ #include <sys/types.h>
+ #include <unistd.h>
+ #include <algorithm>
++#include <stdio.h>
+
+ #include <functional>
+ #include <list>
diff --git a/thunderbird-enigmail.spec b/thunderbird-enigmail.spec
new file mode 100644
index 0000000..879e065
--- /dev/null
+++ b/thunderbird-enigmail.spec
@@ -0,0 +1,345 @@
+%global nspr_version 4.8
+%global nss_version 3.12.3.99
+%global cairo_version 1.8.8
+%global freetype_version 2.1.9
+%global sqlite_version 3.6.14
+%global build_langpacks 1
+%global moz_objdir objdir-tb
+
+%global thunver 3.0.1
+#global CVS 20091121
+#global prever rc1
+
+# The tarball is pretty inconsistent with directory structure.
+# Sometimes there is a top level directory. That goes here.
+#
+# IMPORTANT: If there is no top level directory, this should be
+# set to the cwd, ie: '.'
+#%define tarballdir .
+%global tarballdir comm-1.9.1
+
+%global official_branding 1
+
+%global version_internal 3.0
+%global mozappdir %{_libdir}/%{name}-%{version_internal}
+
+
+Summary: Authentication and encryption extension for Mozilla Thunderbird
+Name: thunderbird-enigmail
+Version: 1.0.1
+%if 0%{?prever:1}
+Release: 0.1.%{prever}%{?dist}
+%else
+Release: 1%{?dist}
+%endif
+URL: http://enigmail.mozdev.org/
+License: MPLv1.1 or GPLv2+
+Group: Applications/Internet
+Source0: thunderbird-%{thunver}.source.tar.bz2
+#NoSource: 0
+
+Source10: thunderbird-mozconfig
+Source11: thunderbird-mozconfig-branded
+
+# ===== Enigmail files =====
+%if 0%{?CVS}
+# cvs -d :pserver:guest@mozdev.org:/cvs login
+# => password is guest
+# cvs -d :pserver:guest@mozdev.org:/cvs co enigmail/src
+# tar czf /home/rpmbuild/SOURCES/enigmail-20091121.tgz --exclude CVS -C enigmail/src .
+Source100: enigmail-%{CVS}.tgz
+%else
+Source100: http://www.mozilla-enigmail.org/download/source/enigmail-%{version}%{?prever}.tar.gz
+%endif
+
+# http://www.mozdev.org/pipermail/enigmail/2009-April/011018.html
+Source101: enigmail-fixlang.php
+
+# From sunbird.src.rpm
+Source102: mozilla-extension-update.sh
+
+# Build patches
+Patch1: mozilla-jemalloc.patch
+Patch2: thunderbird-shared-error.patch
+Patch4: thunderbird-clipboard-crash.patch
+
+Patch9: thunderbird-3.0-ppc64.patch
+
+
+%if %{official_branding}
+# Required by Mozilla Corporation
+
+
+%else
+# Not yet approved by Mozillla Corporation
+
+
+%endif
+
+BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}-root-%(%{__id_u} -n)
+%if 0%{?fedora} >= 11
+BuildRequires: nspr-devel >= %{nspr_version}
+BuildRequires: nss-devel >= %{nss_version}
+%endif
+%if %{fedora} >= 11
+BuildRequires: cairo-devel >= %{cairo_version}
+%endif
+BuildRequires: libpng-devel
+BuildRequires: libjpeg-devel
+BuildRequires: zip
+BuildRequires: bzip2-devel
+BuildRequires: zlib-devel, gzip, zip, unzip
+BuildRequires: libIDL-devel
+BuildRequires: gtk2-devel
+BuildRequires: gnome-vfs2-devel
+BuildRequires: libgnome-devel
+BuildRequires: libgnomeui-devel
+BuildRequires: krb5-devel
+BuildRequires: pango-devel
+BuildRequires: freetype-devel >= %{freetype_version}
+BuildRequires: libXt-devel
+BuildRequires: libXrender-devel
+%if 0%{?fedora} >= 10
+BuildRequires: hunspell-devel
+%endif
+%if 0%{?fedora} >= 11
+BuildRequires: sqlite-devel >= %{sqlite_version}
+%endif
+BuildRequires: startup-notification-devel
+BuildRequires: alsa-lib-devel
+BuildRequires: autoconf213
+BuildRequires: desktop-file-utils
+BuildRequires: GConf2-devel
+
+
+## For fixing lang
+%if 0%{?CVS}
+BuildRequires: dos2unix, php-cli
+%endif
+
+# Without this enigmmail will require libxpcom.so and other .so
+# which are not provided by thunderbird (to avoid mistake,
+# because provided by xulrunner).
+AutoReq: 0
+# All others deps already required by thunderbird
+Requires: gnupg, thunderbird >= %{thunver}
+
+# Nothing usefull provided
+AutoProv: 0
+
+%global enigmail_extname '{847b3a00-7ab1-11d4-8f02-006008948af5}'
+%global tbupdate \\\
+ %{_libdir}/%{name}/mozilla-extension-update.sh \\\
+ --appname thunderbird \\\
+ --extname %{enigmail_extname} \\\
+ --basedir %{_libdir} \\\
+ --extpath %{_libdir}/%{name} \\\
+ --action
+
+
+%description
+Enigmail is an extension to the mail client Mozilla Thunderbird
+which allows users to access the authentication and encryption
+features provided by GnuPG
+
+#===============================================================================
+
+%prep
+%setup -q -c
+cd %{tarballdir}
+
+%patch1 -p0 -b .jemalloc
+%patch2 -p1 -b .shared-error
+%if %{fedora} >= 9
+%patch4 -p1 -b .clipboard-crash
+%endif
+
+%patch9 -p0 -b .ppc64
+
+%if %{official_branding}
+# Required by Mozilla Corporation
+
+
+%else
+# Not yet approved by Mozillla Corporation
+
+
+%endif
+
+
+%{__rm} -f .mozconfig
+cat %{SOURCE10} \
+%if %{fedora} < 11
+ | grep -v system-sqlite \
+%endif
+%if %{fedora} < 11
+ | grep -v system-nss \
+ | grep -v system-nspr \
+ | grep -v system-hunspell \
+%endif
+%if %{fedora} < 11
+ | grep -v system-cairo \
+%endif
+ | tee .mozconfig
+
+%if %{official_branding}
+%{__cat} %{SOURCE11} >> .mozconfig
+%endif
+
+# ===== Enigmail work =====
+# ===== Fixing langpack
+%if 0%{?CVS}
+mkdir mailnews/extensions/enigmail
+tar xzf %{SOURCE100} -C mailnews/extensions/enigmail
+
+pushd mailnews/extensions/enigmail
+for rep in $(cat lang/current-languages.txt)
+do
+ dos2unix lang/$rep/enigmail.dtd
+ dos2unix lang/$rep/enigmail.properties
+ php %{SOURCE101} ui/locale/en-US lang/$rep
+done
+popd
+%else
+tar xzf %{SOURCE100} -C mailnews/extensions
+%endif7
+
+#===============================================================================
+
+%build
+cd %{tarballdir}
+
+# Build with -Os as it helps the browser; also, don't override mozilla's warning
+# level; they use -Wall but disable a few warnings that show up _everywhere_
+MOZ_OPT_FLAGS=$(echo $RPM_OPT_FLAGS | %{__sed} -e 's/-O2/-Os/' -e 's/-Wall//')
+
+export RPM_OPT_FLAGS=$MOZ_OPT_FLAGS
+export PREFIX='%{_prefix}'
+export LIBDIR='%{_libdir}'
+
+%define moz_make_flags -j1
+%ifarch ppc ppc64 s390 s390x
+%define moz_make_flags -j1
+%else
+%define moz_make_flags %{?_smp_mflags}
+%endif
+
+export LDFLAGS="-Wl,-rpath,%{mozappdir}"
+export MAKE="gmake %{moz_make_flags}"
+
+# ===== Minimal build =====
+make -f client.mk export
+pushd %{moz_objdir}/mozilla/modules/libreg
+make
+cd ../../xpcom/string
+make
+cd ..
+make
+cd obsolete
+make
+popd
+
+# ===== Enigmail work =====
+pushd mailnews/extensions/enigmail
+./makemake -r
+popd
+
+pushd %{moz_objdir}/mailnews/extensions/enigmail
+make
+make xpi
+popd
+
+
+#===============================================================================
+
+%install
+cd %{tarballdir}
+%{__rm} -rf $RPM_BUILD_ROOT
+
+%{__mkdir_p} $RPM_BUILD_ROOT%{_libdir}
+
+%{__unzip} -q %{moz_objdir}/mozilla/dist/bin/enigmail-*-linux-*.xpi -d $RPM_BUILD_ROOT%{_libdir}/%{name}
+%{__install} -p -m 755 %{SOURCE102} $RPM_BUILD_ROOT%{_libdir}/%{name}/mozilla-extension-update.sh
+
+
+
+%clean
+%{__rm} -rf $RPM_BUILD_ROOT
+
+
+%post
+%{tbupdate} install || :
+
+
+%preun
+if [ $1 = 0 ]; then
+ %{tbupdate} remove || :
+fi
+
+%postun
+# This is needed not to reverse the effect of our preun, which
+# is guarded against upgrade, but because of our triggerun,
+# which is run on self-upgrade, though triggerpostun isn't
+if [ $1 != 0 ]; then
+ %{tbupdate} install || :
+fi
+
+%triggerin -- thunderbird
+%{tbupdate} install || :
+
+%triggerun -- thunderbird
+%{tbupdate} remove || :
+
+%triggerpostun -- thunderbird
+# Guard against being run post-self-uninstall, even though that
+# doesn't happen currently (see comment above)
+if [ $1 != 0 ]; then
+ %{tbupdate} install || :
+fi
+
+
+%files
+%defattr(-,root,root,-)
+%{_libdir}/%{name}
+
+
+#===============================================================================
+
+%changelog
+* Mon Feb 01 2010 Remi Collet <rpms@famillecollet.com> 1.0.1-1
+- Enigmail 1.0.1 (against thunderbird 3.0.1)
+
+* Fri Jan 29 2010 Remi Collet <rpms@famillecollet.com> 1.0.1-0.1.rc1
+- Enigmail 1.0.1rc1 (against thunderbird 3.0.1)
+
+* Mon Nov 30 2009 Remi Collet <rpms@famillecollet.com> 1.0.0-1
+- Enigmail 1.0 (against thunderbird 3.0rc1)
+
+* Sat Nov 21 2009 Remi Collet <rpms@famillecollet.com> 1.0-0.1.cvs20091121
+- new CVS snapshot (against thunderbird 3.0rc1)
+
+* Tue Jul 21 2009 Remi Collet <rpms@famillecollet.com> 0.97a-0.1.cvs20090721
+- new CVS snapshot (against thunderbird 3.0b3)
+
+* Thu May 21 2009 Remi Collet <rpms@famillecollet.com> 0.96a-0.3.cvs20090521
+- new CVS snapshot
+- fix License and Sumnary
+
+* Mon May 18 2009 Remi Collet <rpms@famillecollet.com> 0.96a-0.2.cvs20090516
+- use mozilla-extension-update.sh from thunderbird-lightning
+
+* Sat May 16 2009 Remi Collet <rpms@famillecollet.com> 0.96a-0.1.cvs20090516
+- new CVS snapshot
+- rpmfusion review proposal
+
+* Thu Apr 30 2009 Remi Collet <rpms@famillecollet.com> 0.96a-0.1.cvs20090430.fc11.remi
+- new CVS snapshot
+- F11 build
+
+* Mon Mar 16 2009 Remi Collet <rpms@famillecollet.com> 0.96a-0.1.cvs20090316.fc#.remi
+- new CVS snapshot
+- add enigmail-fixlang.php
+
+* Sun Mar 15 2009 Remi Collet <rpms@famillecollet.com> 0.96a-0.1.cvs20090315.fc#.remi
+- enigmail 0.96a (CVS), Thunderbird 3.0b2
+
diff --git a/thunderbird-mozconfig b/thunderbird-mozconfig
new file mode 100644
index 0000000..3df47c0
--- /dev/null
+++ b/thunderbird-mozconfig
@@ -0,0 +1,35 @@
+mk_add_options MOZ_CO_PROJECT=mail
+ac_add_options --enable-application=mail
+mk_add_options MOZ_OBJDIR=@TOPSRCDIR@/objdir-tb/
+mk_add_options AUTOCONF=autoconf-2.13
+
+#ac_add_options --with-system-png
+
+ac_add_options --prefix="$PREFIX"
+ac_add_options --libdir="$LIBDIR"
+ac_add_options --with-system-nspr
+ac_add_options --with-system-nss
+ac_add_options --with-system-jpeg
+ac_add_options --with-system-zlib
+ac_add_options --with-pthreads
+ac_add_options --disable-tests
+ac_add_options --disable-debug
+ac_add_options --disable-installer
+ac_add_options --enable-optimize="$RPM_OPT_FLAGS"
+ac_add_options --enable-xinerama
+ac_add_options --enable-default-toolkit=cairo-gtk2
+ac_add_options --disable-xprint
+ac_add_options --disable-strip
+ac_add_options --disable-install-strip
+ac_add_options --enable-pango
+ac_add_options --enable-system-cairo
+ac_add_options --enable-svg
+ac_add_options --enable-canvas
+ac_add_options --enable-system-hunspell
+ac_add_options --disable-crashreporter
+
+export BUILD_OFFICIAL=1
+export MOZILLA_OFFICIAL=1
+mk_add_options BUILD_OFFICIAL=1
+mk_add_options MOZILLA_OFFICIAL=1
+
diff --git a/thunderbird-mozconfig-branded b/thunderbird-mozconfig-branded
new file mode 100755
index 0000000..53b376d
--- /dev/null
+++ b/thunderbird-mozconfig-branded
@@ -0,0 +1 @@
+ac_add_options --enable-official-branding
diff --git a/thunderbird-mozconfig-debuginfo b/thunderbird-mozconfig-debuginfo
new file mode 100644
index 0000000..a0ef07a
--- /dev/null
+++ b/thunderbird-mozconfig-debuginfo
@@ -0,0 +1,5 @@
+# For mozilla's debuginfo:
+export CFLAGS="-gstabs+"
+export CXXFLAGS="-gstabs+"
+export MOZ_DEBUG_SYMBOLS=1
+ac_add_options --enable-crashreporter
diff --git a/thunderbird-mozconfig.fc4 b/thunderbird-mozconfig.fc4
new file mode 100644
index 0000000..26a2def
--- /dev/null
+++ b/thunderbird-mozconfig.fc4
@@ -0,0 +1,25 @@
+. $topsrcdir/mail/config/mozconfig
+
+ac_add_options --prefix="$PREFIX"
+ac_add_options --libdir="$LIBDIR"
+ac_add_options --with-system-jpeg
+ac_add_options --with-system-zlib
+ac_add_options --with-system-png
+ac_add_options --with-pthreads
+ac_add_options --disable-tests
+ac_add_options --disable-debug
+ac_add_options --disable-installer
+ac_add_options --enable-optimize="$RPM_OPT_FLAGS"
+ac_add_options --enable-xinerama
+ac_add_options --enable-default-toolkit=gtk2
+ac_add_options --disable-xprint
+ac_add_options --disable-strip
+ac_add_options --enable-system-cairo
+ac_add_options --enable-svg
+ac_add_options --enable-canvas
+
+export BUILD_OFFICIAL=1
+export MOZILLA_OFFICIAL=1
+mk_add_options BUILD_OFFICIAL=1
+mk_add_options MOZILLA_OFFICIAL=1
+
diff --git a/thunderbird-shared-error.patch b/thunderbird-shared-error.patch
new file mode 100644
index 0000000..ae41bbc
--- /dev/null
+++ b/thunderbird-shared-error.patch
@@ -0,0 +1,15 @@
+diff -up comm-central/mail/installer/Makefile.in.shared-error comm-central/mail/installer/Makefile.in
+--- comm-central/mail/installer/Makefile.in.shared-error 2009-09-16 13:47:43.000000000 +0200
++++ comm-central/mail/installer/Makefile.in 2009-09-16 13:48:25.000000000 +0200
+@@ -95,9 +95,11 @@ endif
+ # mozconfig instead.
+ ifndef MAIL_PKG_SHARED
+ ifndef BUILD_STATIC_LIBS
++ifeq (BUILD_STATIC_LIBS, 1)
+ $(error you need an "--enable-static" build to package a build)
+ endif
+ endif
++endif
+
+ # On mozilla-central, packager.mk uses core_abspath to redefine DIST
+ # As the comm-central config.mk doesn't set it, do it ourselves instead