Debian package: Add support for xulrunner 15 and 16
[conkeror.git] / debian / conkeror.bin
blob7ebf264c1e28d0ec7ce580b360855d4e2304209d
1 #!/bin/sh
2 # Wrapper around xulrunner/firefox to start the xulrunner application conkeror
3 # Written by Axel Beckert <abe@deuxchevaux.org> for the Debian Project
5 # Find an appropriate xulrunner binary
6 XULRUNNER=''
7 # Due to http://bugs.debian.org/683157 we currently have to skip xulrunner-14.0
8 for version in  16.0 15.0 `LC_ALL=C seq 13.0 -1 5.0` 2.0 1.9.2 1.9.1; do
9     XRTMP=`which xulrunner-$version`
10     if [ -n "$XRTMP" -a -x "$XRTMP" ]; then
11         XULRUNNER=$XRTMP
12         break
13     fi
14 done
16 # Try firefox if no xulrunner can be found
17 if [ -z "$XULRUNNER" ]; then
18     FFTMP=`which firefox`
19     if [ -n "$FFTMP" -a -x "$FFTMP" ]; then
20         echo "xulrunner not found, trying firefox instead." 1>&2
21         XULRUNNER="$FFTMP -app"
22     fi
25 if [ -z "$XULRUNNER" ]; then
26     echo "xulrunner version 1.9.1 (or firefox version 3.5) or newer required, but not found. Bailing out." 1>&2
27     exit 1;
30 if [ "$*" = "--help" ]; then
31     errormsg="`exec $XULRUNNER /usr/share/conkeror/application.ini \"$@\" 2>&1`"
32     echo "$errormsg" | sed -e "s:/[^ ]*/xulrunner-bin:$0:; /-\(width\|height\)/d" 1>&2
33 else
34     exec $XULRUNNER /usr/share/conkeror/application.ini "$@"