#!/bin/sh

### Install extra documentation
if [ -d doc ] ; then
    dh_installdocs -p$package;
    rm -rf $debpkg/$mpath/*/doc
fi

### Install symlink for the NEWS file
pkg_name=$(grep '^Name:' DESCRIPTION | cut -f2 -d: | sed 's/ //')
pkg_version=$(grep '^Version:' DESCRIPTION | cut -f2 -d: | sed 's/ //')
shr_dir=debian/$package/usr/share
news=octave/packages/$pkg_name-$pkg_version/packinfo/NEWS
if [ -f $shr_dir/$news ] ; then
    dh_installdocs -p$package;
    ln -fs ../../$news $shr_dir/doc/$package/
fi
