#!/bin/sh
# postinst script for tvtime-vdr
#
# see: dh_installdeb(1)

set -e

case "$1" in
    configure)
        if [ ! -e /etc/default/tvtime-vdr ]
        then
          cat >/etc/default/tvtime-vdr <<EOF
# Location of vdr-dbus-send
VDR_DBUS_SEND="$(which vdr-dbus-send)"

# Location of svdrpsend
SVDRPSEND="$(which svdrpsend)"

# Location of tvtime
TVTIME="$(which tvtime)"

# Location of tvtime-vdr
TVTIMECMD="$(which tvtime-command)"

# Location of gnome-screensaver-command
SCRSAVERCMD="$(which gnome-screensaver-command)"

# Arguments for tvtime
TVTIME_ARGS="--frequencies=europe --norm=PAL --widescreen --slave"

# Location of keymap
MAP="/etc/tvtime/map.txt"

# Location of tvtime-vdr fifo
FIFO="/tmp/.TV-$(whoami)/tvtime-vdrfifo-$(hostname)"
EOF
        fi
        echo "For best performance you need the VDR dbus2vdr plugin."
        ;;

    abort-upgrade|abort-remove|abort-deconfigure)
        ;;

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