#!/bin/sh

CLISP_BIN=$(which clisp)
LISP_BIN=$(which cmucl)

if [ -n "$CLISP_BIN" ]; then
	$CLISP_BIN apt-dpkg-ref.lisp
elif [ -n "$LISP_BIN" ]; then
	$LISP_BIN -load apt-dpkg-ref.lisp
else
	echo "You need a lisp-compiler installed!"
	exit 1;
fi

LATEX_BIN=$(which latex)
PDFLATEX_BIN=$(which pdflatex)
DVIPS_BIN=$(which dvips)

if [ -n "$LATEX_BIN" -a -n "$PDFLATEX_BIN" -a -n "$DVIPS_BIN" ]; then
	latex apt-dpkg-ref.tex
	pdflatex apt-dpkg-ref.tex
	dvips apt-dpkg-ref.dvi -o
else
	echo "You need a LaTeX distribution installed!  Need latex, pdflatex, and dvips."
	exit 1;
fi

