r3365: Sort by {user,group} now sorts by name, not {uid,gid}.
[rox-filer.git] / ROX-Filer / AppRun
blob86baf275aee843fb9e15300878aa1f57b11dc127
1 #!/bin/sh
3 PROG=ROX-Filer
5 APP_DIR=`dirname $0`
6 APP_DIR=`cd "$APP_DIR";pwd`; export APP_DIR
8 ARCH=`uname -m`
9 case "$ARCH" in
10 i?86) ARCH=ix86 ;;
11 esac
13 PLATFORM=`uname -s`-"$ARCH"
15 DEBUGGER=""
17 case $1 in
18 --debug) shift ;
19 if [ "$#" = 0 ] ; then
20 DEBUGGER="gdb --args" ; DEBUG_OPTIONS="-n --g-fatal-warnings"
21 else
22 DEBUGGER="gdb"
23 fi ;;
24 --valgrind) shift ; DEBUGGER="valgrind --num-callers=8";;
25 --compile)
26 shift
27 if [ ! -d "$APP_DIR/src" ] ; then
28 echo "ERROR from $0:" >&2
29 echo "Cannot compile - source code is missing!" >&2
30 exit 1
32 echo "Compiling $APP_DIR... please wait..." >&2
33 if [ ! -x "$APP_DIR/src/configure" ]; then
34 echo "No 'configure' script! Trying to run autoconf..."
35 (cd "$APP_DIR/src"; autoconf)
37 rm -f "$APP_DIR/src/config.cache"
38 cd "$APP_DIR/src" && ./configure --enable-rox \
39 --with-platform="$PLATFORM" \
40 "$@" \
41 && make clean && make && echo Done >&2 && exit 0
42 echo Compile failed >&2
43 echo Press Return... >&2
44 read WAIT
45 exit 1
46 esac
48 if [ -z "$XDG_DATA_DIRS" -a -d /uri/0install/zero-install.sourceforge.net ]; then
49 # Try to get MIME database through Zero Install, if possible
50 0refresh zero-install.sourceforge.net/share/mime 2003-08-07
51 XDG_DATA_DIRS=/usr/local/share/:/usr/share/:/uri/0install/zero-install.sourceforge.net/share
52 export XDG_DATA_DIRS
55 BIN="$APP_DIR/$PLATFORM/$PROG"
57 if [ -x "$BIN" ]; then
58 exec $DEBUGGER "$BIN" $DEBUG_OPTIONS "$@"
59 else
60 echo "ERROR from $0:" >&2
61 echo "I cannot find an executable file for your host type ($PLATFORM)." >&2
62 echo "Trying to compile..." >&2
63 if [ -n "$DISPLAY" ]; then
64 xterm -e "$0" --compile
65 else
66 "$0" --compile
68 if [ -x "$BIN" ]; then
69 exec "$BIN" "$@"
71 exit 1