#! /bin/sh
# RCS post_install,v 1.2 1999/04/20 21:03:39 tom Exp
#
# post_install script for mailapp-utilities Installer packages.
#
# author: Tom Hageman <tom@basil.icce.rug.nl>
#
#			Copyright (C) 1998  Tom Hageman
#

# set path to find utilities both on NS/OS and MacOSXS.
PATH=/bin:/usr/bin:/usr/ucb:/sbin:/usr/sbin:/etc:/usr/etc export PATH

pkgdir="$1"
destdir="$2"

OWNER=root.wheel

echo

# Get working directory for Installer.app.
workdir=`echo "$0" | sed 's:[^/]*$::;s://*$::'`
case "$workdir" in #((
/tmp/*|/private/tmp/*) ;;
*) workdir=/tmp
esac

cd "$destdir"

# Fix ownership when installing as root.
if [ "`whoami`" = "root" ]
then
	echo -n "    Changing ownership to $OWNER ... "
	if lsbom -s "$pkgdir"/`basename "$pkgdir" .pkg`.bom |
		xargs chown $OWNER
	then echo OK.
	else echo FAILED.
	fi
fi

echo "    ... done"
