#!/bin/tcsh -f ### This script can be used to set up multiple installations of the ### CCP4 suite which all derive from the same source tree. It should be ### run after unpacking the distribution, but before running configure. ### Note that if you only wish to create a single installation, then ### you do _not_ need to run this script. ### ### This script was kindly donated by Ian Tickle, who gives the following ### detailed instructions: # Hi, while installing v3.3 here on multiple machines (SG, HP, Alpha, Linux) I # recalled discussions on this topic in WG2 meetings on several occasions, and # I finally decided to do something about it! I thought the script I wrote to # do the job might be of general interest. # Actually it's very simple, and I wish I'd done it before! All that's # required is to set up multiple directory trees with the same structure as the # original source tree, and with links to all the source files. Then do the # configure and make for each machine type in its own build tree exactly as # normal. # The tcsh script "duptree" below duplicates a source tree with links, and # works in 2 stages: first it takes as argument the name of the top directory # of the source tree (e.g. ~/xtal/ccp4 or just ccp4 if the current directory # is ~/xtal) and creates another script "duptree_ccp4" in the current # directory. This script is then run once for each machine type; it takes as # argument the name of the top directory of the tree to be created (e.g. # ~/xtal/ccp4.sg or again just ccp4.sg if the current directory is ~/xtal). # There are two ways of setting up the build tree, depending on the presence # or absence of the "-a" flag. If the -a flag is absent (i.e. the default), # all pathnames in the generated script are relative and the build tree is # set up in a directory parallel to the source tree. Hard links are used so # the build tree will look exactly like the source tree. # If the "-a" flag is present, the build tree can be created anywhere in the # directory structure, it doesn't have to be parallel with the source tree. In # this case soft links are used instead of hard ones. # The advantage of using relative pathnames, is that the generated script can # be given to someone else for use on another system, in order to circumvent # the restriction of having to run this script on an unadulterated source # tree. You obviously can't do this if you have used absolute pathnames. # For each script the "-f" flag deletes an existing output script or directory # tree (careful!) before creating a new one. # Note that the duptree script MUST be run on the unadulterated source tree, # i.e. in the condition immediately after unpacking the compressed sources. If # you run a make in the original source tree the files created will also be # shared between machines, and it will defeat the whole object! However once # you've created the duptree_ccp4 script, you can do what you like in the # original source tree. # # The same strategy can be used with other packages (I've done it with TNT). # However note that some packages (such as TNT) modify some of the source files # in place. This will cause problems, and you have to modify the makefile so # that for each such file a copy of a master file is made first. setenv PATH `echo $PATH|/bin/sed 's/\.://g'` if ("$1" == \-a) then set a shift endif if ("$1" == \-f) then set f shift endif if ("$1" == \-a) then set a shift endif if ($#argv != 1) then echo 'usage: ./duptree [-a] [-f]