#!/bin/bash

# gnome-web-photo launcher, helps the application to choose a xulrunner
# as Ubuntu doesn't include xulrunner on normal library locations

# Author: Emilio López <turl@tuxfamily.org>
# License: GPLv2 or later

# Choose a xulrunner
MOZLIBPATH="NONE"
for possiblepath in /usr/lib/xulrunner-1.9.2*; do
	if [ -d $possiblepath ]; then
		MOZLIBPATH=$possiblepath
	fi
done

if [ "$MOZLIBPATH" == "NONE" ] ; then
	# No 1.9 xulrunner, take any other
	for possiblepath in /usr/lib/xulrunner-*; do
		if [ -d $possiblepath ]; then
			MOZLIBPATH=$possiblepath
		fi
	done

fi

# Launch gnome-web-photo
LD_LIBRARY_PATH="$MOZLIBPATH:$LD_LIBRARY_PATH" \
	/usr/bin/gnome-web-photo.real $@
