2004-09-09 21:55:48 +00:00
|
|
|
#!/bin/sh
|
|
|
|
#
|
|
|
|
# Startup script for the fedora.us Thunderbird RPM
|
|
|
|
# (based on the Mozilla RPM launch script)
|
|
|
|
#
|
|
|
|
|
2008-03-03 14:23:29 +00:00
|
|
|
##
|
|
|
|
## Variables
|
|
|
|
##
|
|
|
|
MOZ_ARCH=$(uname -m)
|
|
|
|
case $MOZ_ARCH in
|
2010-01-18 15:14:26 +00:00
|
|
|
x86_64 | s390x | sparc64 )
|
2008-03-03 14:23:29 +00:00
|
|
|
MOZ_LIB_DIR="/usr/lib64"
|
|
|
|
SECONDARY_LIB_DIR="/usr/lib"
|
|
|
|
;;
|
|
|
|
* )
|
|
|
|
MOZ_LIB_DIR="/usr/lib"
|
|
|
|
SECONDARY_LIB_DIR="/usr/lib64"
|
|
|
|
;;
|
|
|
|
esac
|
|
|
|
|
|
|
|
if [ ! -x $MOZ_LIB_DIR/thunderbird-TBIRD_VERSION/thunderbird ]; then
|
|
|
|
if [ ! -x $SECONDARY_LIB_DIR/thunderbird-TBIRD_VERSION/thunderbird ]; then
|
|
|
|
echo "Error: $MOZ_LIB_DIR/thunderbird-TBIRD_VERSION/thunderbird not found"
|
|
|
|
if [ -d $SECONDARY_LIB_DIR ]; then
|
|
|
|
echo " $SECONDARY_LIB_DIR/thunderbird-TBIRD_VERSION/thunderbird not found"
|
|
|
|
fi
|
|
|
|
exit 1
|
|
|
|
fi
|
|
|
|
MOZ_LIB_DIR="$SECONDARY_LIB_DIR"
|
2005-05-04 19:43:53 +00:00
|
|
|
fi
|
|
|
|
|
2008-03-03 14:23:29 +00:00
|
|
|
MOZ_DIST_BIN="$MOZ_LIB_DIR/thunderbird-TBIRD_VERSION"
|
|
|
|
MOZ_PROGRAM="$MOZ_DIST_BIN/thunderbird"
|
2010-01-18 15:14:26 +00:00
|
|
|
MOZ_LANGPACKS_DIR="$MOZ_DIST_BIN/langpacks"
|
|
|
|
MOZ_EXTENSIONS_PROFILE_DIR="$HOME/.mozilla/extensions/{3550f703-e582-4d05-9a08-453d09bdfdc6}"
|
2004-09-09 21:55:48 +00:00
|
|
|
|
2004-12-16 22:21:15 +00:00
|
|
|
##
|
2005-04-28 05:19:56 +00:00
|
|
|
## Set MOZ_ENABLE_PANGO is no longer used because Pango is enabled by default
|
|
|
|
## you may use MOZ_DISABLE_PANGO=1 to force disabling of pango
|
2004-12-16 22:21:15 +00:00
|
|
|
##
|
2005-04-28 05:19:56 +00:00
|
|
|
#MOZ_DISABLE_PANGO=1
|
2005-05-04 19:43:53 +00:00
|
|
|
#export MOZ_DISABLE_PANGO
|
2004-12-16 22:21:15 +00:00
|
|
|
|
2009-08-06 13:20:09 +00:00
|
|
|
##
|
|
|
|
## Set MOZ_APP_LAUNCHER for gnome-session
|
|
|
|
##
|
|
|
|
export MOZ_APP_LAUNCHER="/usr/bin/thunderbird"
|
|
|
|
|
2009-01-07 22:34:22 +00:00
|
|
|
##
|
|
|
|
## Disable the GNOME crash dialog, Moz has it's own
|
|
|
|
##
|
|
|
|
GNOME_DISABLE_CRASH_DIALOG=1
|
|
|
|
export GNOME_DISABLE_CRASH_DIALOG
|
|
|
|
|
2010-01-18 15:14:26 +00:00
|
|
|
##
|
|
|
|
## 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
|
|
|
|
#
|
|
|
|
|
|
|
|
##
|
|
|
|
## Automatically installed langpacks are tracked by .fedora-langpack-install
|
|
|
|
## config file.
|
|
|
|
##
|
|
|
|
FEDORA_LANGPACK_CONFIG="$MOZ_EXTENSIONS_PROFILE_DIR/.fedora-langpack-install"
|
|
|
|
|
|
|
|
# MOZ_DISABLE_LANGPACKS disables language packs completelly
|
|
|
|
MOZILLA_DOWN=0
|
|
|
|
if ! [ $MOZ_DISABLE_LANGPACKS ] || [ $MOZ_DISABLE_LANGPACKS -eq 0 ]; then
|
|
|
|
if [ -x $MOZ_DIST_BIN/mozilla-xremote-client ]; then
|
|
|
|
# Is thunderbird running?
|
|
|
|
$MOZ_DIST_BIN/mozilla-xremote-client -a thunderbird 'ping()' > /dev/null 2>&1
|
|
|
|
MOZILLA_DOWN=$?
|
|
|
|
fi
|
|
|
|
fi
|
|
|
|
|
|
|
|
# Modify language pack configuration only when thunderbird is not running
|
|
|
|
# and language packs are not disabled
|
|
|
|
if [ $MOZILLA_DOWN -ne 0 ]; then
|
|
|
|
|
|
|
|
# Clear already installed langpacks
|
|
|
|
mkdir -p $MOZ_EXTENSIONS_PROFILE_DIR
|
|
|
|
if [ -f $FEDORA_LANGPACK_CONFIG ]; then
|
|
|
|
rm `cat $FEDORA_LANGPACK_CONFIG` > /dev/null 2>&1
|
|
|
|
rm $FEDORA_LANGPACK_CONFIG > /dev/null 2>&1
|
|
|
|
fi
|
2010-04-13 10:05:18 +00:00
|
|
|
|
|
|
|
# Get locale from system
|
|
|
|
CURRENT_LOCALE=$LC_ALL
|
|
|
|
CURRENT_LOCALE=${CURRENT_LOCALE:-$LC_MESSAGES}
|
|
|
|
CURRENT_LOCALE=${CURRENT_LOCALE:-$LANG}
|
2010-01-18 15:14:26 +00:00
|
|
|
|
|
|
|
# Try without a local variant first, then with a local variant
|
|
|
|
# So that pt-BR doesn't try to use pt for example
|
2010-04-13 10:05:18 +00:00
|
|
|
SHORTMOZLOCALE=`echo $CURRENT_LOCALE | sed "s|_\([^.]*\).*||g"`
|
|
|
|
MOZLOCALE=`echo $CURRENT_LOCALE | sed "s|_\([^.]*\).*|-\1|g"`
|
2010-01-18 15:14:26 +00:00
|
|
|
|
2011-03-13 04:16:49 +00:00
|
|
|
function create_langpack_link() {
|
|
|
|
local language=$*
|
2011-08-16 15:18:40 +00:00
|
|
|
local langpack=langpack-${language}@thunderbird.mozilla.org.xpi
|
|
|
|
if [ -f $MOZ_LANGPACKS_DIR/$langpack ]; then
|
2011-03-13 04:16:49 +00:00
|
|
|
rm -rf $MOZ_EXTENSIONS_PROFILE_DIR/$langpack
|
|
|
|
ln -s $MOZ_LANGPACKS_DIR/$langpack \
|
|
|
|
$MOZ_EXTENSIONS_PROFILE_DIR/$langpack
|
|
|
|
echo $MOZ_EXTENSIONS_PROFILE_DIR/$langpack > $FEDORA_LANGPACK_CONFIG
|
|
|
|
return 0
|
2010-01-18 15:14:26 +00:00
|
|
|
fi
|
2011-03-13 04:16:49 +00:00
|
|
|
return 1
|
|
|
|
}
|
|
|
|
|
|
|
|
create_langpack_link $SHORTMOZLOCALE || create_langpack_link $MOZLOCALE || true
|
2010-01-18 15:14:26 +00:00
|
|
|
fi
|
|
|
|
|
2008-03-03 14:23:29 +00:00
|
|
|
exec $MOZ_PROGRAM "$@"
|