Hi Everyone,
Since I download and compile the HEAD a lot, I wrote a script that
automates it for me. It might not work for everyone as is, but it should
be easy to modify the script to do what you want.
The script copied below does the following:
- creates a directory in /Applications/Radiance/ with yesterday's date.
- downloads the head and support files from radiance-online using wget
- creates a bin directory in ray/ for the binaries
- compiles the head using expect to answer prompts
- copies cal files to the library directory
- updates a symlink (current) to point to the new ray directory
I keep the following in my .bash_profile:
PATH=$PATH:/Applications/Radiance/current/bin
RAYPATH=/Applications/Radiance/current/lib
MANPATH=$MANPATH:/Applications/Radiance/current/doc/man
export PATH RAYPATH MANPATH
While this is a not the standard installation location for binaries and
libraries, I like it because I can keep previous HEAD releases and go back
to them if necessary and I can update the symlink to point to new binaries
without having to restart the shell.
I keep this script in a directory on my PATH so i just need to issue the
command "sudo installhead.bsh" and get a new working head!
Best,
Andy
######### installhead.bsh #############################
#!/bin/bash
dir=`date -v -1d "+/Applications/Radiance/%Y-%m-%d_HEAD"`
mkdir $dir
cd $dir
wget http://www.radiance-online.org/software/snapshots/radiance-HEAD.tgz
wget http://www.radiance-online.org/software/non-cvs/rad4R0supp.tar.gz
rm -r ray
tar -xf radiance-HEAD.tgz
tar -xf rad4R0supp.tar.gz
cd ray
mkdir bin
expect <<- FIN
set timeout -1
spawn ./makeall install
expect "What is your preferred editor*"
send "\n"
expect "Where do you want the executable*"
send "${dir}/ray/bin\n"
expect "The Radiance Software License*"
send " "
expect "*Do you understand and accept the terms of this agreement*"
send "y\n"
expect "*Please select your system*"
send "3\n"
expect "*Where do you want the library files*"
send "${dir}/ray/lib\n"
expect "*Do you want to change it?*"
send "n\n"
expect "*export PATH*"
send "\n"
FIN
cp src/cal/cal/* lib/.
cd ../../
rm current
ln -s ${dir}/ray/ current
######## end of installhead.bsh ###########################