From e86a9f2410ef6fc37dc36b6a2e1e799d05f980e8 Mon Sep 17 00:00:00 2001 From: Martin Stransky Date: Wed, 25 Nov 2009 15:17:54 +0000 Subject: Language pack updated (#284011) --- .cvsignore | 1 + firefox.sh.in | 87 +++++++++++++++++++++++++++++++++++++++++++++++++++++------ firefox.spec | 20 +++++++++----- sources | 2 +- 4 files changed, 94 insertions(+), 16 deletions(-) diff --git a/.cvsignore b/.cvsignore index d9f7c99..cce4ef7 100644 --- a/.cvsignore +++ b/.cvsignore @@ -13,3 +13,4 @@ firefox-langpacks-3.5.5-20091105.tar.bz2 firefox-langpacks-3.6.1-20091118.tar.bz2 firefox-3.6b2.source.tar.bz2 firefox-3.6b3.source.tar.bz2 +firefox-langpacks-3.6.1-20091125.tar.bz2 diff --git a/firefox.sh.in b/firefox.sh.in index 8258896..0a02845 100644 --- a/firefox.sh.in +++ b/firefox.sh.in @@ -23,7 +23,7 @@ ## ## Usage: ## -## $ mozilla +## $ firefox ## ## This script is meant to run a mozilla program from the mozilla ## rpm installation. @@ -59,7 +59,9 @@ if [ ! -x $MOZ_LIB_DIR/firefox-FIREFOX_VERSION/firefox ]; then MOZ_LIB_DIR="$SECONDARY_LIB_DIR" fi MOZ_DIST_BIN="$MOZ_LIB_DIR/firefox-FIREFOX_VERSION" -MOZ_EXTENSIONS_DIR="$MOZ_DIST_BIN/extensions" +MOZ_XUL_DIR="XULRUNNER_DIRECTORY" +MOZ_LANGPACKS_DIR="$MOZ_DIST_BIN/langpacks" +MOZ_EXTENSIONS_PROFILE_DIR="$HOME/.mozilla/extensions/{ec8030f7-c20a-464f-9b0e-13a3a9e97384}" MOZ_PROGRAM="$MOZ_DIST_BIN/firefox" MOZ_LAUCHER="$MOZ_DIST_BIN/run-mozilla.sh" @@ -141,15 +143,84 @@ export GNOME_DISABLE_CRASH_DIALOG # OK, here's where all the real work gets done + +## +## To disable the use of Firefox localization, set MOZ_DISABLE_LANGPACKS=1 +## in your environment before launching Firefox. +## +# +# MOZ_DISABLE_LANGPACKS=1 +# export MOZ_DISABLE_LANGPACKS +# + +## +## Fedora enables you to install custom language packs at firefox extension +## directory (specified by MOZ_EXTENSIONS_PROFILE_DIR). To enable Firefox +## custom localization, set MOZ_LOCAL_LANGPACKS=1 in your environment +## before launching Firefox. +## +# +# MOZ_LOCAL_LANGPACKS=1 +# export MOZ_LOCAL_LANGPACKS +# + # check system locale MOZARGS= -# Try without a local variant first, then with a local variant -# So that pt-BR doesn't try to use pt for example -SHORTMOZLOCALE=`echo $LC_MESSAGES | sed "s|_\([^.]*\).*||g"` -[ -f $MOZ_EXTENSIONS_DIR/langpack-${SHORTMOZLOCALE}@firefox.mozilla.org/chrome/$SHORTMOZLOCALE.jar ] && MOZARGS="-UILocale $SHORTMOZLOCALE" -MOZLOCALE=`echo $LC_MESSAGES | sed "s|_\([^.]*\).*|-\1|g"` -[ -f $MOZ_EXTENSIONS_DIR/langpack-${MOZLOCALE}@firefox.mozilla.org/chrome/$MOZLOCALE.jar ] && MOZARGS="-UILocale $MOZLOCALE" +# Clear existing locale settings unless MOZ_LOCAL_LANGPACKS is set +mkdir -p $MOZ_EXTENSIONS_PROFILE_DIR +if ! [ $MOZ_LOCAL_LANGPACKS ] || [ $MOZ_LOCAL_LANGPACKS -eq 0 ]; then + find $MOZ_EXTENSIONS_PROFILE_DIR -maxdepth 1 -name "langpack-*@firefox.mozilla.org" -delete; +fi + +# MOZ_DISABLE_LANGPACKS disables language packs completelly +MOZILLA_DOWN=0 +if ! [ $MOZ_DISABLE_LANGPACKS ] || [ $MOZ_DISABLE_LANGPACKS -eq 0 ]; then + if [ -x $MOZ_XUL_DIR/mozilla-xremote-client ]; then + # Is firefox running? + $MOZ_XUL_DIR/mozilla-xremote-client -a firefox 'ping()' > /dev/null 2>&1 + MOZILLA_DOWN=$? + fi +fi + +# Modify language pack configuration only when firefox is not running +# and language packs are not disabled +if [ $MOZILLA_DOWN -ne 0 ]; then + + # Enable local language pack (located in user extension directory) + if [ $MOZ_LOCAL_LANGPACKS ] && [ $MOZ_LOCAL_LANGPACKS -ne 0 ]; then + # Try without a local variant first, then with a local variant + # So that pt-BR doesn't try to use pt for example + SHORTMOZLOCALE=`echo $LC_MESSAGES | sed "s|_\([^.]*\).*||g"` + if [ -f $MOZ_EXTENSIONS_PROFILE_DIR/langpack-${SHORTMOZLOCALE}@firefox.mozilla.org/chrome/$SHORTMOZLOCALE.jar ]; then + MOZARGS="-UILocale $SHORTMOZLOCALE" + else + MOZLOCALE=`echo $LC_MESSAGES | sed "s|_\([^.]*\).*|-\1|g"` + if [ -f $MOZ_EXTENSIONS_PROFILE_DIR/langpack-${MOZLOCALE}@firefox.mozilla.org/chrome/$MOZLOCALE.jar ]; then + MOZARGS="-UILocale $MOZLOCALE" + fi + fi + + # Enable globally installed language pack (located in firefox + # installation directory) + else + # Try without a local variant first, then with a local variant + # So that pt-BR doesn't try to use pt for example + SHORTMOZLOCALE=`echo $LC_MESSAGES | sed "s|_\([^.]*\).*||g"` + if [ -f $MOZ_LANGPACKS_DIR/langpack-${SHORTMOZLOCALE}@firefox.mozilla.org/chrome/$SHORTMOZLOCALE.jar ]; then + MOZARGS="-UILocale $SHORTMOZLOCALE" + ln -s $MOZ_LANGPACKS_DIR/langpack-${SHORTMOZLOCALE}@firefox.mozilla.org \ + $MOZ_EXTENSIONS_PROFILE_DIR/langpack-${SHORTMOZLOCALE}@firefox.mozilla.org + else + MOZLOCALE=`echo $LC_MESSAGES | sed "s|_\([^.]*\).*|-\1|g"` + if [ -f $MOZ_EXTENSIONS_DIR/langpack-${MOZLOCALE}@firefox.mozilla.org/chrome/$MOZLOCALE.jar ]; then + MOZARGS="-UILocale $MOZLOCALE" + ln -s $MOZ_LANGPACKS_DIR/langpack-${MOZLOCALE}@firefox.mozilla.org \ + $MOZ_EXTENSIONS_PROFILE_DIR/langpack-${MOZLOCALE}@firefox.mozilla.org + fi + fi + fi +fi # Prepare command line arguments script_args="" diff --git a/firefox.spec b/firefox.spec index a5bf5c9..c70bbdf 100644 --- a/firefox.spec +++ b/firefox.spec @@ -2,8 +2,8 @@ %define default_bookmarks_file %{_datadir}/bookmarks/default-bookmarks.html %define firefox_app_id \{ec8030f7-c20a-464f-9b0e-13a3a9e97384\} -%define mozappdir %{_libdir}/%{name}-%{internal_version} -%define tarballdir mozilla-1.9.2 +%define mozappdir %{_libdir}/%{name}-%{internal_version} +%define tarballdir mozilla-1.9.2 %define xulrunner_version 1.9.2.1-0.3.b3 %define internal_version 3.6 @@ -20,14 +20,14 @@ Summary: Mozilla Firefox Web browser Name: firefox Version: 3.6.1 -Release: 0.3.%{?prever}%{?dist} +Release: 0.4.%{?prever}%{?dist} URL: http://www.mozilla.org/projects/firefox/ License: MPLv1.1 or GPLv2+ or LGPLv2+ Group: Applications/Internet # From ftp://ftp.mozilla.org/pub/firefox/releases/%{version}%{?pretag}/source Source0: firefox-%{internal_version}%{?prever}.source.tar.bz2 %if %{build_langpacks} -Source2: firefox-langpacks-%{version}-20091118.tar.bz2 +Source2: firefox-langpacks-%{version}-20091125.tar.bz2 %endif Source10: firefox-mozconfig Source11: firefox-mozconfig-branded @@ -154,7 +154,8 @@ desktop-file-install --vendor mozilla \ # set up the firefox start script %{__rm} -rf $RPM_BUILD_ROOT%{_bindir}/firefox -%{__cat} %{SOURCE21} | %{__sed} -e 's,FIREFOX_VERSION,%{internal_version},g' > \ +%{__cat} %{SOURCE21} | %{__sed} -e 's,FIREFOX_VERSION,%{internal_version},g' \ + | %{__sed} -e "s,XULRUNNER_DIRECTORY,`pkg-config --variable=libdir libxul`,g" > \ $RPM_BUILD_ROOT%{_bindir}/firefox %{__chmod} 755 $RPM_BUILD_ROOT%{_bindir}/firefox @@ -217,11 +218,11 @@ ln -s %{default_bookmarks_file} $RPM_BUILD_ROOT/%{mozappdir}/defaults/profile/bo echo > ../%{name}.lang %if %{build_langpacks} # Install langpacks -%{__mkdir_p} $RPM_BUILD_ROOT/%{mozappdir}/extensions +%{__mkdir_p} $RPM_BUILD_ROOT/%{mozappdir}/langpacks %{__tar} xjf %{SOURCE2} for langpack in `ls firefox-langpacks/*.xpi`; do language=`basename $langpack .xpi` - extensiondir=$RPM_BUILD_ROOT/%{mozappdir}/extensions/langpack-$language@firefox.mozilla.org + extensiondir=$RPM_BUILD_ROOT/%{mozappdir}/langpacks/langpack-$language@firefox.mozilla.org %{__mkdir_p} $extensiondir unzip $langpack -d $extensiondir find $extensiondir -type f | xargs chmod 644 @@ -289,6 +290,7 @@ update-desktop-database &> /dev/null || : if [ $1 -eq 0 ]; then %{__rm} -rf %{mozappdir}/components %{__rm} -rf %{mozappdir}/extensions + %{__rm} -rf %{mozappdir}/langpacks %{__rm} -rf %{mozappdir}/plugins fi @@ -317,6 +319,7 @@ gtk-update-icon-cache %{_datadir}/icons/hicolor &>/dev/null || : %{mozappdir}/defaults %dir %{mozappdir}/extensions %{mozappdir}/extensions/{972ce4c6-7e08-4474-a285-3208198ce6fd} +%dir %{mozappdir}/langpacks %{mozappdir}/icons %{mozappdir}/searchplugins %{mozappdir}/firefox @@ -341,6 +344,9 @@ gtk-update-icon-cache %{_datadir}/icons/hicolor &>/dev/null || : #--------------------------------------------------------------------- %changelog +* Wed Nov 25 2009 Martin Stransky - 3.6.1-0.4.b3 +- Language pack updated (#284011) + * Fri Nov 20 2009 Martin Stransky - 3.6.1-0.3.b3 - Necko wifi monitor disabled - Added source URL (#521704) diff --git a/sources b/sources index edd0a17..48c71a8 100644 --- a/sources +++ b/sources @@ -1,2 +1,2 @@ f58d25b80c5fc0bad39b65359ce60abf firefox-3.6b3.source.tar.bz2 -e3e329e91911f78df3cae28f5e6615f3 firefox-langpacks-3.6.1-20091118.tar.bz2 +69cdba50f8694db0f4323b73f2e39471 firefox-langpacks-3.6.1-20091125.tar.bz2 -- cgit