=== modified file 'ChangeLog'
--- ChangeLog	2014-05-13 07:57:55 +0000
+++ ChangeLog	2015-09-18 13:42:25 +0000
@@ -1,3 +1,22 @@
+2015-08-16 Harri Pitkänen <hatapitk@iki.fi>
+	* Add a separate user oriented README.user and include it in the extension
+	  instead of README.
+
+2015-07-27 Harri Pitkänen <hatapitk@iki.fi>
+	* Support loading optional dependent libraries.
+
+2015-04-18 Harri Pitkänen <hatapitk@iki.fi>
+	* Support languages other than Finnish.
+
+2014-08-23 Harri Pitkänen <hatapitk@iki.fi>
+	* Add icon.
+
+2012-03-20 Marko Wallin <marko.wallin@iki.fi>
+	* Support for 64-bit Windows
+
+2012-01-22 Marko Wallin <marko.wallin@iki.fi>
+	* Support TenFourFox on PPC Mac OS X.
+
 2011-12-29 Andris Pavenis <andris.pavenis@iki.fi>
 	* Throw an exception when specified dictionary is not 'fi_FI'
 

=== modified file 'Makefile'
--- Makefile	2014-05-13 07:57:55 +0000
+++ Makefile	2015-09-18 13:42:25 +0000
@@ -1,8 +1,8 @@
 
 VERSION=$(shell grep -E -o '<em.version>(.*)</em.version>' install.rdf | sed -e 's/<[a-z:/]*>//g')
 
-XPI_FILES=README COPYING ChangeLog install.rdf chrome.manifest components/MozVoikko2.js
-SOURCE_FILES=$(XPI_FILES) Makefile
+XPI_FILES=README.user COPYING ChangeLog install.rdf chrome.manifest components/MozVoikko2.js skin/icon.png
+SOURCE_FILES=$(XPI_FILES) Makefile README
 
 .PHONY: dist-gzip mozvoikko2 clean all
 
@@ -24,4 +24,5 @@
 	rm -f mozvoikko-$(VERSION).tar.gz mozvoikko2.xpi
 	rm -f $(patsubst %,mozvoikko-$(VERSION)/%, $(sort $(SOURCE_FILES)))
 	test ! -d mozvoikko-$(VERSION)/components || rmdir mozvoikko-$(VERSION)/components
+	test ! -d mozvoikko-$(VERSION)/skin || rmdir mozvoikko-$(VERSION)/skin
 	test ! -d mozvoikko-$(VERSION) || rmdir mozvoikko-$(VERSION)

=== modified file 'README'
--- README	2014-05-13 07:57:55 +0000
+++ README	2015-09-18 13:42:25 +0000
@@ -1,5 +1,4 @@
-This is test version of mozvoikko2, an extension for Mozilla programs
-for using Finnish Language spell-checker Voikko
+This is Mozvoikko, an extension for Mozilla programs for using Voikko spell checker.
 
 Supported versions are:
 =======================
@@ -11,23 +10,26 @@
 Supported targets:
 ==================
 -  32-bit Windows (WINNT_x86-msvc)
+-  64-bit Windows (WINNT_x86_64-msvc)
 -  32-bit Linux (Linux_ix86-gcc3)
 -  64-bit Linux (Linux_x86_64-gcc3)
--  32- and 64-bit OS X 10.5 and 10.6 (Darwin_x86-gcc3)
+-  32-bit Mac OS X (Darwin_x86-gcc3)
+-  64-bit Mac OS X (Darwin_x86_64-gcc3)
+-  32-bit Mac OS X (Darwin_ppc-gcc3)
 
 Binary packages for targets mentioned above are included in the extension package.
 Also suomi-malaga data are included. Extension works however with system installations
 of these packages (libvoikko and suomi-malaga) if the files are not found inside
 the extension package.
 
-movoikko2 itself is written completely in JavaScript and does not contain
+Version 2 of Mozvoikko is written completely in JavaScript and does not contain
 any binary components.
 
-One can include libvoikko shared libraries and suomi-malaga files into an extension.
-For that one must put these files in the subdirectories of directory voikko as
-shown below:
+One can include libvoikko shared libraries and suomi-malaga (or other dictionaries)
+into an extension. For that one must put these files in the subdirectories of
+directory voikko as shown below:
 
