#!/bin/ksh

PKG_INSTALL_ROOT=$ROOTDIR

#
# Remove whatever directories removef approves
#

if [ -h ${PKG_INSTALL_ROOT}/platform/SUNW,Netra-CP3010/kernel/crypto/sparcv9/aes ] ; then
        rm -f `removef -R ${PKG_INSTALL_ROOT} SUNWcakr /platform/SUNW,Netra-CP3010/kernel/crypto/sparcv9/aes` 1>/dev/null 2>&1
fi

rmdir `removef -R ${PKG_INSTALL_ROOT} SUNWcakr /platform/SUNW,Netra-CP3010/kernel/crypto/sparcv9` 1>/dev/null 2>&1
rmdir `removef -R ${PKG_INSTALL_ROOT} SUNWcakr /platform/SUNW,Netra-CP3010/kernel/crypto` 1>/dev/null 2>&1

rmdir `removef -R ${PKG_INSTALL_ROOT} SUNWcakr /platform/SUNW,Netra-CP3010/kernel/misc/sparcv9` 1>/dev/null 2>&1
rmdir `removef -R ${PKG_INSTALL_ROOT} SUNWcakr /platform/SUNW,Netra-CP3010/kernel/misc` 1>/dev/null 2>&1

rmdir `removef -R ${PKG_INSTALL_ROOT} SUNWcakr /platform/SUNW,Netra-CP3010/kernel` 1>/dev/null 2>&1
rmdir `removef -R ${PKG_INSTALL_ROOT} SUNWcakr /platform/SUNW,Netra-CP3010` 1>/dev/null 2>&1
rmdir `removef -R ${PKG_INSTALL_ROOT} SUNWcakr /platform/` 1>/dev/null 2>&1

removef -R ${PKG_INSTALL_ROOT} -f SUNWcakr

if [ -h ${PKG_INSTALL_ROOT}/platform/SUNW,Netra-CP3010/lib/sparcv9/libmd5_psr.so.1 ] ; then
        rm -f `removef -R ${PKG_INSTALL_ROOT} SUNWcar /platform/SUNW,Netra-CP3010/lib/sparcv9/libmd5_psr.so.1` 1>/dev/null 2>&1
fi

if [ -h ${PKG_INSTALL_ROOT}/platform/SUNW,Netra-CP3010/lib/sparcv9/libc_psr.so.1 ] ; then
        rm -f `removef -R ${PKG_INSTALL_ROOT} SUNWcar /platform/SUNW,Netra-CP3010/lib/sparcv9/libc_psr.so.1` 1>/dev/null 2>&1
fi

rmdir `removef -R ${PKG_INSTALL_ROOT} SUNWcar /platform/SUNW,Netra-CP3010/lib/sparcv9` 1>/dev/null 2>&1


if [ -h ${PKG_INSTALL_ROOT}/platform/SUNW,Netra-CP3010/lib/libmd5_psr.so.1 ] ; then
        rm -f `removef -R ${PKG_INSTALL_ROOT} SUNWcar /platform/SUNW,Netra-CP3010/lib/libmd5_psr.so.1` 1>/dev/null 2>&1
fi

if [ -h ${PKG_INSTALL_ROOT}/platform/SUNW,Netra-CP3010/lib/libc_psr.so.1 ] ; then
        rm -f `removef -R ${PKG_INSTALL_ROOT} SUNWcar /platform/SUNW,Netra-CP3010/lib/libc_psr.so.1` 1>/dev/null 2>&1
fi

rmdir `removef -R ${PKG_INSTALL_ROOT} SUNWcar /platform/SUNW,Netra-CP3010/lib` 1>/dev/null 2>&1
rmdir `removef -R ${PKG_INSTALL_ROOT} SUNWcar /platform/SUNW,Netra-CP3010` 1>/dev/null 2>&1
rmdir `removef -R ${PKG_INSTALL_ROOT} SUNWcar /platform/` 1>/dev/null 2>&1

removef -R ${PKG_INSTALL_ROOT} -f SUNWcar

exit 0

