#!/bin/sh # # Script for daily install of McStas CVS tarball. To be run using cron. # May require root priviliges depending on installation path. # # Requirements: wget, lynx, mktemp and the usual McStas build tools # # Notes: # # If environment variable CVS is set to 'no', the current stable # version will be installed # # Chosen plotter and installation path can be specified using PLOTTER and # PREFIX environment variables # # If you are behind a firewall, e.g. at ILL, set environment variable # http_proxy to e.g. http://proxy.ill.fr:8080 # # PW, Risoe, 20040225 # PW, Risoe, 20050622 (update) # User configuration # Where to install: if [ "$PREFIX" = "" ] then export PREFIX=/usr/local fi # What plotter to use: matlab/scilab/PGPLOT/config (config will autodetect) if [ "$PLOTTER" = "" ] then export PLOTTER=config fi echo # Install stable or CVS version: if [ "$CVS" = "no" ] then export URL="http://www.mcstas.org/download/stable.tar.gz" echo $0: Installing current STABLE version from the web else export URL="http://www.mcstas.org/cvs/McStas-Current-src.tar.gz" echo $0: Installing current CVS version from the web: echo lynx -dump http://mcstas.risoe.dk/cvs/time.html | grep "Current McStas CVS" fi echo echo Installing to $PREFIX with plotter $PLOTTER... echo echo Will install in 5 seconds - press ctrl+c to terminate sleep 5 # Create temporary folder for the build TMPDIR=`mktemp /tmp/XXXXXX` if test -r $TMPDIR then rm -f $TMPDIR fi mkdir $TMPDIR cd $TMPDIR # Get the archive wget $URL # Unpack gunzip -c `basename $URL` | tar xf - cd mcstas-* ./configure --prefix=$PREFIX make make $PLOTTER make install if [ "$TK" != "" ] then make tk fi # Clean up cd - rm -rf $TMPDIR