#!/bin/sh -e

# movedoc - function to make the transition /usr/doc -> /usr/share/doc
movedoc()
{
    PKG=cpio
    OLD=/usr/doc/$PKG
    NEW=/usr/share/doc/$PKG
    if test -d $OLD -a ! -h $OLD -a ! $OLD -ef $NEW; then
	rm -f $OLD/.dhelp
	if test -e $OLD && ! rmdir $OLD 2>/dev/null; then
	    VERSION_CONTROL=t \
	    cp -ab $OLD $NEW/..
	    rm -rf $OLD
	fi
    fi
    if test -d /usr/doc -a ! -e $OLD -a -d $NEW; then
	ln -s $NEW $OLD
    fi
}

if [ "$1" = configure ]; then
    install-info --quiet \
      --description="A program to manage archives of files." \
      --section "General Commands" "General Commands" /usr/info/cpio.info
    test -f /sbin/rmt || ln -s ../usr/sbin/rmt /sbin/rmt
    movedoc
fi
