#!/bin/sh
# Removal script for Printer Mac version 1.0.
# Produced using ESP Package Manager v4.1; report problems to epm@easysw.com.
#%product Printer Mac
#%vendor Xerox
#%copyright 2008-04-9 Xerox
#%version 1.0 1000000
#%description Raster printer driver
#%rootsize 14078
#%usrsize 0
#
PATH=/usr/xpg4/bin:/bin:/usr/bin:/usr/ucb:${PATH}
SHELL=/bin/sh
case "`uname`" in
	Darwin*)
	case "`id -un`" in
		root)
		;;
		*)
		echo Sorry, you must have administrative priviledges to remove this software.
		exit 1
		;;
	esac
	;;
	*)
	case "`id`" in
		uid=0*)
		;;
		*)
		echo Sorry, you must be root to remove this software.
		exit 1
		;;
	esac
	;;
esac
echo Copyright 2008-04-9\ Xerox
# Reset umask for remove...
umask 002
# Determine correct echo options...
if (echo "testing\c"; echo 1,2,3) | grep c >/dev/null; then
	ac_n=-n
	ac_c=
else
	ac_n=
	ac_c='\c'
fi
# Determine correct extract options for the tar command...
if test `uname` = Darwin; then
	ac_tar="tar -xpPf"
else if test "`tar --help 2>&1 | grep GNU`" = ""; then
	ac_tar="tar -xpf"
else
	ac_tar="tar -xpPf"
fi fi
if test ! "$*" = "now"; then
	echo ""
	echo This removal script will remove the Printer\ Mac
	echo software version 1.0 from your system.
	echo ""
	while true ; do
		echo $ac_n "Do you wish to continue? $ac_c"
		read yesno
		case "$yesno" in
			y | yes | Y | Yes | YES)
			break
			;;
			n | no | N | No | NO)
			exit 1
			;;
			*)
			echo Please enter yes or no.
			;;
		esac
	done
fi
echo Removing/restoring installed files...
for file in /Library/Printers/PPDs/Contents/Resources/en.lproj/XeroxPhaser3100 /Library/Printers/Xerox/PDEs/ShiftfromBinding.plugin/Contents/Info.plist \
/Library/Printers/Xerox/PDEs/ShiftfromBinding.plugin/Contents/MacOS/ShiftfromBinding \
/Library/Printers/Xerox/PDEs/ShiftfromBinding.plugin/Contents/Resources/English.lproj/Localizable.strings \
/Library/Printers/Xerox/PDEs/ShiftfromBinding.plugin/Contents/Resources/English.lproj/ShiftfromBinding.nib/classes.nib \
/Library/Printers/Xerox/PDEs/ShiftfromBinding.plugin/Contents/Resources/English.lproj/ShiftfromBinding.nib/info.nib \
/Library/Printers/Xerox/PDEs/ShiftfromBinding.plugin/Contents/Resources/English.lproj/ShiftfromBinding.nib/objects.xib \
/Library/Printers/Xerox/PDEs/Watermark.plugin/Contents/Info.plist /Library/Printers/Xerox/PDEs/Watermark.plugin/Contents/MacOS/Watermark \
/Library/Printers/Xerox/PDEs/Watermark.plugin/Contents/Resources/English.lproj/Localizable.strings \
/Library/Printers/Xerox/PDEs/Watermark.plugin/Contents/Resources/English.lproj/Watermark.nib/classes.nib \
/Library/Printers/Xerox/PDEs/Watermark.plugin/Contents/Resources/English.lproj/Watermark.nib/info.nib \
/Library/Printers/Xerox/PDEs/Watermark.plugin/Contents/Resources/English.lproj/Watermark.nib/objects.xib \
/Library/Printers/Xerox/PDEs/Watermark.plugin/Contents/Resources/Info_Watermark.plist \
/Library/Printers/Xerox/Utility/BmpInfo.plist /Library/Printers/Xerox/Utility/CreateFile \
/Library/Printers/Xerox/Utility/Info.plist /Library/Printers/Xerox/Utility/InstructionPage/A4Long \
/Library/Printers/Xerox/Utility/InstructionPage/A4Short /Library/Printers/Xerox/Utility/InstructionPage/A5Long \
/Library/Printers/Xerox/Utility/InstructionPage/A5Short /Library/Printers/Xerox/Utility/InstructionPage/A5_LEFLong \
/Library/Printers/Xerox/Utility/InstructionPage/A5_LEFShort /Library/Printers/Xerox/Utility/InstructionPage/B5_ISOLong \
/Library/Printers/Xerox/Utility/InstructionPage/B5_ISOShort /Library/Printers/Xerox/Utility/InstructionPage/ExecutiveLong \
/Library/Printers/Xerox/Utility/InstructionPage/ExecutiveShort /Library/Printers/Xerox/Utility/InstructionPage/Folio_legal_13Long \
/Library/Printers/Xerox/Utility/InstructionPage/Folio_legal_13Short /Library/Printers/Xerox/Utility/InstructionPage/JIS_B5Long \
/Library/Printers/Xerox/Utility/InstructionPage/JIS_B5Short /Library/Printers/Xerox/Utility/InstructionPage/LegalLong \
/Library/Printers/Xerox/Utility/InstructionPage/LegalShort /Library/Printers/Xerox/Utility/InstructionPage/LetterLong \
/Library/Printers/Xerox/Utility/InstructionPage/LetterShort /Library/Printers/Xerox/Utility/InstructionPage/OfficioLong \
/Library/Printers/Xerox/Utility/InstructionPage/OfficioShort /Library/Printers/Xerox/Utility/InstructionPage/Statement_half_LetterLong \
/Library/Printers/Xerox/Utility/InstructionPage/Statement_half_LetterShort /Library/Printers/Xerox/filter/rastertoprinter; do
	rm -f "$file"
	if test -d "$file.O" -o -f "$file.O" -o -h "$file.O"; then
		mv -f "$file.O" "$file"
	fi