-[andris@ap mozvoikko2]$ find voikko -type f | sort
+$ find voikko -type f | sort
 voikko/2/mor-standard/voikko-fi_FI.all_l
 voikko/2/mor-standard/voikko-fi_FI.lex_l
 voikko/2/mor-standard/voikko-fi_FI.mor_l
@@ -39,6 +41,14 @@
 voikko/Linux_x86-gcc3/libvoikko.so.1
 voikko/README
 voikko/WINNT_x86-msvc/libvoikko-1.dll
+voikko/WINNT_x86_64-msvc/libvoikko-1.dll
 
+On PPC Mac OS X:
+$ find voikko -type f | sort
+voikko/2/mor-standard/voikko-fi_FI.lex_b
+voikko/2/mor-standard/voikko-fi_FI.mor_b
+voikko/2/mor-standard/voikko-fi_FI.pro
+voikko/2/mor-standard/voikko-fi_FI.sym_b
+voikko/Darwin_ppc-gcc3/libvoikko.1.dylib
 
 Andris Pavenis <andris.pavenis@iki.fi>

=== added file 'README.user'
--- README.user	1970-01-01 00:00:00 +0000
+++ README.user	2015-09-18 13:42:25 +0000
@@ -0,0 +1,24 @@
+This is Mozvoikko, an extension for Mozilla programs for using Voikko spell checker.
+
+Adding new languages
+====================
+
+This extension may include spelling dictionaries for one or more languages. It is not
+possible to install multiple Mozvoikko extensions simultaneously but you can add
+dictionaries into an already installed extension by placing the dictionaries in any
+of the following locations and restarting Firefox:
+
+- Under the Firefox profile folder:
+  Firefox profile folder can be located by following these instructions:
+  https://support.mozilla.org/en-US/kb/profiles-where-firefox-stores-user-data
+  Additional ZHFST speller dictionaries can be placed in the sub-folder
+  extensions\{b676e3ff-cda7-4e0c-b2b8-74e4bb40a67a}\voikko\3
+  Note that if you remove or re-install your Mozvoikko extension these
+  additional dictionaries may need to be installed again.
+- On Windows:
+  ZHFST speller dictionaries can be placed under c:\voikko\3
+- On OS X:
+  ZHFST speller dictionaries can be placed under /Library/Spelling/voikko/3
+  or similarly named folder under user's home folder.
+- On Linux:
+  ZHFST speller dictionaries can be placed under /etc/voikko/3

=== modified file 'chrome.manifest'
--- chrome.manifest	2014-05-13 07:57:55 +0000
+++ chrome.manifest	2015-09-18 13:42:25 +0000
@@ -1,3 +1,4 @@
 component {89630d4c-c64d-11e0-83d8-00508d9f364f} components/MozVoikko2.js
 contract @mozilla.fi/mozvoikko2;1 {89630d4c-c64d-11e0-83d8-00508d9f364f}
 category spell-check-engine @mozilla.fi/mozvoikko2;1 mozvoikko2
+skin voikko classic/1.0 skin/

=== modified file 'components/MozVoikko2.js'
--- components/MozVoikko2.js	2014-05-13 07:57:55 +0000
+++ components/MozVoikko2.js	2015-09-18 13:42:25 +0000
@@ -21,7 +21,7 @@
 
 const mozISpellCheckingEngine = Components.interfaces.mozISpellCheckingEngine;
 const CLASS_ID = Components.ID("89630d4c-c64d-11e0-83d8-00508d9f364f");
-const CLASS_NAME = "Finnish language spell-check";
+const CLASS_NAME = "Spell checker based on Voikko";
 const CONTRACT_ID = "@mozilla.org/mozvoikko2;1";
 
 const VOIKKO_OPT_IGNORE_DOT = 0;
@@ -29,12 +29,42 @@
 const VOIKKO_OPT_IGNORE_UPPERCASE = 3;
 const VOIKKO_OPT_ACCEPT_MISSING_HYPHENS = 12;
 
