#!/bin/sh
#
# Postinstallscript written by Ron Record (rr@sco.com) 
# 

scriptname="$0"
step="$1"
keywords="$2"
pkglist="$3"

# Source in the standard functions library, ccsSetup.sh
. ccsSetup.sh

ccs_return_value=0

XDEF=/usr/lib/X11/app-defaults/XClock
TOWN="Santa Cruz"

AppendResources() {
    echo "What town will xchrono be running in ? [Santa Cruz] \c"
    read city

    [ "$city" ] && TOWN=$city

    echo "\nI will setup xchrono to label the local time display as $TOWN"
    echo "Ok ? [y] (y/n) \c"
    read ans

    if [ "$ans" = "n" ]
    then
       TOWN=Local
    else
     [ "$ans" = "N" ] && TOWN=Local
    fi
    echo "xchrono.width:		802
xchrono.height:		270
xchrono.x:		-0
xchrono.y:		-0
xchrono.clockWidth:	125
xchrono.clockHeight:	125
xchrono*foreground:	cyan
xchrono*background:	midnight blue
xchrono.clockBox.background:	blue
xchrono.clockBox.forceBars:	on
xchrono.clockBox.useLeft:	on
xchrono.clockBox.useRight:	on
xchrono*hands:		midnight blue
xchrono*highlight:	yellow
xchrono*borderColor:	green
xchrono*borderWidth:	2
xchrono.localName:	$TOWN
xchrono.boston:		on
xchrono.rio:		on
!xchrono.newyork:	on
xchrono.chicago:	on
xchrono.denver:		on
!xchrono.la:		on
xchrono.hawaii:		on
xchrono.tokyo:		on
xchrono.sydney:		on
xchrono.london:		on
xchrono.paris:		on
xchrono.frankfurt:	on
" >> $XDEF
}

CleanUpResources() {
    grep -v xchrono $XDEF > /tmp/xdef$$
    cp /tmp/xdef$$ $XDEF
    rm -f /tmp/xdef$$
}

case "$step" in
        POST_EXPORT) AppendResources ;;
        POST_UNEXPORT) CleanUpResources ;;
esac

exit $ccs_return_value

