home *** CD-ROM | disk | FTP | other *** search
/ PC-Online 1996 May / PCOnline_05_1996.bin / linux / source / a / sh_utils / slackbui < prev   
Encoding:
Text File  |  1995-10-10  |  2.4 KB  |  94 lines

  1. #!/bin/sh
  2. # Set initial variables:
  3. CWD=`pwd`
  4. if [ "$TMP" = "" ]; then
  5.   TMP=/tmp
  6. fi
  7. PKG=$TMP/package-sh_utils
  8. SRC=/devel/manpagesrc
  9. INFO=$PKG/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/_sh_utils.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 "| sh-utils-1.12 |"
  37. echo "+===============+"
  38. cd $TMP
  39. tar xzvf $CWD/sh-utils-1.12.tar.gz
  40. cd sh-utils-1.12
  41. configure --prefix=/usr
  42. make CFLAGS=-O2 LDFLAGS=-s
  43. cd src
  44. cat date > $PKG/bin/date
  45. cat echo > $PKG/bin/echo
  46. cat false > $PKG/bin/false
  47. # We use the hostname from util-linux...
  48. # cat hostname > $PKG/bin/hostname
  49. cat pwd > $PKG/bin/pwd
  50. cat stty > $PKG/bin/stty
  51. cat su > $PKG/bin/su
  52. cat true > $PKG/bin/true
  53. cat uname > $PKG/bin/uname
  54. cat basename > $PKG/usr/bin/basename
  55. cat dirname > $PKG/usr/bin/dirname
  56. cat env > $PKG/usr/bin/env
  57. cat expr > $PKG/usr/bin/expr
  58. cat groups > $PKG/usr/bin/groups
  59. cat id > $PKG/usr/bin/id
  60. cat logname > $PKG/usr/bin/logname
  61. cat nice > $PKG/usr/bin/nice
  62. cat nohup > $PKG/usr/bin/nohup
  63. cat pathchk > $PKG/usr/bin/pathchk
  64. cat printenv > $PKG/usr/bin/printenv
  65. cat printf > $PKG/usr/bin/printf
  66. cat sleep > $PKG/usr/bin/sleep
  67. cat tee > $PKG/usr/bin/tee
  68. cat test > $PKG/usr/bin/test
  69. cat tty > $PKG/usr/bin/tty
  70. cat users > $PKG/usr/bin/users
  71. cat who > $PKG/usr/bin/who
  72. cat whoami > $PKG/usr/bin/whoami
  73. cat yes > $PKG/usr/bin/yes
  74. cd ../man
  75. for page in basename.1 date.1 dirname.1 echo.1 env.1 expr.1 false.1 groups.1 \
  76. id.1 logname.1 nice.1 nohup.1 pathchk.1 printenv.1 printf.1 pwd.1 sleep.1 \
  77. stty.1 su.1 tee.1 test.1 true.1 tty.1 uname.1 users.1 who.1 whoami.1 yes.1 ; do
  78.   cat $page | gzip -9c > $PKG/usr/man/man1/$page.gz
  79. done
  80. cd ../doc
  81. mkdir -p $INFO
  82. cat sh-utils.info | gzip -9c > $INFO/sh-utils.info.gz
  83. cp sh-utils.texi $TEX/sh-utils.texi
  84.  
  85. # Build the package:
  86. cd $PKG
  87. tar czvf $TMP/sh_utils.tgz .
  88.  
  89. # Clean up the extra stuff:
  90. if [ "$1" = "--cleanup" ]; then
  91.   rm -rf $TMP/sh-utils-1.12
  92.   rm -rf $PKG
  93. fi
  94.