#! /bin/tcsh -f # # This script contains all the commands needed to install root on a # Solaris or linux system with gcc compiler # # The following symbols are set below to control the options and # installation directories. # # root_dir root installation directory # root_build root build directory. # root_vsn root version from which the default target directory and # the root cvs tag are inferred # ttf_dir Directory containing the TrueType Fonts. If the font's are # not available they will be dowloaded to this directory. # cvs_dir is the directory into which the cvs repository is loaded. # By default cvs_dir is set to $root_dir/cvs. # target Is the directory into which rott will be installed. By default # target is set to $root_dir/$root_version # set verbose set root_build=$HOME/CERN set root_dir=/opt/dmt set root_vsn=root_4.04-02 set ttf_dir=$root_dir/ttf set xpm_dir= set cvs_dir= set target= # # if ( ! $?root_build || "$root_build" == "") set root_build=$root_dir if ( ! $?cvs_dir || "$cvs_dir" == "") set cvs_dir=$root_build/cvs if ( ! $?target || "$target" == "") set target=${root_dir}/${root_vsn} # # Set up the cvs repository pointer # set cvs_server=':pserver:cvs@root.cern.ch' set cvs_archive='/user/cvs' setenv CVSROOT ${cvs_server}:${cvs_archive} if ( ! `grep ${cvs_server}: $HOME/.cvspass | grep -c ${cvs_archive}` ) then unset verbose echo "You have not logged in to the Root cvs repository. to log in type:" echo " " echo " cvs -d $CVSROOT login" echo " " echo "and enter the appropriate password (cvs)" exit 1 endif # # Get the O/S info # switch(`uname -s`) case SunOS: set sysnm=Solaris # set arch=solarisegcs set arch=solarisgcc if ( "$xpm_dir" == "" && -f "/usr/X11R6/lib/libXpm.so" ) then set xpm_dir=$root_dir endif breaksw case Linux: set sysnm=Linux set arch=linux if ( "$xpm_dir" == "" && -f "/usr/X11R6/lib/libXpm.so" ) then set xpm_dir=/usr/X11R6 endif breaksw default: set sysnm=Unknown set arch=Unknown breaksw endsw # # Get ttf # echo "Checking TTF..." set ftpserver=ftp://root.cern.ch/root if (! -d "$ttf_dir" ) then set fontfile=ttf/ttf_fonts.tar.gz set libfile=ttf/ttflib.${sysnm}.tar.gz mkdir -p $root_build/ttftemp cd $root_build/ttftemp curl $ftpserver/$fontfile | gunzip -dc | tar -xf - curl $ftpserver/$libfile | gunzip -dc | tar -xf - mv $root_build/ttftemp $ttf_dir endif # # Get xpm if necessary (Solaris) # echo "Checking Xpm..." switch("$sysnm") case Solaris: set xpm_lib=$xpm_dir/lib if ( ! -d "$xpm_lib" || ! ( -f "${xpm_lib}/libXpm.a" || \ -f "${xpm_lib}/libXpm.so") ) then mkdir -p $xpm_lib set xpmfile=xpm/xpm.${sysnm}.tar.gz cd $xpm_lib curl $ftpserver/$xpmfile | gunzip -dc | tar -xf - endif breaksw case Linux: set xpm_lib=$xpm_dir/lib if ( ! -d "$xpm_lib" || ! ( -f "${xpm_lib}/libXpm.a" || \ -f "${xpm_lib}/libXpm.so") ) then echo "Xpm not found in: $xpm_dir" exit 2 endif breaksw default: breaksw endsw # # get the desired root version # mkdir -p $cvs_dir cd $cvs_dir set root_tag=`echo $root_vsn | sed -e "s/root_/v/g" -e "s/\./-/g"` if (! -f root/CVS/Tag || "`cat root/CVS/Tag`" != "N$root_tag" ) then echo "Downloading root version: $root_tag" if ( -d root ) cvs release -d root cvs -Q get -r $root_tag root else cvs -q update -d root endif # mkdir -p $target cd $cvs_dir/root setenv ROOTSYS `pwd` setenv PATH $ROOTSYS/bin:${PATH} if ( $?LD_LIBRARY_PATH ) then setenv LD_LIBRARY_PATH $ROOTSYS/lib:${LD_LIBRARY_PATH} else setenv LD_LIBRARY_PATH $ROOTSYS/lib endif # # Configure the root compilation. # # Note that by default the shared object versioning is enabled. This # caused problems in a solaris build of root-4.00-06 with gcc-3.3 # (lib/libCint.so was replaced by a link to lib/libCint00.so which # did not exist). # setenv TTF $ttf_dir if ( $?xpm_dir ) setenv XPM $xpm_dir if (! -f "include/config.h" ) then ./configure $arch --prefix=$target --libdir=$target/lib \ --incdir=$target/include --etcdir=$target/etc \ --datadir=$target/share # --enable-soversion endif # # Run make # make # # Install it # make install