#!/bin/sh
#
# $FreeBSD: head/x11/nvidia-driver/files/pkg-deinstall.in 373483 2014-11-27 13:14:04Z kwm $
#

PREFIX=${PKG_PREFIX-/usr/local}

case $2 in
DEINSTALL)
	/bin/rm -f ${PREFIX}/lib/libGL.so*
	/bin/rm -f ${PREFIX}/lib/xorg/modules/extensions/libglx.so*

	/bin/ln -f ${PREFIX}/lib/.mesa/libGL.so.1.2.0 ${PREFIX}/lib/libGL.so
	/bin/ln -f ${PREFIX}/lib/.mesa/libGL.so.1.2.0 ${PREFIX}/lib/libGL.so.1
	/bin/ln -f ${PREFIX}/lib/.mesa/libGL.so.1.2.0 ${PREFIX}/lib/libGL.so.1.2.0
	/bin/ln -f ${PREFIX}/lib/xorg/modules/extensions/.xorg/libglx.so \
		${PREFIX}/lib/xorg/modules/extensions/libglx.so


	if [ -f ${PREFIX}/lib/.mesa/libEGL.so.1 ]; then
		/bin/rm -f ${PREFIX}/lib/libEGL.so*
		/bin/ln -f ${PREFIX}/lib/.mesa/libEGL.so.1.0.0 ${PREFIX}/lib/libEGL.so
		/bin/ln -f ${PREFIX}/lib/.mesa/libEGL.so.1.0.0 ${PREFIX}/lib/libEGL.so.1
		/bin/ln -f ${PREFIX}/lib/.mesa/libEGL.so.1.0.0 ${PREFIX}/lib/libEGL.so.1.0.0
	fi
	if [ -f ${PREFIX}/lib/.mesa/libGLESv2.so.2 ]; then
		/bin/rm -f ${PREFIX}/lib/libGLESv2.so*
		/bin/ln -f ${PREFIX}/lib/.mesa/libGLESv2.so.2.0.0 ${PREFIX}/lib/libGLESv2.so
		/bin/ln -f ${PREFIX}/lib/.mesa/libGLESv2.so.2.0.0 ${PREFIX}/lib/libGLESv2.so.2
		/bin/ln -f ${PREFIX}/lib/.mesa/libGLESv2.so.2.0.0 ${PREFIX}/lib/libGLESv2.so.2.0.0
	fi
	;;
esac
