home *** CD-ROM | disk | FTP | other *** search
/ Il CD di internet / CD.iso / SOURCE / Y / BSDGAMES / SLACKBUI < prev   
Encoding:
Text File  |  1995-04-20  |  5.4 KB  |  185 lines

  1. #!/bin/sh
  2. # Set initial variables:
  3. CWD=`pwd`
  4. if [ "$TMP" = "" ]; then
  5.   TMP=/tmp
  6. fi
  7. PKG=$TMP/package-bsdgames
  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/_bsdgames.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 "| bsd-games.src-1.3 |"
  37. echo "+===================+"
  38. cd $TMP
  39. tar xzvf $CWD/bsd-games.src-1.3.tar.gz
  40. cd games
  41. make
  42. cd cribbage ; make ; cd ..
  43. cd sail ; make ; cd ..
  44. cd arithmetic
  45. strip arithmetic
  46. cat arithmetic > $PKG/usr/games/arithmetic
  47. man2gz arithmetic.6 $PKG/usr/man/preformat/cat6/arithmetic.6.gz $SRC/usr/man/man6/arithmetic.6
  48. cd ../atc
  49. strip atc
  50. cat atc > $PKG/usr/games/atc
  51. man2gz atc.6 $PKG/usr/man/preformat/cat6/atc.6.gz $SRC/usr/man/man6/atc.6
  52. cd ../backgammon/backgammon
  53. strip backgammon
  54. cat backgammon > $PKG/usr/games/backgammon
  55. man2gz backgammon.6 $PKG/usr/man/preformat/cat6/backgammon.6.gz $SRC/usr/man/man6/backgammon.6
  56. cd ../teachgammon
  57. strip teachgammon
  58. cat teachgammon > $PKG/usr/games/teachgammon
  59. cd ../../battlestar
  60. strip battlestar
  61. cat battlestar > $PKG/usr/games/battlestar
  62. man2gz battlestar.6 $PKG/usr/man/preformat/cat6/battlestar.6.gz $SRC/usr/man/man6/battlestar.6
  63. cd ../bcd
  64. strip bcd
  65. cat bcd > $PKG/usr/games/bcd
  66. man2gz bcd.6 $PKG/usr/man/preformat/cat6/bcd.6.gz $SRC/usr/man/man6/bcd.6
  67. cd ../bog
  68. strip bog
  69. cat bog > $PKG/usr/games/bog
  70. man2gz bog.man $PKG/usr/man/preformat/cat6/bog.6.gz $SRC/usr/man/man6/bog.6
  71. cd ../caesar
  72. strip caesar
  73. cat caesar > $PKG/usr/games/caesar
  74. man2gz caesar.6 $PKG/usr/man/preformat/cat6/caesar.6.gz $SRC/usr/man/man6/caesar.6
  75. cd ../canfield/canfield
  76. strip canfield
  77. cat canfield > $PKG/usr/games/canfield
  78. man2gz canfield.6 $PKG/usr/man/preformat/cat6/canfield.6.gz $SRC/usr/man/man6/canfield.6
  79. cd ../cfscores
  80. strip cfscores
  81. cat cfscores > $PKG/usr/games/cfscores
  82. cd ../../cribbage
  83. strip cribbage
  84. cat cribbage > $PKG/usr/games/cribbage
  85. man2gz cribbage.6 $PKG/usr/man/preformat/cat6/cribbage.6.gz $SRC/usr/man/man6/cribbage.6
  86. cd ../factor
  87. strip factor
  88. cat factor > $PKG/usr/games/factor
  89. man2gz factor.6 $PKG/usr/man/preformat/cat6/factor.6.gz $SRC/usr/man/man6/factor.6
  90. cd ../fish
  91. strip fish
  92. cat fish > $PKG/usr/games/fish
  93. man2gz fish.6 $PKG/usr/man/preformat/cat6/fish.6.gz $SRC/usr/man/man6/fish.6
  94. cd ../fortune/fortune
  95. strip fortune
  96. cat fortune > $PKG/usr/games/fortune
  97. man2gz fortune.6 $PKG/usr/man/preformat/cat6/fortune.6.gz $SRC/usr/man/man6/fortune.6
  98. cd ../strfile
  99. strip strfile
  100. cat strfile > $PKG/usr/bin/strfile
  101. man2gz strfile.8 $PKG/usr/man/preformat/cat8/strfile.8.gz $SRC/usr/man/man8/strfile.8
  102. cd ../../hangman
  103. strip hangman
  104. cat hangman > $PKG/usr/games/hangman
  105. man2gz hangman.6 $PKG/usr/man/preformat/cat6/hangman.6.gz $SRC/usr/man/man6/hangman.6
  106. cd ../hunt
  107. strip hunt huntd
  108. cat hunt > $PKG/usr/games/hunt
  109. cat huntd > $PKG/usr/games/lib/huntd
  110. man2gz hunt.6 $PKG/usr/man/preformat/cat6/hunt.6.gz $SRC/usr/man/man6/hunt.6
  111. man2gz huntd.6 $PKG/usr/man/preformat/cat6/huntd.6.gz $SRC/usr/man/man6/huntd.6
  112. cd ../mille
  113. strip mille
  114. cat mille > $PKG/usr/games/mille
  115. man2gz mille.6 $PKG/usr/man/preformat/cat6/mille.6.gz $SRC/usr/man/man6/mille.6
  116. cd ../monop
  117. strip monop
  118. cat monop > $PKG/usr/games/monop
  119. man2gz monop.6 $PKG/usr/man/preformat/cat6/monop.6.gz $SRC/usr/man/man6/monop.6
  120. cd ../morse
  121. strip morse
  122. cat morse > $PKG/usr/games/morse
  123. cd ../number
  124. strip number
  125. cat number > $PKG/usr/games/number
  126. man2gz number.6 $PKG/usr/man/preformat/cat6/number.6.gz $SRC/usr/man/man6/number.6
  127. cd ../paranoia
  128. strip paranoia
  129. cat paranoia > $PKG/usr/games/paranoia
  130. cd ../pom
  131. strip pom
  132. cat pom > $PKG/usr/games/pom
  133. man2gz pom.6 $PKG/usr/man/preformat/cat6/pom.6.gz $SRC/usr/man/man6/pom.6
  134. cd ../ppt
  135. strip ppt
  136. cat ppt > $PKG/usr/games/ppt
  137. cd ../primes
  138. strip primes
  139. cat primes > $PKG/usr/games/primes
  140. cd ../rain
  141. strip rain
  142. cat rain > $PKG/usr/games/rain
  143. man2gz rain.6 $PKG/usr/man/preformat/cat6/rain.6.gz $SRC/usr/man/man6/rain.6
  144. cd ../robots
  145. strip robots
  146. cat robots > $PKG/usr/games/robots
  147. man2gz robots.6 $PKG/usr/man/preformat/cat6/robots.6.gz $SRC/usr/man/man6/robots.6
  148. cd ../sail
  149. strip sail
  150. cat sail > $PKG/usr/games/sail
  151. man2gz sail.6 $PKG/usr/man/preformat/cat6/sail.6.gz $SRC/usr/man/man6/sail.6
  152. cd ../snake/snake
  153. strip snake
  154. cat snake > $PKG/usr/games/snake
  155. man2gz snake.6 $PKG/usr/man/preformat/cat6/snake.6.gz $SRC/usr/man/man6/snake.6
  156. cd ../snscore
  157. strip snscore
  158. cat snscore > $PKG/usr/games/snscore
  159. cd ../../trek
  160. strip trek
  161. cat trek > $PKG/usr/games/trek
  162. man2gz trek.6 $PKG/usr/man/preformat/cat6/trek.6.gz $SRC/usr/man/man6/trek.6
  163. cd ../worm
  164. strip worm
  165. cat worm > $PKG/usr/games/worm
  166. man2gz worm.6 $PKG/usr/man/preformat/cat6/worm.6.gz $SRC/usr/man/man6/worm.6
  167. cd ../worms
  168. strip worms
  169. cat worms > $PKG/usr/games/worms
  170. man2gz worms.6 $PKG/usr/man/preformat/cat6/worms.6.gz $SRC/usr/man/man6/worms.6
  171. cd ../wump
  172. strip wump
  173. cat wump > $PKG/usr/games/wump
  174. man2gz wump.6 $PKG/usr/man/preformat/cat6/wump.6.gz $SRC/usr/man/man6/wump.6
  175.  
  176. # Build the package:
  177. cd $PKG
  178. tar czvf $TMP/bsdgames.tgz .
  179.  
  180. # Clean up the extra stuff:
  181. if [ "$1" = "--cleanup" ]; then
  182.   rm -rf $TMP/games
  183.   rm -rf $PKG
  184. fi
  185.