+const OPTIONAL_DEPENDENCIES = {
+    "WINNT_x86-msvc" : ["libgcc_s_sjlj-1.dll", "libstdc++-6.dll", "zlib1.dll", "libarchive-13.dll", "libhfstospell-4.dll"],
+    "WINNT_x86_64-msvc" : ["libgcc_s_seh-1.dll", "libstdc++-6.dll", "zlib1.dll", "libarchive-13.dll", "libhfstospell-4.dll"],
+    "Darwin_x86_64-gcc3" : ["libtinyxml2.3.dylib", "libarchive.13.dylib", "libhfstospell.4.dylib"],
+    "Darwin_x86-gcc3" : ["libtinyxml2.3.dylib", "libarchive.13.dylib", "libhfstospell.4.dylib"]
+};
+
+function tryLoadLibrary(abi, lib_name) {
+    // Try to locate the library inside extension directory and
+    // replace value
+    var extension_dir = __LOCATION__.parent.parent;
+    var library_loc = extension_dir.clone();
+    library_loc.append("voikko");
+    library_loc.append(abi);
+    library_loc.append(lib_name);
+    if (library_loc.exists() && library_loc.isFile())
+    {
+        var handle = ctypes.open(library_loc.path);
+        aConsoleService.logStringMessage("MozVoikko2: loaded bundled library " + library_loc.path);
+        return handle;
+    }
+    else
+    {
+        var handle = ctypes.open(lib_name);
+        aConsoleService.logStringMessage("MozVoikko2: loaded system library " + library_loc.path);
+        return handle;
+    }
+}
+
 function LibVoikko()
 {
 }
 
 LibVoikko.prototype = {
     libvoikko: null,
+    optional_deps: [],
 
     data_loc: "",
 
@@ -46,6 +76,7 @@
     fn_voikko_suggest_cstr: null,
     fn_voikko_free_cstr_array: null,
     fn_voikko_set_boolean_option: null,
+    fn_voikkoListSupportedSpellingLanguages: null,
 
     init : function()
     {
@@ -59,16 +90,16 @@
         //==================================================================
         // Detect shared library name to load
         //==================================================================
-        if (abi == "Linux_x86-gcc3" || abi == "Linux_x86_64-gcc3")
+        if (abi.indexOf("Linux_") == 0)
         {
             lib_name = "libvoikko.so.1";
         }
-        else if (abi == "WINNT_x86-msvc")
+        else if (abi == "WINNT_x86-msvc" || abi == "WINNT_x86_64-msvc")
         {
             lib_name = "libvoikko-1.dll";
             this.call_abi = ctypes.winapi_abi;
         }
-        else if (abi == "Darwin_x86_64-gcc3" || abi == "Darwin_x86-gcc3")
+        else if (abi == "Darwin_x86_64-gcc3" || abi == "Darwin_x86-gcc3" || abi == "Darwin_ppc-gcc3")
         {
             lib_name = "libvoikko.1.dylib";
         }
@@ -77,36 +108,32 @@
             throw "Unsupported ABI " + abi;
         }
 
-        // Try to locate libvoikko inside extension directory and
-        // replace value
-        var extension_dir = __LOCATION__.parent.parent;
-        var libvoikko_loc = extension_dir.clone();
-        libvoikko_loc.append("voikko");
-        libvoikko_loc.append(abi);
-        libvoikko_loc.append(lib_name);
-        if (libvoikko_loc.exists() && libvoikko_loc.isFile())
-        {
-            this.libvoikko = ctypes.open(libvoikko_loc.path);
-            aConsoleService.logStringMessage("MozVoikko2: loaded " + libvoikko_loc.path);
+        try {
+            this.libvoikko = tryLoadLibrary(abi, lib_name);
         }
-        else
-        {
-            this.libvoikko = ctypes.open(lib_name);
-            aConsoleService.logStringMessage("MozVoikko2: loaded system libvoikko");
-            aConsoleService.logStringMessage("MozVoikko2: libvoikko_loc = " + libvoikko_loc.path);
+        catch (err) {
+            aConsoleService.logStringMessage("MozVoikko2: Failed to load libvoikko (" + lib_name + "), maybe we need optional dependencies");
+            if (abi in OPTIONAL_DEPENDENCIES) {
+                for (var i = 0; i < OPTIONAL_DEPENDENCIES[abi].length; i++) {
+                    var dep = OPTIONAL_DEPENDENCIES[abi][i];
+                    try {
+                        var h = tryLoadLibrary(abi, dep);
+                        this.optional_deps.push(h);
+                    }
+                    catch (e2) {
+                        aConsoleService.logStringMessage("MozVoikko2: Failed to load optional dependency " + dep);
+                    }
+                }
+                this.libvoikko = tryLoadLibrary(abi, lib_name);
+            }
+            else {
+                throw err;
+            }
         }
 
-        var data_loc = extension_dir.clone();
+        var data_loc = __LOCATION__.parent.parent.clone();
         data_loc.append("voikko");
-        var data_loc_test = data_loc.clone();
-        data_loc_test.append("2");
-        data_loc_test.append("mor-standard");
-        data_loc_test.append("voikko-fi_FI.pro");
-        if (data_loc_test.exists() && data_loc_test.isFile())
-        {
-            this.data_loc = data_loc.path;
-            aConsoleService.logStringMessage("MozVoikko2: Found suomi-malaga data at " + this.data_loc);
-        }
+        this.data_loc = data_loc.path;
 
         /* Detect used libvoikko version and output a message to Javascript console. */
         var fn_voikkoGetVersion = this.libvoikko.declare(
@@ -178,6 +205,16 @@
             ctypes.voidptr_t,
             ctypes.int,
             ctypes.int);
+
+        //
+        // char ** voikkoListSupportedSpellingLanguages(const char * path)
+        //
+        this.fn_voikkoListSupportedSpellingLanguages = this.libvoikko.declare(
+            "voikkoListSupportedSpellingLanguages",
+            this.call_abi,
+            ctypes.char.ptr.array(50).ptr,
+            ctypes.char.ptr);
+
     },
 
     finalize : function()
@@ -185,6 +222,9 @@
         this.fn_voikko_init = null;
         this.fn_voikko_terminate = null;
         this.libvoikko.close();
+        while (this.optional_deps.length > 0) {
+            this.optional_deps.pop().close();
+        }
     }
 };
 
