# $NetBSD: INSTALL,v 1.1.1.1 2005/10/09 13:39:53 mrauch Exp $

# This file contains the contents of the OOo rpm 
# pre-install, post-install, pre-uninstall and post-uninstall scripts

PRODUCTINSTALLLOCATION=${PKG_PREFIX}/openoffice.org@VER@

case ${STAGE} in
PRE-INSTALL)
	# nothing to do
	;;

POST-INSTALL)
	if [ ! -f $PRODUCTINSTALLLOCATION/program/libfreetype.so.6 ]
	then
	  if [ -f $PRODUCTINSTALLLOCATION/program/filter/libfreetype.so.6 ]
	  then
	    ${LN} -s $PRODUCTINSTALLLOCATION/program/filter/libfreetype.so.6 $PRODUCTINSTALLLOCATION/program/libfreetype.so.6 >/dev/null 2>&1
	  fi
	fi

	if [ -d $PRODUCTINSTALLLOCATION/program/python-core-2.3.4 ]
	then
	  ${LN} -s $PRODUCTINSTALLLOCATION/program/python-core-2.3.4 $PRODUCTINSTALLLOCATION/program/python-core >/dev/null 2>&1
	fi

	if [ -f $PRODUCTINSTALLLOCATION/program/python.sh ]
	then
	  ${LN} -s $PRODUCTINSTALLLOCATION/program/python.sh $PRODUCTINSTALLLOCATION/program/python >/dev/null 2>&1
	fi

	if [ -f $PRODUCTINSTALLLOCATION/program/python-core-2.3.4/bin/python ]
	then
	  chmod +x $PRODUCTINSTALLLOCATION/program/python-core-2.3.4/bin/python
	fi
	;;

DEINSTALL)
	if [ -h $PRODUCTINSTALLLOCATION/program/libfreetype.so.6 ]
	then
	  ${RM} $PRODUCTINSTALLLOCATION/program/libfreetype.so.6 >/dev/null 2>&1
	fi

	if [ -h $PRODUCTINSTALLLOCATION/program/python-core ]
	then
	  ${RM} $PRODUCTINSTALLLOCATION/program/python-core >/dev/null 2>&1
	fi

	if [ -h $PRODUCTINSTALLLOCATION/program/python ]
	then
	  ${RM} $PRODUCTINSTALLLOCATION/program/python >/dev/null 2>&1
	fi
	;;

esac
