690287
#!/bin/bash
29a772
#
29a772
# The contents of this file are subject to the Netscape Public
29a772
# License Version 1.1 (the "License"); you may not use this file
29a772
# except in compliance with the License. You may obtain a copy of
29a772
# the License at http://www.mozilla.org/NPL/
29a772
#
29a772
# Software distributed under the License is distributed on an "AS
29a772
# IS" basis, WITHOUT WARRANTY OF ANY KIND, either express or
29a772
# implied. See the License for the specific language governing
29a772
# rights and limitations under the License.
29a772
#
29a772
# The Original Code is mozilla.org code.
29a772
#
29a772
# The Initial Developer of the Original Code is Netscape
29a772
# Communications Corporation.  Portions created by Netscape are
29a772
# Copyright (C) 1998 Netscape Communications Corporation. All
29a772
# Rights Reserved.
29a772
#
29a772
# Contributor(s): 
29a772
#
29a772
29a772
## 
29a772
## Usage:
29a772
##
29a772
## $ firefox
29a772
##
29a772
## This script is meant to run a mozilla program from the mozilla
29a772
## rpm installation.
29a772
##
29a772
## The script will setup all the environment voodoo needed to make
29a772
## mozilla work.
29a772
29a772
cmdname=`basename $0`
29a772
29a772
##
29a772
## Variables
29a772
##
29a772
MOZ_ARCH=$(uname -m)
29a772
case $MOZ_ARCH in
29a772
	x86_64 | s390x | sparc64)
844667
		MOZ_LIB_DIR="%PREFIX%/lib64"
844667
		SECONDARY_LIB_DIR="%PREFIX%/lib"
29a772
		;;
29a772
	* )
844667
		MOZ_LIB_DIR="%PREFIX%/lib"
844667
		SECONDARY_LIB_DIR="%PREFIX%/lib64"
29a772
		;;
29a772
esac
29a772
29a772
MOZ_FIREFOX_FILE="firefox"
29a772
29a772
if [ ! -r $MOZ_LIB_DIR/firefox/$MOZ_FIREFOX_FILE ]; then
29a772
    if [ ! -r $SECONDARY_LIB_DIR/firefox/$MOZ_FIREFOX_FILE ]; then
29a772
	echo "Error: $MOZ_LIB_DIR/firefox/$MOZ_FIREFOX_FILE not found"
29a772
	if [ -d $SECONDARY_LIB_DIR ]; then
29a772
	    echo "       $SECONDARY_LIB_DIR/firefox/$MOZ_FIREFOX_FILE not found"
29a772
	fi
29a772
	exit 1
29a772
    fi
29a772
    MOZ_LIB_DIR="$SECONDARY_LIB_DIR"
29a772
fi
29a772
MOZ_DIST_BIN="$MOZ_LIB_DIR/firefox"
29a772
MOZ_PROGRAM="$MOZ_DIST_BIN/$MOZ_FIREFOX_FILE"
29a772
MOZ_LAUNCHER="$MOZ_DIST_BIN/run-mozilla.sh"
d417c4
29a772
##
29a772
## Set MOZ_GRE_CONF
29a772
##
29a772
MOZ_GRE_CONF=/etc/gre.d/gre.conf
29a772
if [ "$MOZ_LIB_DIR" == "/usr/lib64" ]; then
29a772
  MOZ_GRE_CONF=/etc/gre.d/gre64.conf
29a772
fi
29a772
export MOZ_GRE_CONF
29a772
29a772
##
29a772
## Set MOZILLA_FIVE_HOME
29a772
##
29a772
MOZILLA_FIVE_HOME="$MOZ_DIST_BIN"
29a772
29a772
export MOZILLA_FIVE_HOME
29a772
29a772
##
29a772
## Make sure that we set the plugin path
29a772
##
d417c4
MOZ_PLUGIN_DIR="plugins"
d417c4
29a772
if [ "$MOZ_PLUGIN_PATH" ]
29a772
then
29a772
  MOZ_PLUGIN_PATH=$MOZ_PLUGIN_PATH:$MOZ_LIB_DIR/mozilla/$MOZ_PLUGIN_DIR:$MOZ_DIST_BIN/$MOZ_PLUGIN_DIR
29a772
else
29a772
  MOZ_PLUGIN_PATH=$MOZ_LIB_DIR/mozilla/$MOZ_PLUGIN_DIR:$MOZ_DIST_BIN/$MOZ_PLUGIN_DIR
29a772
fi
29a772
export MOZ_PLUGIN_PATH
29a772
29a772
##
29a772
## Set MOZ_APP_LAUNCHER for gnome-session
29a772
##
844667
export MOZ_APP_LAUNCHER="%PREFIX%/bin/firefox"
29a772
29a772
##
29a772
## In order to better support certain scripts (such as Indic and some CJK 
29a772
## scripts), Fedora builds its Firefox, with permission from the Mozilla 
29a772
## Corporation, with the Pango system as its text renderer.  This change 
29a772
## may negatively impact performance on some pages.  To disable the use of
29a772
## Pango, set MOZ_DISABLE_PANGO=1 in your environment before launching
29a772
## Firefox.
29a772
##
29a772
#
29a772
# MOZ_DISABLE_PANGO=1
29a772
# export MOZ_DISABLE_PANGO
29a772
#
29a772
29a772
##
29a772
## Disable the GNOME crash dialog, Moz has it's own
29a772
##
29a772
GNOME_DISABLE_CRASH_DIALOG=1
29a772
export GNOME_DISABLE_CRASH_DIALOG
29a772
0d783c
##
0d783c
## Disable the SLICE allocator (rhbz#1014858)
0d783c
##
0d783c
export G_SLICE=always-malloc
0d783c
d417c4
##
d417c4
## Enable Xinput2 (mozbz#1207973)
d417c4
##
d417c4
export MOZ_USE_XINPUT2=1
d417c4
690287
# BEAST fix (rhbz#1005611)
29a772
NSS_SSL_CBC_RANDOM_IV=${NSS_SSL_CBC_RANDOM_IV-1}
29a772
export NSS_SSL_CBC_RANDOM_IV
29a772
29a772
# Prepare command line arguments
29a772
script_args=""
29a772
pass_arg_count=0
29a772
while [ $# -gt $pass_arg_count ]
29a772
do
29a772
  case "$1" in
29a772
    -g | --debug)
29a772
      script_args="$script_args -g"
29a772
      debugging=1
29a772
      shift
29a772
      ;;
29a772
    -d | --debugger)
29a772
      if [ $# -gt 1 ]; then
29a772
        script_args="$script_args -d $2"
29a772
        shift 2
29a772
      else
29a772
        shift
29a772
      fi
29a772
      ;;
29a772
    *)
29a772
      # Move the unrecognized argument to the end of the list.
29a772
      arg="$1"
29a772
      shift
29a772
      set -- "$@" "$arg"
29a772
      pass_arg_count=`expr $pass_arg_count + 1`
29a772
      ;;
29a772
  esac
29a772
done
29a772
58eb7f
# Linux version specific environment variables
58eb7f
%RHEL_ENV_VARS%
58eb7f
727eab
# Don't throw "old profile" dialog box.
727eab
export MOZ_ALLOW_DOWNGRADE=1
727eab
29a772
# Run the browser
29a772
exec $MOZ_LAUNCHER $script_args $MOZ_PROGRAM "$@"