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

  1. #!/bin/sh
  2. # Set initial variables:
  3. CWD=`pwd`
  4. if [ "$TMP" = "" ]; then
  5.   TMP=/tmp
  6. fi
  7. PKG=$TMP/package-sysvinit
  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/_sysvinit.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 "| SysVinit-2.4 |"
  37. echo "+==============+"
  38. cd $TMP
  39. tar xzvf $CWD/SysVinit-2.4.tar.gz
  40. cd sysvinit
  41. zcat $CWD/SysVinit-2.4.diff.gz | patch
  42. make
  43. cat halt > $PKG/sbin/halt
  44. cat init > $PKG/sbin/init
  45. cat shutdown > $PKG/sbin/shutdown
  46. cat powerd > $PKG/usr/sbin/powerd
  47. man2gz inittab.5 $PKG/usr/man/preformat/cat5/inittab.5.gz $SRC/usr/man/man5/inittab.5
  48. man2gz halt.8 $PKG/usr/man/preformat/cat8/halt.8.gz $SRC/usr/man/man8/halt.8
  49. man2gz init.8 $PKG/usr/man/preformat/cat8/init.8.gz $SRC/usr/man/man8/init.8
  50. man2gz shutdown.8 $PKG/usr/man/preformat/cat8/shutdown.8.gz $SRC/usr/man/man8/shutdown.8
  51.  
  52. # Build the package:
  53. cd $PKG
  54. tar czvf $TMP/sysvinit.tgz .
  55.  
  56. # Clean up the extra stuff:
  57. if [ "$1" = "--cleanup" ]; then
  58.   rm -rf $TMP/sysvinit
  59.   rm -rf $PKG
  60. fi
  61.