#!/bin/rc #$Id: get_mk_install.rc,v 1.11 2013/04/23 10:20:21 tlaronde Exp $ # C) 2012-2013 Thierry Laronde # # All rights reserved and no warranty! Run it at your risks! # # Sources: what is in the tarball and must be present by default. # sources=(knuth etex bibtex ams adobe kertex_M kertex_T risk_comp) urldir="http://downloads.kergis.com/kertex/" fn read{ $1=`{awk '{print;exit}'} } # Stop if error # flag +e if (test $#* -ge 2) { echo 'usage: ' $0 '[conf_file]' exit 1 } if (test $#* -eq 1) { if (test -s $1) my_conf=$1 if not { echo 'Incorrect conf file: ' $1 exit 2 } } cat <LISEZ.MOI case * hget $urldir^README >README } echo 'Hget''ting (silently) the bundle...' hget $urldir^kertex_bundle.tar >kertex_bundle.tar test -s kertex_bundle.tar || { echo echo 'Getting the bundle failed...' exit 3 } echo 'Extracting the source chunks...' tar xf kertex_bundle.tar echo 'Extracting each source...' for (src in $sources) { tar xzf $src^_*.tar.gz rm $src^_*.tar.gz } } # Remote retrieving. echo echo 'By default, I will remove intermediary products to use the' echo 'minimal amount of space. Answer: NO to the following to keep' echo 'them (C files) instead.' echo -n 'Remove intermediary products (SAVE_SPACE) (YES|NO)? [YES] ' read ans test $#ans -eq 0 && ans=YES save_space=$ans echo echo 'Compiling kertex_M...' @{ cd kertex_M cd `{ape/psh ../risk_comp/sys/posix/sh1/rkconfig $my_conf} { echo make 'SAVE_SPACE='^$save_space all | ape/psh } \ || { echo 'Compilation of kertex_M failed!'; exit 4; } } echo echo 'Compiling kertex_T...' cd kertex_T cd `{ape/psh ../risk_comp/sys/posix/sh1/rkconfig $my_conf} { echo make 'SAVE_SPACE='^$save_space all | ape/psh }\ || { echo 'Compilation of kertex_T failed'; exit 5; } ans=() echo echo -n 'Do you want to install kerTeX here now? [Yn] ' read ans test $#ans -eq 0 && ans=YES switch ($ans) { case y Y yes YES case * echo make pkg | ape/psh echo echo 'I have built the package here: '`{pwd}^'/PKG.tar' exit 0 } # We are installing... # echo make local_install | ape/psh ans=() echo echo -n 'Do you want to generate the dumps and the fonts now? [Yn] ' read ans test $#ans -eq 0 && ans=YES switch ($ans) { case y Y yes YES . which_kertex $KERTEX_SHELL $KERTEX_LIBDIR/pkg/kertex.sh install case * echo echo 'You can generate them later running: pkg/kertex.sh' } exit 0