#!/bin/bash
#%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
# Uninstall LaTeXML (and all it's Junk)
# Use when manually installed with "make install"
# When installed using rpm or other such tools,
# use the tool's method.
#%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%

BINDIR=/usr/local/bin
MAN1DIR=/usr/local/share/man/man1
MAN3DIR=/usr/local/share/man/man3
PMDIR=/usr/local/share/perl5
TEXMFDIR=/usr/share/texlive/texmf-local/tex/latex/latexml

# Remove binaries
rm $BINDIR/latexml
rm $BINDIR/latexmlfind
rm $BINDIR/latexmlpost
rm $BINDIR/latexmlmath
rm $BINDIR/latexmlc

# Remove modules
rm $PMDIR/LaTeXML.pm
rm -rf $PMDIR/LaTeXML

# Remove man pages
rm $MAN1DIR/latexml.1
rm $MAN1DIR/latexmlfind.1
rm $MAN1DIR/latexmlpost.1
rm $MAN1DIR/latexmlmath.1
rm $MAN1DIR/latexmlc.1

rm $MAN3DIR/LaTeXML.3pm
rm $MAN3DIR/LaTeXML::*.3pm

#???
#rm /usr/local/lib/perl5/site_perl/5.10.0/i386-linux-thread-multi/auto/LaTeXML/.packlist

# Clean up LaTeXML's LaTeX styles
rm -rf $TEXMFDIR
mktexlsr

