#!/bin/sh

set -e

#INCLUDE_SHELL_LIB#

case "$1" in
	remove|abort-install|abort-upgrade)
		dpkg-maintscript-helper rm_conffile "/etc/bash_completion.d/ooffice.sh" 1:3.3.0~rc4-2 libreoffice-common -- "$@"

		dpkg-maintscript-helper mv_conffile \
			"/etc/openoffice/psprint.conf" "/etc/libreoffice/psprint.conf" "" libreoffice-common -- "$@"
		dpkg-maintscript-helper mv_conffile \
			"/etc/openoffice/sofficerc" "/etc/libreoffice/sofficerc" "" libreoffice-common -- "$@"
		dpkg-maintscript-helper mv_conffile \
			"/etc/openoffice/soffice.sh" "/etc/libreoffice/soffice.sh" "" libreoffice-common -- "$@"
		rm -rf /`echo @OODIR@ | sed -e s,usr/,var/,g`/share/prereg/bundled
		rmdir /`echo @OODIR@ | sed -e s,usr/,var/,g`/share/prereg/ || true
		rmdir /`echo @OODIR@ | sed -e s,usr/,var/,g`/share/ || true
		# this belongs to -core, but won't work until we have -common stuff removed, too, so try here again
		# in adduition to -core
		rmdir /`echo @OODIR@ | sed -e s,usr/,var/,g`/program/ || true
		rmdir /`echo @OODIR@ | sed -e s,usr/,var/,g` || true
		# and try to remove /@OOBRANDDIR@ itself
		rmdir /`echo @OODIR@ | sed -e s,usr/,var/,g` || true
	;;
esac

#DEBHELPER#
