#!/bin/sh
# $OpenBSD: INSTALL,v 1.4 2000/04/10 17:03:12 brad Exp $
#
# Pre/post-installation setup of linux_lib

# exit on errors, use a sane path and install prefix
#
set -e
PATH=/bin:/usr/bin:/sbin:/usr/sbin
PREFIX=${PKG_PREFIX:-/usr/local/emul/linux}

# Function: tell the user what s/he needs to do to use the port just installed
#
do_notice()
{
    echo
    echo "+---------------"
    echo "| Installation of $1 complete. See compat_linux(8)"
    echo "| for more information."
    echo "+---------------"
    echo
}

# verify proper execution
#
if [ $# -ne 2 ]; then
    echo "usage: $0 distname { PRE-INSTALL | POST-INSTALL }" >&2
    exit 1
fi

# Verify/process the command
#
case $2 in
    PRE-INSTALL)
    	mkdir -p /emul
	mkdir -p ${PREFIX}
	ln -sf ${PREFIX} /emul/linux
	;;
    POST-INSTALL)
	do_notice $1
	;;
    *)
	echo "usage: $0 distname { PRE-INSTALL | POST-INSTALL }" >&2
	exit 1
	;;
esac

exit 0
