#! /bin/sh
set -e
. /usr/share/debconf/confmodule

# run oem-config-prepare only on initial pacakge install
if [ "configure" = "$1" ] && [ -z "$2" ]; then 
    oem-config-prepare --quiet
fi

# [ -e "/etc/X11/xorg.conf.oem" ] && cp /etc/X11/xorg.conf.oem /etc/X11/xorg.conf
# setup xorg.conf on initial install only, not on upgrade as that
# would cause xorg.conf to get overwritten (see LP: 363951)
if [ "configure" = "$1" ] && [ -z "$2" ] && [ -f /usr/bin/xorgconfig.py ]; then
    python /usr/bin/xorgconfig.py -o /etc/X11/xorg.conf
fi

# remove obsolete file
if [ -f /etc/pm/sleep.d/20-suspend-cheese.sh ]; then
    rm /etc/pm/sleep.d/20-suspend-cheese.sh
fi

#DEBHELPER#
