#!/bin/sh

umask 022

###################################################
# pull in environment variables common to
# postinstall/postremove/request/and.. scripts
###################################################

ADMINDIR=$TOPDIR/usr/bin/X11/700X/admin
. $ADMINDIR/env.vars

if [ "$OS" = "sco" ]
then
  SMANDIR=$TOPDIR/usr/share/man/man1
  DMANDIR=/usr/man/cat.LOCAL
  MANPAGES="hpxt.Video_Play.LOCAL"
else
  SMANDIR=$TOPDIR/usr/share/man
  DMANDIR=/usr/share/man
  MANPAGES="man1/hpxt.Video_Play.1"
fi

# echo $MANPAGES
if [ "$COPYMAN" = "yes" ]
then
  #echo ""
  #echo $NL1 "Copy local client man pages into $DMANDIR ? $NL2"
  #REPLY=`line`
  REPLY="yes"
else
  REPLY="no"
fi

case $REPLY in
  y*|Y*)
    # MAN PAGES
    #################################################
    COPYMAN="yes"

    for i in $MANPAGES
    do
      if [ ! -f $SMANDIR/$i ]
      then
	echo cannot find $SMANDIR/$i
	continue
      fi
      cp $SMANDIR/$i $DMANDIR/$i > /dev/null
      if [ $? -ne 0 ]
      then
        echo ""
        echo "Copy of man page failed."
        echo "$DMANDIR is probably nfs mounted or mounted read-only."
	echo "you can do this copy manually after installation" 
	echo ".. continuing"
        echo ""
        break
      fi
      chmod 444  $DMANDIR/${i}
      chown root $DMANDIR/${i}
      chgrp bin  $DMANDIR/${i}
    done
  ;;
esac


# 
# update modules.ld with clients from this package
# 
cat $NEWDIR/bin/modules.mpeg >> $NEWDIR/bin/modules.ld
rm -f $NEWDIR/bin/modules.mpeg

exit 0
