home *** CD-ROM | disk | FTP | other *** search
/ The UNIX CD Bookshelf / OREILLY_TUCB_UNIX_CD.iso / upt / examples / SOURCES / INDEX / BUILDU.D < prev    next >
Text File  |  1998-07-24  |  2KB  |  51 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. UPPER`
  22.    echo "Assuming machine is $MACHINE"
  23. fi
  24. machine=$MACHINE
  25. echo Ignore any errors about directories already existing
  26. mkdir index
  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. cd $BUILDPREFIX/index
  38. mkdir index
  39. cd $BUILDPREFIX/index/index
  40. cat  $SOURCEDIR/INDEX/PART01.GZ | uncompress  | unshar
  41. cat  $SOURCEDIR/INDEX/PART02.GZ | uncompress  | unshar
  42. (sed -e "s;<installsharedir>;$INSTALLSHAREDIR;" -e "s;<prefix>;$SHAREPREFIX;" -e "s;<installdir>;$INSTALLDIR;"  $SOURCEDIR/INDEX/RTR/INDEX. | patch -s -p )
  43. test -f  $SOURCEDIR/INDEX/$MACHINE/INDEX. &&( sed -e "s;<installsharedir>;$INSTALLSHAREDIR;" -e "s;<prefix>;$SHAREPREFIX;" -e "s;<installdir>;$INSTALLDIR;"  $SOURCEDIR/INDEX/$MACHINE/INDEX. | patch -s -p -b .rtr )
  44. make
  45. cp index $INSTALLDIR/bin
  46. cp -r samples $INSTALLSHAREDIR/index
  47.  
  48. cd ..
  49. cd $BUILDDIR
  50. if test "$RM" != "" ; then rm -rf $BUILDDIR/index ; fi
  51.