#!/bin/sh
# postinst script for #PACKAGE#
# This scripts from isight-firmware-tools_1.0.2-0ubuntu0~ppa1
# package.
# see: dh_installdeb(1)

set -e

EXTRACT="/usr/bin/ift-extract"
. /usr/share/debconf/confmodule

case "$1" in
    configure)
	db_get isight-firmware-tools/extract || true
	if [ "$RET" = "true" ] ; then
	    db_get isight-firmware-tools/driver-location
	    if [ -f "$RET" ] ; then
		$EXTRACT --apple-driver "$RET" > /dev/null 2>&1
		if [ $? -eq 0 ] ;  then
			db_input high isight-firmware-tools/extract_success || true
		else
			db_input high isight-firmware-tools/extract_fail || true
		fi	
		db_go || ture
	    fi
	fi
	;;

    abort-upgrade|abort-remove|abort-deconfigure)
	;;

    *)
        echo "postinst called with unknown argument \`$1'" >&2
        exit 1
	;;
esac

# dh_installdeb will replace this with shell code automatically
# generated by other debhelper scripts.

#DEBHELPER#

exit 0


