#!/bin/sh
# ----------------------------------------------------------------------------
# Mozilla Setup Helper for GNU/Linux - "Have Java" Template
# Copyright (c)  2002 Thomas Lahn <PointedEars@gmx.de>
#
# Called without arguments, this program installs
#
# - the current Mozilla Linux release setup to /tmp
#
# - Macromedia Shockwave Flash Player (currently version 5.0 r51) Plug-in
#   to /usr/local/mozilla/plugins using the Flash Plugin Installer for
#   GNU/Linux as ../../Plugins/Flash/flash-linux-installer
#
#   Download flash-linux-installer from where you found this program (such
#   as //PointedEars or http://pointedears.de.vu/devel/mozilla/Linux/) and
#   simply run it to show further information.
#
#   Note: /usr/local/mozilla is the default directory as suggested by setup.
#   If you intend to install Mozilla to another directory, you must use
#   mozilla-linux-setup instead (see below). Otherwise, either the plugin
#   cannot be installed (i.e. flash-linux-installer will fail) or it will
#   not work.
#
# - the applications
#   * Preferences Toolbar 2.1.1
#     from ../_applications/prefbar-2.1.1.xpi
#   * Message-ID Finder 1.0
#     from ../_applications/messageidfinder.xpi
#
# You can modify the default behavior using the arguments
#
# $1    to define the path from which Mozilla Linux setup should be installed.
#       use - for the default
# $2-*  to define additional XUL applications (by their XPI) to be installed
#
# If your configuration does not match the defaults defined herein AND cannot
# be matched using these arguments, use the Mozilla Setup Wizard for GNU/Linux
# instead. Type `mozilla-linux-setup' for details.
#
# Send suggestions and bug reports to <bug-mozilla@PointedEars.de>
# ----------------------------------------------------------------------------

# if possible, make script directory the current directory
dir=`dirname $0 2> /dev/null`
test -n "$dir" && cd $dir

what="../../_releases/mozilla-1.3b-i686-pc-linux-gnu-sea.tar.gz"
test -n "$1" -a "$1" != "-" && what=$1
shift

xpi_list=("prefbar-2.1.1.xpi" "messageidfinder.xpi")
xpi_path=../../_applications/
for i in `seq 0 $((${#xpi_list[*]}-1))`; do
  xpi_list[$i]=$xpi_path${xpi_list[$i]}
done

if [ -x ./mozilla-linux-setup ]; then
  ./mozilla-linux-setup $what -c -f - "../../../browsers/Plugins/Flash/flash-linux-installer" -i ${xpi_list[*]} $*
else
  echo
  echo "Sorry, this requires PE's Mozilla Setup Wizard"
  echo "for GNU/Linux executable as mozilla-linux-setup"
  echo
fi
