#!/bin/sh

DISTRIBUTION="${distribution}"

DIVERT_TARGETS="libEGL.so libEGL.so.1 libEGL.so.1.0.0 libGLESv1_CM.so libGLESv1_CM.so.1 libGLESv1_CM.so.1.1.0 \
	libGLESv2.so libGLESv2.so.2 libGLESv2.so.2.0.0"

if [ remove = "$1" -o abort-install = "$1" ] && [ "Debian" = "$DISTRIBUTION" ]; then
	for f in $DIVERT_TARGETS; do
		dpkg-divert --package libmali-sunxi-r3p0 --remove --rename \
			--divert /usr/lib/${DEB_HOST_MULTIARCH}/mali-divert/${f} /usr/lib/${DEB_HOST_MULTIARCH}/${f}
	done
	rm -rf /usr/lib/${DEB_HOST_MULTIARCH}/mali-divert
	LDCONFIG_NOTRIGGER=y ldconfig
fi

#DEBHELPER#

exit 0
