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

  1. #!/bin/sh
  2. # Set initial variables:
  3. CWD=`pwd`
  4. if [ "$TMP" = "" ]; then
  5.   TMP=/tmp
  6. fi
  7. PKG=$TMP/package-f2c
  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/_f2c.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 "| libf2c-0.11 |"
  37. echo "+=============+"
  38. cd $TMP
  39. tar xzvf $CWD/libf2c-0.11.tar.gz
  40. cd libf2c
  41. cat f2c.h > /usr/include/f2c.h
  42. make.clean
  43. make.shared
  44. make.clean
  45. make.static
  46. cat libf2c.a > $PKG/usr/lib/libf2c.a
  47. cat libf2c.sa > $PKG/usr/lib/libf2c.sa
  48. cat libf2c.so.0.11 > $PKG/usr/lib/libf2c.so.0.11
  49. echo "+=====+"
  50. echo "| f2c |"
  51. echo "+=====+"
  52. cd $TMP
  53. tar xzvf $CWD/f2c.tar.gz
  54. cd f2c
  55. zcat $CWD/f2c.diff.gz | patch
  56. man2gz f2c.1t $PKG/usr/man/preformat/cat1/f2c.1.gz $SRC/usr/man/man1/f2c.1
  57. cat f2c.h > $PKG/usr/include/f2c.h
  58. cd src
  59. make
  60. strip f2c
  61. cat f2c > $PKG/usr/bin/f2c
  62.  
  63. # Build the package:
  64. cd $PKG
  65. tar czvf $TMP/f2c.tgz .
  66.  
  67. # Clean up the extra stuff:
  68. if [ "$1" = "--cleanup" ]; then
  69.   rm -rf $TMP/libf2c
  70.   rm -rf $TMP/f2c
  71.   rm -rf $PKG
  72. fi
  73.