summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorChristopher Aillon <caillon@redhat.com>2011-03-12 20:22:00 -0800
committerChristopher Aillon <caillon@redhat.com>2011-03-18 15:00:19 -0700
commit49840edf8c43532d722c3200983087d0b1445814 (patch)
tree4102bdb77620253166d4cd16e3d9dcc314fce45b
parentRefactor the langpack symlink creation stuff at startup (diff)
downloadlibrewolf-fedora-ff-49840edf8c43532d722c3200983087d0b1445814.tar.gz
librewolf-fedora-ff-49840edf8c43532d722c3200983087d0b1445814.tar.bz2
librewolf-fedora-ff-49840edf8c43532d722c3200983087d0b1445814.zip
Install langpacks as .xpi files instead of unpacking them
This helps performance of the browser, notably at startup, as it needs to open less files. http://blog.mozilla.com/tglek/2010/03/11/extensions-startup/
-rw-r--r--firefox.sh.in4
-rw-r--r--firefox.spec20
2 files changed, 14 insertions, 10 deletions
diff --git a/firefox.sh.in b/firefox.sh.in
index 656f0e4..d2dcef5 100644
--- a/firefox.sh.in
+++ b/firefox.sh.in
@@ -194,8 +194,8 @@ if [ $MOZILLA_DOWN -ne 0 ]; then
function create_langpack_link() {
local language=$*
- local langpack=langpack-${language}@firefox.mozilla.org
- if [ -f $MOZ_LANGPACKS_DIR/$langpack/chrome.manifest ]; then
+ local langpack=langpack-${language}@firefox.mozilla.org.xpi
+ if [ -f $MOZ_LANGPACKS_DIR/$langpack ]; then
rm -rf $MOZ_EXTENSIONS_PROFILE_DIR/$langpack
ln -s $MOZ_LANGPACKS_DIR/$langpack \
$MOZ_EXTENSIONS_PROFILE_DIR/$langpack
diff --git a/firefox.spec b/firefox.spec
index 5e7e16f..773c279 100644
--- a/firefox.spec
+++ b/firefox.spec
@@ -229,22 +229,26 @@ XULRUNNER_DIR=`pkg-config --variable=libdir libxul | %{__sed} -e "s,%{_libdir},,
echo > ../%{name}.lang
%if %{build_langpacks}
-# Install langpacks
+# Extract langpacks, make any mods needed, repack the langpack, and install it.
%{__mkdir_p} $RPM_BUILD_ROOT%{langpackdir}
%{__tar} xf %{SOURCE1}
for langpack in `ls firefox-langpacks/*.xpi`; do
language=`basename $langpack .xpi`
- extensiondir=$RPM_BUILD_ROOT%{langpackdir}/langpack-$language@firefox.mozilla.org
- %{__mkdir_p} $extensiondir
- unzip $langpack -d $extensiondir
- find $extensiondir -type f | xargs chmod 644
+ extensionID=langpack-$language@firefox.mozilla.org
+ %{__mkdir_p} $extensionID
+ unzip $langpack -d $extensionID
+ find $extensionID -type f | xargs chmod 644
sed -i -e "s|browser.startup.homepage.*$|browser.startup.homepage=%{homepage}|g;" \
- $extensiondir/chrome/$language/locale/branding/browserconfig.properties
+ $extensionID/chrome/$language/locale/branding/browserconfig.properties
+ cd $extensionID
+ zip -r9mX ../${extensionID}.xpi *
+ cd -
+
+ %{__install} -m 644 ${extensionID}.xpi $RPM_BUILD_ROOT%{langpackdir}
language=`echo $language | sed -e 's/-/_/g'`
- extensiondir=`echo $extensiondir | sed -e "s,^$RPM_BUILD_ROOT,,"`
- echo "%%lang($language) $extensiondir" >> ../%{name}.lang
+ echo "%%lang($language) %{langpackdir}/${extensionID}.xpi" >> ../%{name}.lang
done
%{__rm} -rf firefox-langpacks
%endif # build_langpacks
bgstack15