#
# -- START --
# $Id: postinstall.solaris.sh,v 1.3 2000/11/27 20:09:32 papowell Exp papowell $
#
# We use this when we are building a package or doing an install
#
#
release=`uname -r | sed 's/\.//' | awk '{ n = $1; if( n > 0 ){ while( n < 100 ){ n = n *10;}}; print n; }'`
echo RUNNING postinstall.solaris MAKEPACKAGE="$MAKEPACKAGE" MAKEINSTALL="$MAKEINSTALL" PREFIX="$PREFIX" cwd `pwd` release $release
fix () {
	v=`echo $1 | sed -e 's/[:;].*//'`;
    p=`echo $2 | sed -e 's/:.*//'`; d=`dirname $p`;
	if expr "$p" : "\|" >/dev/null ; then
		echo "$v is a filter '$p'" 
		exit 0
	fi
	echo "Checking for $v.sample in $d"
	if [ ! -d "$d" ] ; then
		echo "Directory $d does not exist!"
		mkdir -p $d;
	fi
	if [ -f $v.sample ] ; then
		if [ $v.sample != $p.sample ] ; then cp $v.sample $p.sample; fi
	elif [ -f $v ] ; then
		if [ $v != $p.sample ] ; then cp $v $p.sample; fi
	else
		echo "Do not have $v.sample or $v"
	fi
	if [ ! -f $p.sample ] ; then
		echo "Do not have $p.sample"
	else
		if [ -f $p ] ; then
			date=`date | awk '{ print $6, $2, $3, $4;}' | sed -e 's/  */_/g' `
			echo "Saving $p in $p.$date"
			mv $p $p.$date
		fi
		chmod 644 $p.sample
		cp $p.sample $p;
		chmod 644 $p;
	fi;
}
echo "Installing configuration files"
if [ -f lprngtool.conf ] ; then
  fix lprngtool.conf "${DESTDIR}${LPRNGTOOL_CONF}";
else
  fix "${DESTDIR}${LPRNGTOOL_CONF}" "${DESTDIR}${LPRNGTOOL_CONF}"
fi
exit 0


syntax highlighted by Code2HTML, v. 0.9.1