home *** CD-ROM | disk | FTP | other *** search
/ PC-Online 1996 May / PCOnline_05_1996.bin / linux / source / d / bison / slackbui < prev   
Encoding:
Text File  |  1995-10-10  |  1.4 KB  |  62 lines

  1. #!/bin/sh
  2. # Set initial variables:
  3. CWD=`pwd`
  4. if [ "$TMP" = "" ]; then
  5.   TMP=/tmp
  6. fi
  7. PKG=$TMP/package-bison
  8. SRC=/devel/manpagesrc
  9. INFO=$INFO/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. explodepkg $CWD/_bison.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 "| bison-1.22 |"
  37. echo "+============+"
  38. cd $TMP
  39. tar xzvf $CWD/bison-1.22.tar.gz
  40. cd bison-1.22
  41. configure --prefix=/usr
  42. make CFLAGS=-O2 LDFLAGS=-s
  43. cat bison > $PKG/usr/bin/bison
  44. mkdir -p $INFO
  45. cat bison.info | gzip -9c > $INFO/bison.info.gz
  46. cat bison.info-1 | gzip -9c > $INFO/bison.info-1.gz
  47. cat bison.info-2 | gzip -9c > $INFO/bison.info-2.gz
  48. cat bison.info-3 | gzip -9c > $INFO/bison.info-3.gz
  49. cat bison.info-4 | gzip -9c > $INFO/bison.info-4.gz
  50. cp bison.texinfo $TEX/bison.texi
  51. cat bison.1 | gzip -9c > $PKG/usr/man/man1/bison.1.gz
  52.  
  53. # Build the package:
  54. cd $PKG
  55. tar czvf $TMP/bison.tgz .
  56.  
  57. # Clean up the extra stuff:
  58. if [ "$1" = "--cleanup" ]; then
  59.   rm -rf $TMP/bison-1.22
  60.   rm -rf $PKG
  61. fi
  62.