use /usr/share/myspell directly and remove add-plugins.sh firefox31
authorWolfgang Rosenauer <wr@rosenauer.org>
Sat, 25 Oct 2014 10:49:33 +0200
branchfirefox31
changeset 794 b6bd5c64dccd
parent 793 a08cc1ab27af
child 795 ca27ee37d62e
use /usr/share/myspell directly and remove add-plugins.sh
MozillaFirefox/MozillaFirefox.spec
MozillaFirefox/add-plugins.sh.in
MozillaFirefox/spellcheck.js
--- a/MozillaFirefox/MozillaFirefox.spec	Sat Nov 01 13:57:51 2014 +0100
+++ b/MozillaFirefox/MozillaFirefox.spec	Sat Oct 25 10:49:33 2014 +0200
@@ -103,7 +103,7 @@
 Source10:       compare-locales.tar.xz
 Source11:       firefox.1
 Source12:       mozilla-get-app-id
-Source13:       add-plugins.sh.in
+Source13:       spellcheck.js
 Source14:       create-tar.sh
 # Gecko/Toolkit
 Patch1:         toolkit-download-folder.patch
@@ -383,13 +383,11 @@
 mkdir -p $RPM_BUILD_ROOT%{progdir}/distribution/extensions
 mkdir -p $RPM_BUILD_ROOT%{progdir}/browser/searchplugins
 mkdir -p $RPM_BUILD_ROOT%{progdir}/browser/defaults/preferences/
-# install kde.js
+# install gre prefs
+install -m 644 %{SOURCE13} %{buildroot}%{progdir}/defaults/pref/
+# install browser prefs
 install -m 644 %{SOURCE6} $RPM_BUILD_ROOT%{progdir}/browser/defaults/preferences/kde.js
 install -m 644 %{SOURCE9} $RPM_BUILD_ROOT%{progdir}/browser/defaults/preferences/firefox.js
-# install add-plugins.sh
-sed "s:%%PROGDIR:%{progdir}:g" \
-  %{SOURCE13} > $RPM_BUILD_ROOT%{progdir}/add-plugins.sh
-chmod 755 $RPM_BUILD_ROOT%{progdir}/add-plugins.sh
 # install additional locales
 %if %localize
 rm -f %{_tmppath}/translations.*
@@ -544,7 +542,6 @@
   usr/bin/update-desktop-database > /dev/null || :
 fi
 %endif
-%{progdir}/add-plugins.sh > /dev/null 2>&1
 exit 0
 
 %postun
@@ -562,15 +559,6 @@
 %endif
 exit 0
 
-%posttrans
-[ -e %{progdir}/add-plugins.sh ] && \
-  %{progdir}/add-plugins.sh > /dev/null 2>&1
-exit 0
-
-%preun
-rm -f %{progdir}/dictionaries/*
-exit 0
-
 %files
 %defattr(-,root,root)
 %dir %{progdir}
@@ -595,7 +583,6 @@
 %attr(755,root,root) %{progdir}/%{progname}.sh
 %{progdir}/firefox
 %{progdir}/firefox-bin
-%{progdir}/add-plugins.sh
 %{progdir}/application.ini
 %{progdir}/dependentlibs.list
 %{progdir}/*.so
--- a/MozillaFirefox/add-plugins.sh.in	Sat Nov 01 13:57:51 2014 +0100
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,57 +0,0 @@
-#! /bin/sh
-# Copyright (c) 2008 Wolfgang Rosenauer.  All rights reserved.
-#
-
-# check if we are started as root
-# only one of UID and USER must be set correctly
-if test "$UID" != 0 -a "$USER" != root; then
-    echo "You must be root to start $0."
-    exit 1
-fi
-
-PREFIX="%PROGDIR"
-
-# dictionaries
-MYSPELL=/usr/share/myspell
-MOZ_SPELL=$PREFIX/dictionaries
-if [ -d $MOZ_SPELL ] ; then
-  if [ -d $MYSPELL ] ; then
-    for dict in $MYSPELL/??[-_]??.aff ; do
-
-      # check is it is really the file or it is a string which contain '??_??'
-      if ! [ -e $dict ] ; then
-        continue
-      fi
-
-      # the dict file name
-      dict_file=`echo ${dict##*/}`
-
-      # the dict file has a valid name
-      lang=`echo ${dict_file:0:2}`
-      country=`echo ${dict_file:3:2}`
-      
-      # check for .dic file
-      if [ ! -r $MYSPELL/${lang}[-_]${country}.dic ] ; then
-        continue
-      fi
-
-      # create links
-      if [ ! -r $MOZ_SPELL/${lang}[-_]${country}.aff ] ; then
-        ln -sf $MYSPELL/${lang}[-_]${country}.aff \
-               $MOZ_SPELL/${lang}-${country}.aff
-      fi      
-      if [ ! -r $MOZ_SPELL/${lang}[-_]${country}.dic ] ; then
-        ln -sf $MYSPELL/${lang}[-_]${country}.dic \
-               $MOZ_SPELL/${lang}-${country}.dic
-      fi      
-    done
-    echo "-> added myspell dictionaries"
-  fi
-
-  # remove broken links
-  for dict in $MOZ_SPELL/*.{aff,dic} ; do
-    if ! [ -r $dict ] ; then
-      rm -f $dict
-    fi
-  done
-fi
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/MozillaFirefox/spellcheck.js	Sat Oct 25 10:49:33 2014 +0200
@@ -0,0 +1,1 @@
+pref("spellchecker.dictionary_path", "/usr/share/myspell");