done
echo Checking configuration files...
echo Removing empty installation directories...
if test -d /Library/Printers/Xerox/filter; then
	rmdir /Library/Printers/Xerox/filter >/dev/null 2>&1
fi
if test -d /Library/Printers/Xerox/Utility/InstructionPage; then
	rmdir /Library/Printers/Xerox/Utility/InstructionPage >/dev/null 2>&1
fi
if test -d /Library/Printers/Xerox/Utility; then
	rmdir /Library/Printers/Xerox/Utility >/dev/null 2>&1
fi
if test -d /Library/Printers/Xerox/PDEs/Watermark.plugin/Contents/Resources/English.lproj/Watermark.nib; then
	rmdir /Library/Printers/Xerox/PDEs/Watermark.plugin/Contents/Resources/English.lproj/Watermark.nib >/dev/null 2>&1
fi
if test -d /Library/Printers/Xerox/PDEs/Watermark.plugin/Contents/Resources/English.lproj; then
	rmdir /Library/Printers/Xerox/PDEs/Watermark.plugin/Contents/Resources/English.lproj >/dev/null 2>&1
fi
if test -d /Library/Printers/Xerox/PDEs/Watermark.plugin/Contents/Resources; then
	rmdir /Library/Printers/Xerox/PDEs/Watermark.plugin/Contents/Resources >/dev/null 2>&1
fi
if test -d /Library/Printers/Xerox/PDEs/Watermark.plugin/Contents/MacOS; then
	rmdir /Library/Printers/Xerox/PDEs/Watermark.plugin/Contents/MacOS >/dev/null 2>&1
fi
if test -d /Library/Printers/Xerox/PDEs/Watermark.plugin/Contents; then
	rmdir /Library/Printers/Xerox/PDEs/Watermark.plugin/Contents >/dev/null 2>&1
fi
if test -d /Library/Printers/Xerox/PDEs/Watermark.plugin; then
	rmdir /Library/Printers/Xerox/PDEs/Watermark.plugin >/dev/null 2>&1
fi
if test -d /Library/Printers/Xerox/PDEs/ShiftfromBinding.plugin/Contents/Resources/English.lproj/ShiftfromBinding.nib; then
	rmdir /Library/Printers/Xerox/PDEs/ShiftfromBinding.plugin/Contents/Resources/English.lproj/ShiftfromBinding.nib >/dev/null 2>&1
fi
if test -d /Library/Printers/Xerox/PDEs/ShiftfromBinding.plugin/Contents/Resources/English.lproj; then
	rmdir /Library/Printers/Xerox/PDEs/ShiftfromBinding.plugin/Contents/Resources/English.lproj >/dev/null 2>&1
fi
if test -d /Library/Printers/Xerox/PDEs/ShiftfromBinding.plugin/Contents/Resources; then
	rmdir /Library/Printers/Xerox/PDEs/ShiftfromBinding.plugin/Contents/Resources >/dev/null 2>&1
fi
if test -d /Library/Printers/Xerox/PDEs/ShiftfromBinding.plugin/Contents/MacOS; then
	rmdir /Library/Printers/Xerox/PDEs/ShiftfromBinding.plugin/Contents/MacOS >/dev/null 2>&1
fi
if test -d /Library/Printers/Xerox/PDEs/ShiftfromBinding.plugin/Contents; then
	rmdir /Library/Printers/Xerox/PDEs/ShiftfromBinding.plugin/Contents >/dev/null 2>&1
fi
if test -d /Library/Printers/Xerox/PDEs/ShiftfromBinding.plugin; then
	rmdir /Library/Printers/Xerox/PDEs/ShiftfromBinding.plugin >/dev/null 2>&1
fi
if test -d /Library/Printers/Xerox/PDEs; then
	rmdir /Library/Printers/Xerox/PDEs >/dev/null 2>&1
fi
if test -d /Library/Printers/Xerox; then
	rmdir /Library/Printers/Xerox >/dev/null 2>&1
fi
rm -f /etc/software/xerox.remove
echo Removal is complete.
