# arg 1: the new package version
post_install() {
        echo "=> You also need to install the (non-free) game data files into /usr/share/openttd/data/"
        echo "=> Transferring sample.cat and *.grf should be enough."
        echo "=> Scenarios have been installed to /usr/share/openttd/scenarios"
}  

# arg 1: the new package version
# arg 2: the old package version
post_upgrade() {
        if [ -e /opt/openttd ] ; then
                [ -e /opt/openttd/data/sample.cat ] && \
                  mv -v /opt/openttd/data/sample.cat /usr/share/openttd/data/
                [ ! -z "$(find /opt/openttd/data/ -name *grf)" ] && \
                  find /opt/openttd/data/ -name *grf -exec mv -v {} /usr/share/openttd/data/ \;
                echo "=>Scenarios have been installed to /usr/share/openttd/scenarios"
        fi
}

# arg 1: the old package version
post_remove() {
        echo "You may have data files still in /usr/share/openttd/data/"        
}

op=$1
shift

$op $* 
