Debian package: Add support for xulrunner 28
[conkeror.git] / debian / bin / conkeror
blobc1c57ee08d7b42c9a4f983d96888e654bcd8697a
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 28 -1 15` `LC_ALL=C seq 13 -1 5` 2 1.9.2 1.9.1; do
9 for subversion in $version $version.0; do
10 XRTMP=`which xulrunner-$subversion`
11 if [ -n "$XRTMP" -a -x "$XRTMP" ]; then
12 XULRUNNER=$XRTMP
13 break 2
15 done
16 done
18 # Try firefox if no xulrunner can be found
19 if [ -z "$XULRUNNER" ]; then
20 FFTMP=`which firefox`
21 if [ -n "$FFTMP" -a -x "$FFTMP" ]; then
22 echo "xulrunner not found, trying firefox instead." 1>&2
23 XULRUNNER="$FFTMP -app"
27 if [ -z "$XULRUNNER" ]; then
28 echo "xulrunner version 1.9.1 (or firefox version 3.5) or newer required, but not found. Bailing out." 1>&2
29 exit 1;
32 if [ "$*" = "--help" ]; then
33 errormsg="`exec $XULRUNNER /usr/share/conkeror/application.ini \"$@\" 2>&1`"
34 echo "$errormsg" | sed -e "s:/[^ ]*/xulrunner-bin:$0:; /-\(width\|height\)/d" 1>&2
35 else
36 exec $XULRUNNER /usr/share/conkeror/application.ini "$@"