Debian package: XULRunner Bump: Default is 9.0, add support for 11.0
[conkeror.git] / debian / conkeror.bin
blob46aede3f847b019b8107bae6a9aed4e2f26985c3
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 for version in 11.0 10.0 9.0 8.0 7.0 6.0 5.0 2.0 1.9.2 1.9.1; do
8     XRTMP=`which xulrunner-$version`
9     if [ -n "$XRTMP" -a -x "$XRTMP" ]; then
10         XULRUNNER=$XRTMP
11         break
12     fi
13 done
15 # Try firefox if no xulrunner can be found
16 if [ -z "$XULRUNNER" ]; then
17     FFTMP=`which firefox`
18     if [ -n "$FFTMP" -a -x "$FFTMP" ]; then
19         echo "xulrunner not found, trying firefox instead." 1>&2
20         XULRUNNER="$FFTMP -app"
21     fi
24 if [ -z "$XULRUNNER" ]; then
25     echo "xulrunner version 1.9.1 (or firefox version 3.5) or newer required, but not found. Bailing out." 1>&2
26     exit 1;
29 if [ "$*" = "--help" ]; then
30     errormsg="`exec $XULRUNNER /usr/share/conkeror/application.ini \"$@\" 2>&1`"
31     echo "$errormsg" | sed -e "s:/[^ ]*/xulrunner-bin:$0:; /-\(width\|height\)/d" 1>&2
32 else
33     exec $XULRUNNER /usr/share/conkeror/application.ini "$@"