home *** CD-ROM | disk | FTP | other *** search
/ Il CD di internet / CD.iso / SOURCE / A / HDSETUP / SLACKBUI < prev   
Encoding:
Text File  |  1995-04-20  |  1.9 KB  |  68 lines

  1. #!/bin/sh
  2. # Set initial variables:
  3. CWD=`pwd`
  4. if [ "$TMP" = "" ]; then
  5.   TMP=/tmp
  6. fi
  7. PKG=$TMP/package-hdsetup
  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/_hdsetup.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 "| dialog-0.4-slackware |"
  37. echo "+======================+"
  38. cd $TMP
  39. tar xzvf $CWD/dialog-0.4-slackware.tar.gz
  40. cd dialog-0.4-slackware/src
  41. make
  42. cat dialog > $PKG/bin/dialog
  43. cd ../man
  44. man2gz dialog.man $PKG/usr/man/preformat/cat1/dialog.1.gz $SRC/usr/man/man1/dialog.1
  45.  
  46. mkdir $TMP/ipmask
  47. cd $TMP/ipmask
  48. cc -s -O2 -o ipmask $CWD/ipmask.c
  49. cat ipmask > $PKG/bin/ipmask
  50. cd $CWD
  51. man2gz explodepkg.8 $PKG/usr/man/preformat/cat8/explodepkg.8.gz $SRC/usr/man/man8/explodepkg.8
  52. man2gz installpkg.8 $PKG/usr/man/preformat/cat8/installpkg.8.gz $SRC/usr/man/man8/installpkg.8
  53. man2gz makepkg.8 $PKG/usr/man/preformat/cat8/makepkg.8.gz $SRC/usr/man/man8/makepkg.8
  54. man2gz pkgtool.8 $PKG/usr/man/preformat/cat8/pkgtool.8.gz $SRC/usr/man/man8/pkgtool.8
  55. man2gz removepkg.8 $PKG/usr/man/preformat/cat8/removepkg.8.gz $SRC/usr/man/man8/removepkg.8
  56. man2gz setup.8 $PKG/usr/man/preformat/cat8/setup.8.gz $SRC/usr/man/man8/setup.8
  57.  
  58. # Build the package:
  59. cd $PKG
  60. tar czvf $TMP/hdsetup.tgz .
  61.  
  62. # Clean up the extra stuff:
  63. if [ "$1" = "--cleanup" ]; then
  64.   rm -rf $TMP/dialog-0.4-slackware
  65.   rm -rf $TMP/ipmask
  66.   rm -rf $PKG
  67. fi
  68.