#!/bin/sh
# $Id: install-tds,v 3.5 1997/05/28 22:40:26 krisrose Exp krisrose $
#
# sh(1) installation of Xy-pic into a TeX Directory Structure system.
# Copyright (c) 1997  Kristoffer H. Rose  <krisrose@brics.dk>
#
# This file is part of the Xy-pic macro package.
# Copyright (c) 1991-1997  Kristoffer H. Rose  <krisrose@brics.dk>
# See the README and INSTALL files for further information.
#
# The Xy-pic package is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by the
# Free Software Foundation; either version 2 of the License, or (at your
# option) any later version.
#
# The Xy-pic package is distributed in the hope that it will be useful, but
# WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
# or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
# for more details.
#
# You should have received a copy of the GNU General Public License along
# with this package; if not, write to the Free Software Foundation, Inc.,
# 675 Mass Ave, Cambridge, MA 02139, USA.

: ${TEXMF:=$1}

if [ ! -d "$TEXMF" -o "$0" != "./support/install-tds" ]
then
  echo 'Usage: ./support/install-tds [$TEXMF]' >&2
  exit
fi

installd () {
  local dir=`eval 'echo ${'$#'}'`	# extract last parameter
  mkdir -p "$dir"
  cp -f "$@"
}

installd README CATALOG TRAILER INSTALL MANIFEST VERSIONS COPYING \
	$TEXMF/doc/generic/xypic

installd texinputs/*.tex $TEXMF/tex/generic/xypic
installd texinputs/*.sty texinputs/*.cls $TEXMF/tex/generic/xypic
installd texinputs/*.ini $TEXMF/tex/generic/xypic
installd texfonts/*.tfm $TEXMF/fonts/tfm/public/xypic
installd mfinputs/*.mf $TEXMF/fonts/source/public/xypic
installd ps/* $TEXMF/dvips/xypic
installd psfonts/*.pfa $TEXMF/fonts/type1/public/xypic

[ -d doc ] && installd doc/* $TEXMF/doc/generic/xypic

exit
