#!/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
doc_dir=$shr_dir/doc/$package
news=octave/packages/$pkg_name-$pkg_version/packinfo/NEWS
if [ -f $shr_dir/$news -a -d $doc_dir ] ; then
    dh_installdocs -p$package;
    ln -fs ../../$news $doc_dir
fi
