#!/bin/sh # # softlink_mvprog # # AUTHOR: # Dan Harkless # # COPYRIGHT: # This file is Copyright (C) 1998 by Dan Harkless, and is released under the # GNU General Public License . # # DESCRIPTION: # I like to install my software by using configure with --prefix set to the # top-level directory of the particular package I am installing. I then make # softlinks in /usr/local/bin, /usr/local/man/man1, etc. to the actual # locations of the files. # # This strategy doesn't work with some software, though, like GNU's gcc, # because it really needs to know what your main /usr/local directory is. In # this case, you can use this script as install.sh's $MVPROG to trick it into # thinking it's moving the files into /usr/local, whereas it's actually moving # them into a directory off of $SOFTLINK_MVPROG_DIR and then creating # softlinks in /usr/local. # # EXAMPLE: # % cd /usr/local/binutils-2.8.1 # % setenv SOFTLINK_MVPROG_DIR /usr/local/binutils-2.8.1/install # % setenv MVPROG softlink_mvprog # % make install # # DATE MODIFICATION # ========== ================================================================== # 1998-02-13 Original. if [ "$SOFTLINK_MVPROG_DIR" = "" ]; then echo 'softlink_install: $SOFTLINK_MVPROG_DIR must be set before running' exit 1 fi rel_2=`echo $2 | sed s%/usr/local/%%g` dir_2=$SOFTLINK_MVPROG_DIR/`dirname $rel_2` rel_2=$SOFTLINK_MVPROG_DIR/$rel_2 if [ ! -d $dir_2 ]; then echo mkdir -p $dir_2 mkdir -p $dir_2 fi echo mv $1 $rel_2 mv $1 $rel_2 echo ln -s $rel_2 $2 ln -s $rel_2 $2