Debian package: Support XULRunner up to 22
[conkeror.git] / debian / bin / conkeror
blob7856b5238655f8e8bb4280a456f310b3434f59c4
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 `LC_ALL=C seq 22.0 -1 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
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"
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 "$@"