home *** CD-ROM | disk | FTP | other *** search
/ Il CD di internet / CD.iso / SOURCE / A / TXTUTILS / SLACKBUI < prev    next >
Encoding:
Text File  |  1995-04-20  |  3.4 KB  |  99 lines

  1. #!/bin/sh
  2. # Set initial variables:
  3. CWD=`pwd`
  4. if [ "$TMP" = "" ]; then
  5.   TMP=/tmp
  6. fi
  7. PKG=$TMP/package-txtutils
  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/_txtutils.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 "| textutils-1.9 |"
  37. echo "+===============+"
  38. cd $TMP
  39. tar xzvf $CWD/textutils-1.9.tar.gz
  40. cd textutils-1.9
  41. ./configure --prefix=/usr
  42. make CFLAGS=-O2 LDFLAGS=-s
  43. cd src
  44. cat cat > $PKG/bin/cat
  45. cat cut > $PKG/bin/cut
  46. cat head > $PKG/bin/head
  47. cat cksum > $PKG/usr/bin/cksum
  48. cat comm > $PKG/usr/bin/comm
  49. cat csplit > $PKG/usr/bin/csplit
  50. cat expand > $PKG/usr/bin/expand
  51. cat fold > $PKG/usr/bin/fold
  52. cat join > $PKG/usr/bin/join
  53. cat nl > $PKG/usr/bin/nl
  54. cat od > $PKG/usr/bin/od
  55. cat paste > $PKG/usr/bin/paste
  56. cat pr > $PKG/usr/bin/pr
  57. cat sort > $PKG/usr/bin/sort
  58. cat split > $PKG/usr/bin/split
  59. cat sum > $PKG/usr/bin/sum
  60. cat tac > $PKG/usr/bin/tac
  61. cat tail > $PKG/usr/bin/tail
  62. cat tr > $PKG/usr/bin/tr
  63. cat unexpand > $PKG/usr/bin/unexpand
  64. cat uniq > $PKG/usr/bin/uniq
  65. cat wc > $PKG/usr/bin/wc
  66. cd ../man
  67. man2gz cat.1 $PKG/usr/man/preformat/cat1/cat.1.gz $SRC/usr/man/man1/cat.1
  68. man2gz cksum.1 $PKG/usr/man/preformat/cat1/cksum.1.gz $SRC/usr/man/man1/cksum.1
  69. man2gz comm.1 $PKG/usr/man/preformat/cat1/comm.1.gz $SRC/usr/man/man1/comm.1
  70. man2gz csplit.1 $PKG/usr/man/preformat/cat1/csplit.1.gz $SRC/usr/man/man1/csplit.1
  71. man2gz cut.1 $PKG/usr/man/preformat/cat1/cut.1.gz $SRC/usr/man/man1/cut.1
  72. man2gz expand.1 $PKG/usr/man/preformat/cat1/expand.1.gz $SRC/usr/man/man1/expand.1
  73. man2gz fold.1 $PKG/usr/man/preformat/cat1/fold.1.gz $SRC/usr/man/man1/fold.1
  74. man2gz head.1 $PKG/usr/man/preformat/cat1/head.1.gz $SRC/usr/man/man1/head.1
  75. man2gz join.1 $PKG/usr/man/preformat/cat1/join.1.gz $SRC/usr/man/man1/join.1
  76. man2gz nl.1 $PKG/usr/man/preformat/cat1/nl.1.gz $SRC/usr/man/man1/nl.1
  77. man2gz od.1 $PKG/usr/man/preformat/cat1/od.1.gz $SRC/usr/man/man1/od.1
  78. man2gz paste.1 $PKG/usr/man/preformat/cat1/paste.1.gz $SRC/usr/man/man1/paste.1
  79. man2gz pr.1 $PKG/usr/man/preformat/cat1/pr.1.gz $SRC/usr/man/man1/pr.1
  80. man2gz sort.1 $PKG/usr/man/preformat/cat1/sort.1.gz $SRC/usr/man/man1/sort.1
  81. man2gz split.1 $PKG/usr/man/preformat/cat1/split.1.gz $SRC/usr/man/man1/split.1
  82. man2gz sum.1 $PKG/usr/man/preformat/cat1/sum.1.gz $SRC/usr/man/man1/sum.1
  83. man2gz tac.1 $PKG/usr/man/preformat/cat1/tac.1.gz $SRC/usr/man/man1/tac.1
  84. man2gz tail.1 $PKG/usr/man/preformat/cat1/tail.1.gz $SRC/usr/man/man1/tail.1
  85. man2gz tr.1 $PKG/usr/man/preformat/cat1/tr.1.gz $SRC/usr/man/man1/tr.1
  86. man2gz unexpand.1 $PKG/usr/man/preformat/cat1/unexpand.1.gz $SRC/usr/man/man1/unexpand.1
  87. man2gz uniq.1 $PKG/usr/man/preformat/cat1/uniq.1.gz $SRC/usr/man/man1/uniq.1
  88. man2gz wc.1 $PKG/usr/man/preformat/cat1/wc.1.gz $SRC/usr/man/man1/wc.1
  89.  
  90. # Build the package:
  91. cd $PKG
  92. tar czvf $TMP/txtutils.tgz .
  93.  
  94. # Clean up the extra stuff:
  95. if [ "$1" = "--cleanup" ]; then
  96.   rm -rf $TMP/textutils-1.9
  97.   rm -rf $PKG
  98. fi
  99.