home *** CD-ROM | disk | FTP | other *** search
/ The UNIX CD Bookshelf / OREILLY_TUCB_UNIX_CD.iso / upt / examples / SOURCES / DIFF / BUILDL.X < prev    next >
Text File  |  1998-07-24  |  2KB  |  54 lines

  1. #!/bin/sh
  2. # uncomment the next line to see more of the build process
  3. #set -x
  4. # BUILD script provided by Ready-to-Run Software, Inc.
  5. # Copyright 1997 Ready-to-Run Software, Inc. All Rights Reserved.
  6. BUILDDIR=`pwd`
  7. BUILDPREFIX=${BUILDPREFIX-`pwd`}
  8. SOURCEDIR=${SOURCEDIR-/cdrom/SOURCES}
  9. if test ! -d $SOURCEDIR ; then 
  10.    cd `dirname $0`/..; SOURCEDIR=`pwd`
  11.    echo Assuming SOURCEDIR is $SOURCEDIR
  12.    cd $BUILDDIR
  13. fi
  14. INSTALLDIR=${INSTALLDIR-/usr/local}
  15. INSTALLSHAREDIR=${INSTALLSHAREDIR-/usr/local/share}
  16. if test "$1" != ""; then 
  17.    MACHINE=$1
  18.    shift
  19. fi
  20. if test "$MACHINE" = ""; then 
  21.    MACHINE=`$SOURCEDIR/../common/guess `
  22.    echo "Assuming machine is $MACHINE"
  23. fi
  24. machine=$MACHINE
  25. echo Ignore any errors about directories already existing
  26. mkdir diff
  27. mkdir -p $INSTALLDIR
  28. mkdir $INSTALLDIR/bin
  29. mkdir $INSTALLDIR/lib
  30. mkdir -p $INSTALLSHAREDIR
  31. mkdir $INSTALLSHAREDIR/man
  32. mkdir $INSTALLSHAREDIR/man/man1
  33. mkdir $INSTALLSHAREDIR/doc
  34. mkdir $INSTALLSHAREDIR/${SHAREPREFIX}bin
  35. mkdir $INSTALLSHAREDIR/${SHAREPREFIX}lib
  36.  
  37.  
  38. cd $BUILDPREFIX/diff
  39. DIFFREV=2.7
  40. cat $SOURCEDIR/diff/diffutil.gz | uncompress | tar xvf -
  41. cd diffutils-2.7
  42. (sed -e "s;<installsharedir>;$INSTALLSHAREDIR;" -e "s;<prefix>;$SHAREPREFIX;" -e "s;<installdir>;$INSTALLDIR;"  $SOURCEDIR/diff/rtr/diff. | patch -s  )
  43. test -f $SOURCEDIR/diff/$machine/diff &&( sed -e "s;<installsharedir>;$INSTALLSHAREDIR;" -e "s;<prefix>;$SHAREPREFIX;" -e "s;<installdir>;$INSTALLDIR;"  $SOURCEDIR/diff/$machine/diff | patch -b .rtr -s  )
  44. configure -prefix=$INSTALLDIR
  45.  
  46. make
  47. make dvi
  48. make install
  49.  
  50.  
  51. cd ..
  52. cd $BUILDDIR
  53. if test "$RM" != "" ; then rm -rf $BUILDDIR/diff ; fi
  54.