Commit 275905ce authored by Zolnierczuk, Piotr's avatar Zolnierczuk, Piotr
Browse files

Merge branch 'devel' into pztest

parents b460148f f7028e0b
Loading
Loading
Loading
Loading
+2 −1
Original line number Diff line number Diff line
@@ -6,7 +6,8 @@ INSTALL=install
# TODO: the last two scripts only work at SNS
SCRIPTS=\
	drspine_activate.sh  \
	drspine_create_env.sh
	drspine_create_env.sh\
	missing_latex.sh

ifeq ($(INSTRUMENT),1)
SCRIPTS+=build_drspine_sns.sh \
+81 −0
Original line number Diff line number Diff line
#!/bin/sh

TMPDIR=$HOME/Downloads
TEXMFDIR=$HOME/texmf

download=0
install=0

download_pkgs()
{
	mkdir -p $TMPDIR
	cd $TMPDIR
	wget https://mirrors.ctan.org/install/graphics/pgf/contrib/pgfplots.tds.zip 
	wget https://mirrors.ctan.org/macros/latex/contrib/appendix.zip 
	wget https://mirrors.ctan.org/macros/latex/contrib/draftwatermark.zip 
	wget https://mirrors.ctan.org/macros/latex/contrib/bigfoot.zip 
	wget https://mirrors.ctan.org/macros/latex/contrib/relsize.zip 
	wget https://mirrors.ctan.org/macros/latex/contrib/cprotect.zip 
}


install_pkgs()
{
	mkdir -p $TEXMFDIR
	cd $TEXMFDIR
	unzip $TMPDIR/pgfplots.tds.zip

	mkdir -p $TEXMFDIR/tex/latex/contrib
	cd	 $TEXMFDIR/tex/latex/contrib
	unzip $TMPDIR/appendix.zip
	unzip $TMPDIR/draftwatermark.zip
	unzip $TMPDIR/bigfoot.zip
	unzip $TMPDIR/relsize.zip
	unzip $TMPDIR/cprotect.zip

	for f in draftwatermark bigfoot appendix; do
		cd $TEXMFDIR/tex/latex/contrib/$f
		latex $f.ins
		cd -
	done

	for f in cprotect; do
		cd $TEXMFDIR/tex/latex/contrib/$f
		latex $f.dtx
		cd -
	done
}



usage()
{
    if test ! -z "$1"; then echo "$argv0: $1"; fi
    echo "usage: $argv0  [options]" 
    echo "options: "
    echo "         -d    : download"
    echo "         -i    : install"
    echo "         -h    : this help"
}

while getopts "dih" o; do
    case "${o}" in
		d)
        download=1
		;;
		i)
		install=1
		;;
		h)
		usage
		exit 0
		;;
		*)
		usage
		exit 1
    esac
done

if [ $download -ne 0 ]; then download_pkgs ; fi
if [ $install  -ne 0 ]; then install_pkgs  ; fi