#! /bin/sh
#
# $OpenBSD: INSTALL,v 1.1 2000/12/13 05:26:48 jasoni Exp $
#
# python2 installation

set -e
PATH=/bin:/usr/bin:/sbin:/usr/sbin
PREFIX=${PKG_PREFIX:-/usr/local}

do_notice_top()
{
	echo 
	echo "+---------------"
	echo "|"
	echo "| $1 installation status:"
	echo "|"
	echo "|    - the man page has been installed as python2"
}

do_notice_oldpython()
{
	echo "|    - there appears to another version of python installed, to avoid"
	echo "|      conflict, this python binary has been installed as:"
	echo "|          /usr/local/bin/python2.0"
}

do_notice_bottom()
{
	echo "|"
	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)
	: nothing to pre-install for this port
        ;;
    POST-INSTALL)
    	do_notice_top $1
	if [ ! -e /usr/local/bin/python ]; then
		ln -s python2.0 /usr/local/bin/python
	else
		do_notice_oldpython $1
	fi
        do_notice_bottom $1
        ;;
    *)
        echo "usage: $0 distname { PRE-INSTALL | POST-INSTALL }" >&2
        exit 1
        ;;
esac

exit 0
