#
# Copyright 2004 Sun Microsystems, Inc.  All rights reserved.
# Use is subject to license terms.
#
#pragma ident	"@(#)postinstall.src	1.5	04/09/15 SMI"
#

# postinstall script for SUNWlibusbut - Sun Ray support for libusb
# Need to check for SUNWlibusb : Sun wrapper library for libusb

PATH=/bin:/usr/bin:/usr/sbin

if [ -z "$PKG_INSTALL_ROOT" ]; then PKG_INSTALL_ROOT=""; fi

set -u

LIBUSB_WRAPPER_DIR="$PKG_INSTALL_ROOT/usr/sfw/lib"
LIBUSB_PLUGINDIR="$LIBUSB_WRAPPER_DIR/libusb_plugins"

LIBUSB_SUNRAY_PLUGIN="$CLIENT_BASEDIR/SUNWut/lib/libusbut.so.1"

#
# SUNWlibusb pkg is needed along with SUNWlibusbut for 
# Sun Ray libusb support
#

if test ! -d "$LIBUSB_PLUGINDIR" ; then
	echo "The SUNWlibusb pkg is not installed on your system."
	echo "Please install this package from the Supplemental"
	echo "area of this software. Refer to libusbut man page"
	echo "to complete libusb installation by creating a sym link."
else
	/bin/ln -s $LIBUSB_SUNRAY_PLUGIN $LIBUSB_PLUGINDIR
fi

exit 0
