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