| #!/bin/bash |
| |
| |
| |
| |
| |
| |
| |
| |
| MOZ_ARCH=$(uname -m) |
| case $MOZ_ARCH in |
| x86_64 | s390x | sparc64 ) |
| 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/thunderbird ]; then |
| if [ ! -x $SECONDARY_LIB_DIR/thunderbird/thunderbird ]; then |
| echo "Error: $MOZ_LIB_DIR/thunderbird/thunderbird not found" |
| if [ -d $SECONDARY_LIB_DIR ]; then |
| echo " $SECONDARY_LIB_DIR/thunderbird/thunderbird not found" |
| fi |
| exit 1 |
| fi |
| MOZ_LIB_DIR="$SECONDARY_LIB_DIR" |
| fi |
| |
| MOZ_DIST_BIN="$MOZ_LIB_DIR/thunderbird" |
| MOZ_PROGRAM="$MOZ_DIST_BIN/thunderbird" |
| MOZ_LANGPACKS_DIR="$MOZ_DIST_BIN/langpacks" |
| MOZ_EXTENSIONS_PROFILE_DIR="$HOME/.mozilla/extensions/{3550f703-e582-4d05-9a08-453d09bdfdc6}" |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| export MOZ_APP_LAUNCHER="/usr/bin/thunderbird" |
| |
| |
| |
| |
| GNOME_DISABLE_CRASH_DIALOG=1 |
| export GNOME_DISABLE_CRASH_DIALOG |
| |
| |
| |
| |
| export G_SLICE=always-malloc |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| FEDORA_LANGPACK_CONFIG="$MOZ_EXTENSIONS_PROFILE_DIR/.fedora-langpack-install" |
| |
| |
| MOZILLA_DOWN=0 |
| if ! [ $MOZ_DISABLE_LANGPACKS ] || [ $MOZ_DISABLE_LANGPACKS -eq 0 ]; then |
| pidof thunderbird > /dev/null 2>&1 |
| MOZILLA_DOWN=$? |
| fi |
| |
| |
| |
| if [ $MOZILLA_DOWN -ne 0 ]; then |
| |
| |
| 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 |
| |
| rmdir $MOZ_EXTENSIONS_PROFILE_DIR/lang* > /dev/null 2>&1 |
| fi |
| |
| |
| CURRENT_LOCALE=$LC_ALL |
| CURRENT_LOCALE=${CURRENT_LOCALE:-$LC_MESSAGES} |
| CURRENT_LOCALE=${CURRENT_LOCALE:-$LANG} |
| |
| |
| |
| SHORTMOZLOCALE=`echo $CURRENT_LOCALE | sed "s|_\([^.]*\).*||g"` |
| MOZLOCALE=`echo $CURRENT_LOCALE | sed "s|_\([^.]*\).*|-\1|g"` |
| |
| function create_langpack_link() { |
| local language=$* |
| local langpack=langpack-${language}@thunderbird.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 |
| echo $MOZ_EXTENSIONS_PROFILE_DIR/$langpack > $FEDORA_LANGPACK_CONFIG |
| return 0 |
| fi |
| return 1 |
| } |
| |
| create_langpack_link $SHORTMOZLOCALE || create_langpack_link $MOZLOCALE || true |
| fi |
| |
| |
| NSS_SSL_CBC_RANDOM_IV=${NSS_SSL_CBC_RANDOM_IV-1} |
| export NSS_SSL_CBC_RANDOM_IV |
| |
| |
| %RHEL_ENV_VARS% |
| |
| |
| if ! dbus-send --session \ |
| --dest=org.freedesktop.DBus \ |
| --type=method_call \ |
| --print-reply \ |
| /org/freedesktop/DBus \ |
| org.freedesktop.DBus.ListNames \ |
| | grep org.a11y.Bus > /dev/null; then |
| if [ -f "$MOZ_LIB_DIR/firefox/bundled/libexec/at-spi-bus-launcher" ]; then |
| echo "Starting a11y dbus service..." |
| $MOZ_LIB_DIR/firefox/bundled/libexec/at-spi-bus-launcher & |
| else |
| echo "Running without a11y support!" |
| fi |
| fi |
| |
| exec $MOZ_PROGRAM "$@" |