#!/bin/sh
/bin/echo "           -- Removing symbolic links"

if [ -z $1 ]; then
    exit 0
fi

if [ -z $RPM_INSTALL_PREFIX ] ; then
  RPM_INSTALL_PREFIX=`/usr/bin/dirname $0`
  cd $RPM_INSTALL_PREFIX
fi

/bin/rm $RPM_INSTALL_PREFIX/unix_scan_drivers/jre/lib/amd64/server/libjsig.so
/bin/rm $RPM_INSTALL_PREFIX/unix_scan_drivers/jre/man/ja
/bin/rm /usr/lexscan
/bin/rm /usr/lib64/sane/libsane-lexmark_nscan.so
/bin/rm /usr/lib64/sane/libsane-lexmark_nscan.so.1
/bin/rm /usr/lib64/sane/libsane-lexmark_nscan.so.1.0.16
/bin/rm /usr/share/locale/ar/LC_MESSAGES/sane-lexmark_nscan.mo
/bin/rm /usr/share/locale/de/LC_MESSAGES/sane-lexmark_nscan.mo
/bin/rm /usr/share/locale/es/LC_MESSAGES/sane-lexmark_nscan.mo
/bin/rm /usr/share/locale/fr/LC_MESSAGES/sane-lexmark_nscan.mo
/bin/rm /usr/share/locale/it/LC_MESSAGES/sane-lexmark_nscan.mo
/bin/rm /usr/share/locale/ja/LC_MESSAGES/sane-lexmark_nscan.mo
/bin/rm /usr/share/locale/ko/LC_MESSAGES/sane-lexmark_nscan.mo
/bin/rm /usr/share/locale/pl/LC_MESSAGES/sane-lexmark_nscan.mo
/bin/rm /usr/share/locale/pt/LC_MESSAGES/sane-lexmark_nscan.mo
/bin/rm /usr/share/locale/ru/LC_MESSAGES/sane-lexmark_nscan.mo
/bin/rm /usr/share/locale/zh/LC_MESSAGES/sane-lexmark_nscan.mo
/bin/rm /usr/share/locale/zh_TW/LC_MESSAGES/sane-lexmark_nscan.mo
/bin/rm /etc/sane.d/lexmark_nscan.conf
/bin/rm /etc/sane.d/scan13.conf
/bin/rm /etc/sane.d/scan14.conf
/bin/rm /etc/sane.d/scan16.conf
/bin/rm /etc/sane.d/scan17.conf
/bin/rm /etc/sane.d/scan6.conf
/bin/rm /etc/sane.d/scan.conf
/bin/rm /etc/udev/rules.d/99-lexmark.rules
  
if [ -f "/sbin/udevadm" ] ; then
   udevadm_version=`/sbin/udevadm version`
   udevadm_new_version=126
   if [ $udevadm_version -gt $udevadm_new_version ] ; then
        /sbin/udevadm control --reload-rules
   else
        /sbin/udevadm control --reload_rules
   fi
fi

exit 0
