#!/bin/bash
# ----------------------------------------------------------------------------
# Mozilla Setup Helper for GNU/Linux - "Have Plugins" Template
# Copyright (c)  2002 Thomas Lahn <PointedEars@gmx.de>
#
# Called without arguments, this program installs
#
# - the current Mozilla Linux release setup to /tmp
# - already installed plugins from /usr/local/netscape/plugins/
# - 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 -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
