From 60e13921e1e490e1d8d90b077e2b07460d85025e Mon Sep 17 00:00:00 2001 From: Jan Benda Date: Wed, 3 Mar 2021 17:08:09 +0100 Subject: [PATCH] finished installation script --- install.sh | 49 +++++++++++++++++++++++++++++++++++++++++++++---- 1 file changed, 45 insertions(+), 4 deletions(-) diff --git a/install.sh b/install.sh index f115a93..a8629e2 100755 --- a/install.sh +++ b/install.sh @@ -1,6 +1,47 @@ -echo "not yet implemented" -exit 1 +PACKAGENAME="beamerlines" + +# get TEXMF installation path: +TEXMFPATH="" +if test "x$(id -u)" != "x0"; then + ISROOT=false + TEXMFPATH="$(kpsewhich -var-value TEXMFHOME)" +else + ISROOT=true + TEXMFPATH="$(kpsewhich -var-value TEXMFDIST)" +fi + +if test x"$1" = "x--help"; then + echo + if ! $ISROOT; then + echo "Install the beamer lines themes into your \$TEXMFHOME directory" + echo "(\$TEXMFHOME=$TEXMFPATH)." + echo "" + echo "For a system wide installation run the script with super user privileges". + else + echo "Install the beamer lines themes into the \$TEXMFDIST directory" + echo "(\$TEXMFHOME=$TEXMFPATH)." + fi + echo + exit 0 +fi + +# add installation directory: +DESTDIR="$TEXMFPATH/tex/latex/$PACKAGENAME" + +# make installation directory: +mkdir -p "$DESTDIR" + +# copy style files: +echo "copy style files to $DESTDIR ..." +cp *.sty "$DESTDIR" + +# rebuild tex hash: +if $ISROOT; then + echo "rebuild tex filename databases ..." + texhash +fi + +echo "done!" + -kpsewhich -var-value TEXMFDIST -kpsewhich -var-value TEXMFHOME