source: projects/specs/trunk/f/firefox/firefox.vine.sh.in @ 1237

Revision 1237, 4.4 KB checked in by daisuke, 14 years ago (diff)

firefox: add vine specific files to svn repos.

Line 
1#!/bin/sh
2#
3# The contents of this file are subject to the Netscape Public
4# License Version 1.1 (the "License"); you may not use this file
5# except in compliance with the License. You may obtain a copy of
6# the License at http://www.mozilla.org/NPL/
7#
8# Software distributed under the License is distributed on an "AS
9# IS" basis, WITHOUT WARRANTY OF ANY KIND, either express or
10# implied. See the License for the specific language governing
11# rights and limitations under the License.
12#
13# The Original Code is mozilla.org code.
14#
15# The Initial Developer of the Original Code is Netscape
16# Communications Corporation.  Portions created by Netscape are
17# Copyright (C) 1998 Netscape Communications Corporation. All
18# Rights Reserved.
19#
20# Contributor(s):
21#
22
23##
24## Usage:
25##
26## $ mozilla
27##
28## This script is meant to run a mozilla program from the mozilla
29## rpm installation.
30##
31## The script will setup all the environment voodoo needed to make
32## mozilla work.
33
34cmdname=`basename $0`
35
36##
37## Variables
38##
39MOZ_ARCH=$(uname -m)
40case $MOZ_ARCH in
41        x86_64 | ia64 | s390 )
42                MOZ_LIB_DIR="/usr/lib64"
43                SECONDARY_LIB_DIR="/usr/lib"
44                ;;
45        * )
46                MOZ_LIB_DIR="/usr/lib"
47                SECONDARY_LIB_DIR="/usr/lib64"
48                ;;
49esac
50
51if [ ! -x $MOZ_LIB_DIR/firefox-FIREFOX_VERSION/firefox ]; then
52    if [ ! -x $SECONDARY_LIB_DIR/firefox-FIREFOX_VERSION/firefox ]; then
53        echo "Error: $MOZ_LIB_DIR/firefox-FIREFOX_VERSION/firefox not found"
54        if [ -d $SECONDARY_LIB_DIR ]; then
55            echo "       $SECONDARY_LIB_DIR/firefox-FIREFOX_VERSION/firefox not found"
56        fi
57        exit 1
58    fi
59    MOZ_LIB_DIR="$SECONDARY_LIB_DIR"
60fi
61MOZ_DIST_BIN="$MOZ_LIB_DIR/firefox-FIREFOX_VERSION"
62MOZ_EXTENSIONS_DIR="$MOZ_DIST_BIN/extensions"
63MOZ_PROGRAM="$MOZ_DIST_BIN/firefox"
64MOZ_LAUCHER="$MOZ_DIST_BIN/run-mozilla.sh"
65
66##
67## Set MOZ_GRE_CONF
68##
69MOZ_GRE_CONF=/etc/gre.d/gre.conf
70if [ "$MOZ_LIB_DIR" == "/usr/lib64" ]; then
71  MOZ_GRE_CONF=/etc/gre.d/gre64.conf
72fi
73export MOZ_GRE_CONF
74
75##
76## Set MOZILLA_FIVE_HOME
77##
78MOZILLA_FIVE_HOME="$MOZ_DIST_BIN"
79
80export MOZILLA_FIVE_HOME
81
82##
83## Select the propper plugin dir
84## Wrapped plug-ins are located in /lib/mozilla/plugins-wrapped
85##
86if [ -x "/usr/bin/mozilla-plugin-config" ]
87then
88  MOZ_PLUGIN_DIR="plugins-wrapped"
89else
90  MOZ_PLUGIN_DIR="plugins"
91fi
92
93##
94## Make sure that we set the plugin path
95##
96if [ "$MOZ_PLUGIN_PATH" ]
97then
98  MOZ_PLUGIN_PATH=$MOZ_PLUGIN_PATH:$MOZ_LIB_DIR/mozilla/$MOZ_PLUGIN_DIR:$MOZ_DIST_BIN/$MOZ_PLUGIN_DIR
99else
100  MOZ_PLUGIN_PATH=$MOZ_LIB_DIR/mozilla/$MOZ_PLUGIN_DIR:$MOZ_DIST_BIN/$MOZ_PLUGIN_DIR
101fi
102export MOZ_PLUGIN_PATH
103
104##
105## If plugins are wrapped, check them
106##
107if [ -x "/usr/bin/mozilla-plugin-config" ]
108then
109  /usr/bin/mozilla-plugin-config
110fi
111
112##
113## Set FONTCONFIG_PATH for Xft/fontconfig
114##
115FONTCONFIG_PATH="/etc/fonts:${MOZILLA_FIVE_HOME}/res/Xft"
116export FONTCONFIG_PATH
117
118##
119## Set MOZ_DISABLE_PANGO
120## Vine Linux's firefox is build with Pango rendering by default.
121## But Pango rendering cause slower rendering in some pages especially in CJK page.
122## So we disable it by default.
123##
124if [ ! "$MOZ_ENABLE_PANGO" == "1" ]
125then
126  MOZ_DISABLE_PANGO=1
127  export MOZ_DISABLE_PANGO
128fi
129
130##
131## firefox with flash on composite enabled X server
132##
133XLIB_SKIP_ARGB_VISUALS=1
134export XLIB_SKIP_ARGB_VISUALS
135
136##
137## use Pulseaudio on Flash-plugins, if pulseaudio server is available.
138##
139if ( /sbin/pidof pulseauido > /dev/null )
140then
141  FLASH_FORCE_PULSEAUDIO=1
142  export FLASH_FORCE_PULSEAUDIO
143fi
144
145# OK, here's where all the real work gets done
146
147# check system locale
148MOZARGS=
149MOZLOCALE=`echo $LANG | sed "s|_\([^.]*\).*|-\1|g"`
150MOZLOCALESHORT=`echo $MOZLOCALE | cut -f1 -d-`
151if [ -f $MOZILLA_FIVE_HOME/chrome/$MOZLOCALE.jar ] || [ -f $MOZILLA_FIVE_HOME/chrome/$MOZLOCALESHORT.jar ];
152then
153  MOZARGS="-UILocale $MOZLOCALE"
154else
155  MOZARGS="-UILocale en-US"
156fi
157# Prepare command line arguments
158script_args=""
159pass_arg_count=0
160while [ $# -gt $pass_arg_count ]
161do
162  case "$1" in
163    -g | --debug)
164      script_args="$script_args -g"
165      debugging=1
166      shift
167      ;;
168    -d | --debugger)
169      if [ $# -gt 1 ]; then
170        script_args="$script_args -d $2"
171        shift 2
172      else
173        shift
174      fi
175      ;;
176    *)
177      # Move the unrecognized argument to the end of the list.
178      arg="$1"
179      shift
180      set -- "$@" "$arg"
181      pass_arg_count=`expr $pass_arg_count + 1`
182      ;;
183  esac
184done
185
186# Run the browser
187debugging=0
188if [ $debugging = 1 ]
189then
190  echo $MOZ_LAUCHER $script_args $MOZ_PROGRAM $MOZARGS "$@"
191fi
192
193exec $MOZ_LAUCHER $script_args $MOZ_PROGRAM $MOZARGS "$@"
Note: See TracBrowser for help on using the repository browser.