home *** CD-ROM | disk | FTP | other *** search
/ Il CD di internet / CD.iso / SOURCE / D / FLEX / SLACKBUI < prev   
Encoding:
Text File  |  1995-04-20  |  1.5 KB  |  64 lines

  1. #!/bin/sh
  2. # Set initial variables:
  3. CWD=`pwd`
  4. if [ "$TMP" = "" ]; then
  5.   TMP=/tmp
  6. fi
  7. PKG=$TMP/package-flex
  8. SRC=/devel/manpagesrc
  9. INFO=/devel/info-pages/usr/info
  10. TEX=/devel/texinfo-docs
  11.  
  12. if [ ! -d $TMP ]; then
  13.   mkdir -p $TMP # location to build the source
  14. fi
  15. if [ ! -d $PKG ]; then
  16.   mkdir -p $PKG # place for the package to be built
  17. fi
  18.  
  19. # Explode the package framework:
  20. cd $PKG
  21. tar xzvf $CWD/_flex.tar.gz
  22.  
  23. # Function to handle manpage source:
  24. man2gz () { # $1 is source page name, $2 is target name for preformatted
  25.             # output (full path && name) and $3 is the same, but for the
  26.             # source.
  27.   mkdir -p `dirname $2`
  28.   groff -Tascii -mandoc $1 | gzip -9c > $2
  29.   if [ ! "$3" = "" ]; then
  30.     mkdir -p `dirname $3`
  31.     cat $1 > $3 
  32.   fi 
  33. }
  34.  
  35. echo "+============+"
  36. echo "| flex-2.4.7 |"
  37. echo "+============+"
  38. cd $TMP
  39. tar xzvf $CWD/flex-2.4.7.tar.gz
  40. cd flex-2.4.7
  41. configure --prefix=/usr
  42. make CFLAGS=-O2 LDFLAGS=-s
  43. cat flex > $PKG/usr/bin/flex
  44. cat FlexLexer.h > $PKG/usr/include/FlexLexer.h
  45. cat libfl.a > $PKG/usr/lib/libfl.a
  46. man2gz flex.1 $PKG/usr/man/preformat/cat1/flex.1.gz $SRC/usr/man/man1/flex.1
  47. man2gz flexdoc.1 $PKG/usr/man/preformat/cat1/flexdoc.1.gz $SRC/usr/man/man1/flexdoc.1
  48. cd MISC
  49. makeinfo flex.texinfo
  50. cat flex.info | gzip -9c > $INFO/flex.info.gz
  51. cat flex.info-1 | gzip -9c > $INFO/flex.info-1.gz
  52. cat flex.info-2 | gzip -9c > $INFO/flex.info-2.gz
  53. cp flex.texinfo $TEX/flex.texi
  54.  
  55. # Build the package:
  56. cd $PKG
  57. tar czvf $TMP/flex.tgz .
  58.  
  59. # Clean up the extra stuff:
  60. if [ "$1" = "--cleanup" ]; then
  61.   rm -rf $TMP/flex-2.4.7
  62.   rm -rf $PKG
  63. fi
  64.