#!/bin/sh

PATH=/bin:/usr/bin:/sw/bin:/usr/local/bin:/usr/local/teTeX/bin/powerpc-apple-darwin-current
LOCALDIR=/usr/local/teTeX/share/texmf.local
if [ -d $LOCALDIR ]
  then
    [ -d $LOCALDIR/tex ] || mkdir $LOCALDIR/tex
    [ -d $LOCALDIR/tex/latex ] || mkdir $LOCALDIR/tex/latex 
    [ -d $LOCALDIR/tex/latex/preview ] || mkdir $LOCALDIR/tex/latex/preview
    [ -f $LOCALDIR/tex/latex/preview/preview.sty ] || cp /Applications/Preview-Lyx/* $LOCALDIR/tex/latex/preview
    texhash
fi
rm -r /Applications/Preview-LyX
