#!/bin/sh

set -e

#INCLUDE_SHELL_LIB#

if [ "$1" = "configure" ]; then
	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 -- "$@"

	# try to remove, hopefully empty now
	rmdir /etc/openoffice 2>/dev/null || true

	if dpkg --compare-versions "$2" lt "1:3.3.0-3"; then
		dpkg-trigger /@OODIR@/share/extensions || (echo "failed to trigger extension registration" && true)
	fi
fi

#DEBHELPER#

