#!/bin/sh
# preinst script for #PACKAGE#
#
# see: dh_installdeb(1)

set -e

# summary of how this script can be called:
#        * <new-preinst> `install'
#        * <new-preinst> `install' <old-version>
#        * <new-preinst> `upgrade' <old-version>
#        * <old-preinst> `abort-upgrade' <new-version>
#
# for details, see http://www.debian.org/doc/debian-policy/ or
# the debian-policy package


case "$1" in
    upgrade)
        if dpkg --compare-versions "$2" lt 2.0.0-1 && test -e /var/lib/spip/dist; then
          if test -e /var/lib/spip/squelettes-dist; then
            echo "could not move old default files of /var/lib/spip/dist"
            echo "to /var/lib/spip/squelettes-dist: destination exists !"
            echo "You have to move them manually."
          else
            mv /var/lib/spip/dist /var/lib/spip/squelettes-dist
          fi
        fi
    ;;

    install|abort-upgrade)
    ;;

    *)
        echo "preinst called with unknown argument \`$1'" >&2
        exit 1
    ;;
esac

# dh_installdeb will replace this with shell code automatically
# generated by other debhelper scripts.

#DEBHELPER#

exit 0




