#!/bin/sh

# This script generates the debhelper files to facilitate the
# transition from doc dirs to symlinks

# all binary packages except bacula-common
# bacula-sd now also removes "dvd-handler" so is handled manually
PACKAGES="bacula-common-mysql bacula-common-pgsql bacula-common-sqlite3 bacula-console bacula-console-qt bacula-fd"


for pkg in $PACKAGES; do
    case $1 in
	create)
	    if [ -f debian/$pkg.maintscript ]; then
		echo "$0: error: debian/$pkg.maintscript already exists!"
		exit 1
	    fi
	    echo dir_to_symlink /usr/share/doc/$pkg bacula-common 7.0.5+dfsg-4~ > debian/$pkg.maintscript
	    ;;
	clean)
	    rm -f debian/$pkg.maintscript
	    ;;
	*)
	    echo '$0: error: argument "create" or "clean" is missing'
	    exit 1
	    ;;
    esac
done