@@ -211,7 +251,6 @@
 VoikkoHandle.prototype = {
     handle: null,
     libvoikko: null,
-    lang_code: null,
 
     open : function(libvoikko, lang_code)
     {
@@ -228,8 +267,12 @@
 
         this.handle = this.libvoikko.fn_voikko_init(
             message_ptr,
-            "fi_FI",
+            lang_code,
             data_loc);
+        if (this.handle.isNull()) {
+            this.handle = null;
+            throw "Could not load dictionary that should exists: " + lang_code;
+        }
 
         this.libvoikko.fn_voikko_set_boolean_option(this.handle, VOIKKO_OPT_IGNORE_DOT, 1);
         this.libvoikko.fn_voikko_set_boolean_option(this.handle, VOIKKO_OPT_IGNORE_NUMBERS, 1);
@@ -239,7 +282,7 @@
 
     finalize : function()
     {
-        if (handle)
+        if (this.handle)
         {
             this.libvoikko.fn_voikko_terminate(this.handle);
             this.handle = null;
@@ -250,16 +293,6 @@
 
 function MozVoikko2()
 {
-    try
-    {
-        this.voikko_handle = new VoikkoHandle;
-        this.voikko_handle.open(libvoikko);
-    }
-    catch (err)
-    {
-        Components.utils.reportError(err);
-        throw err;
-    }
 }
 
 MozVoikko2.prototype = {
@@ -267,23 +300,44 @@
     classID: CLASS_ID,
     contractID: CONTRACT_ID,
 
-    data_loc : null,
     voikko_handle : null,
+    supportedDicts : null,
+    currentDict: null,
     mPersonalDictionary : null,
 
     QueryInterface: XPCOMUtils.generateQI([mozISpellCheckingEngine, Components.interfaces.nsISupport]),
 
     get dictionary()
     {
-        return "fi_FI";
+        return this.currentDict;
     },
 
     set dictionary(dict)
     {
-        if (dict != "fi_FI")
+        if (dict == this.currentDict)
+        {
+            return;
+        }
+        var availableDict = this.getSupportedDictionaryCodeInternal(dict);
+        if (availableDict == null)
         {
             throw "mozvoikko2: dictionary '" + dict + "' is not supported by this component (but may be supported by others)";
         }
+        try
+        {
+            if (this.voikko_handle)
+            {
+                this.voikko_handle.finalize();
+            }
+            this.voikko_handle = new VoikkoHandle;
+            this.voikko_handle.open(libvoikko, availableDict);
+            this.currentDict = dict;
+        }
+        catch (err)
+        {
+            Components.utils.reportError(err);
+            throw err;
+        }
     },
 
     get providesPersonalDictionary()
@@ -316,10 +370,53 @@
         this.mPersonalDictionary = mPersonalDictionary;
     },
 
+    getSupportedDictionariesInternal : function()
+    {
+        if (this.supportedDicts == null) {
+            var data_loc = null;
+            if (libvoikko.data_loc) {
+                data_loc = libvoikko.data_loc;
+            }
+            var cSpellingLangs = libvoikko.fn_voikkoListSupportedSpellingLanguages(data_loc);
+            if (!cSpellingLangs.isNull())
+            {
+                var spellingLangs = [];
+                for (i = 0; i < 200 && !cSpellingLangs.contents[i].isNull(); i++)
+                {
+                    spellingLangs.push(cSpellingLangs.contents[i].readString());
+                }
+                libvoikko.fn_voikko_free_cstr_array(cSpellingLangs);
+                this.supportedDicts = spellingLangs;
+            }
+        }
+    },
+
+    getSupportedDictionaryCodeInternal : function(dict)
+    {
+        this.getSupportedDictionariesInternal();
+        if (this.supportedDicts == null)
+        {
+            return;
+        }
+        if (this.supportedDicts.indexOf(dict) != -1)
+        {
+            return dict;
+        }
+        if (dict.indexOf("_") > -1)
+        {
+            var d = dict.substr(0, dict.indexOf("_"));
+            if (this.supportedDicts.indexOf(d) != -1)
+            {
+                return d;
+            }
+        }
+    },
+
     getDictionaryList : function(dicts, count)
     {
-        dicts.value = ["fi_FI"];
-        count.value = 1;
+        this.getSupportedDictionariesInternal();
+        dicts.value = this.supportedDicts;
+        count.value = this.supportedDicts.length;
     },
 
     check : function(word)
@@ -332,7 +429,7 @@
 
         if (result == 0 && this.mPersonalDictionary)
         {
-            return this.mPersonalDictionary.check(word, "fi_FI");
+            return this.mPersonalDictionary.check(word, this.currentDict);
         }
         else
         {

=== modified file 'debian/changelog'
--- debian/changelog	2014-05-13 07:57:55 +0000
+++ debian/changelog	2015-09-18 13:42:25 +0000
@@ -1,3 +1,11 @@
+mozvoikko (2.2-0ubuntu0.15.04.1) vivid; urgency=medium
+
+  * New upstream release.
+  * Include the signed upstream version of the XPI (otherwise identical), so 
+    that it continues to work with Firefox 41 and newer. (LP: #1482219)
+
+ -- Timo Jyrinki <timo-jyrinki@ubuntu.com>  Fri, 18 Sep 2015 16:33:40 +0300
+
 mozvoikko (2.0.1-1ubuntu1) utopic; urgency=low
 
   * Merge from Debian testing.  Remaining changes:

=== modified file 'debian/rules'
--- debian/rules	2014-05-13 07:57:55 +0000
+++ debian/rules	2015-09-18 13:42:25 +0000
@@ -4,5 +4,7 @@
 	dh $@ --with xul-ext,apport
 
 override_dh_auto_install:
-	install-xpi mozvoikko2.xpi
+	mkdir -p debian/tmp/usr/share/mozilla/extensions/\{ec8030f7-c20a-464f-9b0e-13a3a9e97384\}
+	install mozvoikko-2.2.xpi debian/tmp/usr/share/mozilla/extensions/\{ec8030f7-c20a-464f-9b0e-13a3a9e97384\}/\{b676e3ff-cda7-4e0c-b2b8-74e4bb40a67a\}.xpi
+	dh_auto_install
 

=== added file 'debian/source/include-binaries'
--- debian/source/include-binaries	1970-01-01 00:00:00 +0000
+++ debian/source/include-binaries	2015-09-18 13:42:25 +0000
@@ -0,0 +1,1 @@
+mozvoikko-2.2.xpi

=== added file 'debian/xul-ext-mozvoikko.install'
--- debian/xul-ext-mozvoikko.install	1970-01-01 00:00:00 +0000
+++ debian/xul-ext-mozvoikko.install	2015-09-18 13:42:25 +0000
@@ -0,0 +1,1 @@
+usr/share/mozilla

=== modified file 'install.rdf'
--- install.rdf	2014-05-13 07:57:55 +0000
+++ install.rdf	2015-09-18 13:42:25 +0000
@@ -6,26 +6,38 @@
  <Description about="urn:mozilla:install-manifest">
     <em:id>{b676e3ff-cda7-4e0c-b2b8-74e4bb40a67a}</em:id>
     <em:name>Mozilla-laajennus Voikon käyttöön</em:name>
-    <em:version>2.0.1</em:version>
+    <em:version>2.2</em:version>
     <em:description>Mozilla-laajennus Voikko-oikoluvun käyttöön</em:description>
+    <em:localized>
+      <Description>
+        <em:locale>en-US</em:locale>
+        <em:name>Spell checker based on Voikko</em:name>
+        <em:description>Open source spell checker Voikko for Mozilla and needed libraries.</em:description>
+      </Description>
+    </em:localized>
     <em:creator>Andris.Pavenis &lt;andris.pavenis@iki.fi&gt;</em:creator>
     <em:contributor>Marko Wallin &lt;marko.wallin@iki.fi&gt;</em:contributor>
-    <em:contributor>http://voikko.sourceforge.net - Voikon kehitys</em:contributor>
+    <em:contributor>Harri Pitkänen &lt;hatapitk@iki.fi&gt;</em:contributor>
+    <em:contributor>http://voikko.puimula.org - Voikon kehitys</em:contributor>
+    <em:iconURL>chrome://voikko/skin/icon.png</em:iconURL>
 
     <em:unpack>true</em:unpack>
-    <em:homepageURL>https://sourceforge.net/apps/trac/voikko/wiki/mozvoikko</em:homepageURL>
+    <em:type>2</em:type>
+    <em:homepageURL>https://github.com/voikko/mozvoikko/wiki</em:homepageURL>
     <em:targetPlatform>Linux_x86-gcc3</em:targetPlatform>
     <em:targetPlatform>Linux_x86_64-gcc3</em:targetPlatform>
     <em:targetPlatform>Darwin_x86-gcc3</em:targetPlatform>
     <em:targetPlatform>Darwin_x86_64-gcc3</em:targetPlatform>
+    <em:targetPlatform>Darwin_ppc-gcc3</em:targetPlatform>
     <em:targetPlatform>WINNT_x86-msvc</em:targetPlatform>
+    <em:targetPlatform>WINNT_x86_64-msvc</em:targetPlatform>
      
     <em:targetApplication>
         <!-- Mozilla Firefox -->
 	<Description>
 	    <em:id>{ec8030f7-c20a-464f-9b0e-13a3a9e97384}</em:id>
 	    <em:minVersion>4.0</em:minVersion>
-	    <em:maxVersion>12.0a1</em:maxVersion>
+	    <em:maxVersion>33.0</em:maxVersion>
 	</Description>
     </em:targetApplication>
 	
@@ -34,7 +46,7 @@
 	<Description>
     	    <em:id>{3550f703-e582-4d05-9a08-453d09bdfdc6}</em:id>
     	    <em:minVersion>5.0</em:minVersion>
-    	    <em:maxVersion>12.0a1</em:maxVersion>
+    	    <em:maxVersion>33.0</em:maxVersion>
     	</Description>
     </em:targetApplication>
     
@@ -43,7 +55,7 @@
 	<Description>
 	    <em:id>{92650c4d-4b8e-4d2a-b7eb-24ecf4f6b63a}</em:id>
 	    <em:minVersion>2.2</em:minVersion>
-	    <em:maxVersion>2.9a1</em:maxVersion>
+	    <em:maxVersion>2.30</em:maxVersion>
 	</Description>
     </em:targetApplication>
 

=== added file 'mozvoikko-2.2.xpi'
Binary files mozvoikko-2.2.xpi	1970-01-01 00:00:00 +0000 and mozvoikko-2.2.xpi	2015-09-18 13:42:25 +0000 differ
=== added directory 'skin'
=== added file 'skin/icon.png'
Binary files skin/icon.png	1970-01-01 00:00:00 +0000 and skin/icon.png	2015-09-18 13:42:25 +0000 differ
