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

  1. #!/bin/sh
  2. # Set initial variables:
  3. CWD=`pwd`
  4. if [ "$TMP" = "" ]; then
  5.   TMP=/tmp
  6. fi
  7. PKG=$TMP/package-lpr
  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/_lpr.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 "| lpr |"
  37. echo "+=====+"
  38. cd $TMP
  39. tar xzvf $CWD/lpr.tar.gz
  40. cd lpr
  41. make
  42. cd lpr/lpc
  43. cat lpc > $PKG/usr/sbin/lpc
  44. man2gz lpc.8 $PKG/usr/man/preformat/cat8/lpc.8.gz $SRC/usr/man/man8/lpc.8
  45. cd ../filters
  46. cat lpf > $PKG/usr/sbin/lpf
  47. cd ../lpd
  48. cat lpd > $PKG/usr/sbin/lpd
  49. man2gz lpd.8 $PKG/usr/man/preformat/cat8/lpd.8.gz $SRC/usr/man/man8/lpd.8
  50. cd ../lpq
  51. cat lpq > $PKG/usr/bin/lpq
  52. man2gz lpq.1 $PKG/usr/man/preformat/cat1/lpq.1.gz $SRC/usr/man/man1/lpq.1
  53. cd ../lpr
  54. cat lpr > $PKG/usr/bin/lpr
  55. man2gz lpr.1 $PKG/usr/man/preformat/cat1/lpr.1.gz $SRC/usr/man/man1/lpr.1
  56. cd ../lprm
  57. cat lprm > $PKG/usr/bin/lprm
  58. man2gz lprm.1 $PKG/usr/man/preformat/cat1/lprm.1.gz $SRC/usr/man/man1/lprm.1
  59. cd ../lptest
  60. cat lptest > $PKG/usr/sbin/lptest
  61. man2gz lptest.1 $PKG/usr/man/preformat/cat1/lptest.1.gz $SRC/usr/man/man1/lptest.1
  62. cd ../pac
  63. cat pac > $PKG/usr/sbin/pac
  64. man2gz pac.8 $PKG/usr/man/preformat/cat8/pac.8.gz $SRC/usr/man/man8/pac.8
  65. cd ..
  66. man2gz printcap.5 $PKG/usr/man/preformat/cat5/printcap.5.gz $SRC/usr/man/man5/printcap.5
  67.  
  68. # Build the package:
  69. cd $PKG
  70. tar czvf $TMP/lpr.tgz .
  71.  
  72. # Clean up the extra stuff:
  73. if [ "$1" = "--cleanup" ]; then
  74.   rm -rf $TMP/lpr
  75.   rm -rf $PKG
  76. fi
  77.