#!/bin/sh 

prog="zekr"
version=0.5.1.dfsg-1
purpose="Zekr provides an open platform for simply browsing and researching on the Holy Quran."

run () {
# Set path for the Mozilla SWT binding
MOZILLA_FIVE_HOME=${MOZILLA_FIVE_HOME%*/}
if false && [ -n "$MOZILLA_FIVE_HOME" -a -e $MOZILLA_FIVE_HOME/libgtkembedmoz.so ]; then
    :
elif [ -e /usr/lib/firefox/libgtkembedmoz.so ]; then
    export MOZILLA_FIVE_HOME=/usr/lib/firefox
elif [ -e /usr/lib/xulrunner/libgtkembedmoz.so ]; then
    export MOZILLA_FIVE_HOME=/usr/lib/xulrunner
elif [ -e /usr/lib/mozilla-firefox/libgtkembedmoz.so ]; then
    export MOZILLA_FIVE_HOME=/usr/lib/mozilla-firefox
elif [ -e /usr/lib/mozilla/libgtkembedmoz.so ]; then
    export MOZILLA_FIVE_HOME=/usr/lib/mozilla
else
    zenity --warning \
        --title="Integrated browser support not working" \
        --text="This Zekr build doesn't have support for the integrated browser."
    [ $? -eq 0 ] || exit 1
fi
DIR_NAME=`dirname $0`
cd $DIR_NAME
cd ../share/zekr/
./linux-run.sh
exit 0;

}

show_version () {
	echo "${prog} version ${version} -- ${purpose}";
}

usage () {
	echo "Usage: ${prog} [OPTIONS]
${purpose}

Options:
  -h, --help               show this help message.
  -v, --version            show the version.
  -c, --credits            show contributors.
  -l, --license            show license."

}

license () {
echo "# ${prog} ${version} -- ${purpose}
# Copyright (c) 2004-2007 Siahe.com.
# The Debian packaging is (C) 2007, Mohammad Derakhshani <zekr.debian@gmail.com> and
# is licensed under the Apache 2.0."
}

show_contributors () {
echo "Zekr is originally written and being developed by Mohsen Saboorian. 
There are other people working on it:
* Mohammad Mehdi Saboorian (technical consultant)
These peoples also helped with language packs and useful feedbacks:
* Ari R. Fikri (Indonesian language pack)
* Younes Moumen (French+Arabic language pack)
* Riyad Preukschas (German language pack)
* Ali Rastegar (Mac port)
* Michael Kalinin (Russian language pack + Russian translations)
* Omar sm (Critical bug reports)
* Aydin Tarık Zengin (Turkish language pack + Turkish translation)
* H N Jafar (Malay language pack)
* Erik van Luxzenburg (Dutch language pack)
* Muhammad Bashir Al-Noimi (Arabic language pack enhancements)
* Dangiislam.org (Kurdish language pack)
* Mohammad Derakhshani (Ubuntu package)
* Hamid Zarrabi-Zadeh (Quran text automatic verification)";
}

if [ $# = 0 ]; then run; fi	
for arg
do
	case "$arg" in
		--version|-v) show_version; exit 0;;
		--help|-[h?]) usage; exit 0;;
		--licen[cs]e|-l) license; exit 0;;
        --contributors|-c) show_contributors; exit 0;;
		--) shift;
    esac
    usage;
done
exit 0;



