mirror of the now-defunct rocklinux.org
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

202 lines
7.3 KiB

  1. # --- ROCK-COPYRIGHT-NOTE-BEGIN ---
  2. #
  3. # This copyright note is auto-generated by ./scripts/Create-CopyPatch.
  4. # Please add additional copyright information _after_ the line containing
  5. # the ROCK-COPYRIGHT-NOTE-END tag. Otherwise it might get removed by
  6. # the ./scripts/Create-CopyPatch script. Do not edit this copyright text!
  7. #
  8. # ROCK Linux: rock-src/package/blindcoder/nethack/nethack.conf
  9. # ROCK Linux is Copyright (C) 1998 - 2006 Clifford Wolf
  10. #
  11. # This program is free software; you can redistribute it and/or modify
  12. # it under the terms of the GNU General Public License as published by
  13. # the Free Software Foundation; either version 2 of the License, or
  14. # (at your option) any later version. A copy of the GNU General Public
  15. # License can be found at Documentation/COPYING.
  16. #
  17. # Many people helped and are helping developing ROCK Linux. Please
  18. # have a look at http://www.rocklinux.org/ and the Documentation/TEAM
  19. # file for details.
  20. #
  21. # --- ROCK-COPYRIGHT-NOTE-END ---
  22. nethack_premake () {
  23. #export ROCKCFG_PKG_GAMES_BINDIR='usr/games'
  24. #export ROCKCFG_PKG_GAMES_DATADIR='usr/share'
  25. #export ROCKCFG_PKG_GAMES_SCOREDIR='var/games/scores'
  26. # ROCK configuration
  27. sed -e "s,^/\* #define VAR_PLAYGROUND \"/var/lib/games/nethack\" \*/,#define VAR_PLAYGROUND \"/${ROCKCFG_PKG_GAMES_SCOREDIR}/${xpkg}\",g" -i include/unixconf.h
  28. sed -e "s,^/\* #define LOCKDIR \"/usr/games/lib/nethackdir\" \*/,#define LOCKDIR \"/${ROCKCFG_PKG_GAMES_SCOREDIR}/${xpkg}\",g" -i include/unixconf.h
  29. sed -e "s,define HACKDIR \"[^\"]*\",define HACKDIR \"/${ROCKCFG_PKG_GAMES_DATADIR}/${xpkg}\",g" -i include/config.h
  30. sed -e "s,/\* #define SECURE \*/,#define SECURE,g" -i include/config.h
  31. var_append makeopt " " "SHELLDIR=\"/${ROCKCFG_PKG_GAMES_BINDIR}\""
  32. var_append makeopt " " "GAMEDIR=\"/${ROCKCFG_PKG_GAMES_DATADIR}/${xpkg}\""
  33. var_append makeopt " " "VARDIR=\"/${ROCKCFG_PKG_GAMES_SCOREDIR}/${xpkg}\""
  34. var_append makeinstopt " " "SHELLDIR=\"/${ROCKCFG_PKG_GAMES_BINDIR}\""
  35. var_append makeinstopt " " "GAMEDIR=\"/${ROCKCFG_PKG_GAMES_DATADIR}/${xpkg}\""
  36. var_append makeinstopt " " "VARDIR=\"/${ROCKCFG_PKG_GAMES_SCOREDIR}/${xpkg}\""
  37. var_append makeopt " " "GAMEUID=root"
  38. var_append makeopt " " "GAMEGRP=games"
  39. var_append makeinstopt " " "GAMEUID=root"
  40. var_append makeinstopt " " "GAMEGRP=games"
  41. # yes, we are linux
  42. sed -e 's,^/\* #define LINUX \*/.*,#define LINUX,g' -i include/unixconf.h
  43. # Timed Delay
  44. if [ "$ROCKCFG_PKG_NETHACK_DEL" == "1" ] ; then
  45. sed -e 's,^/\* #define TIMED_DELAY \*/.*,#define TIMED_DELAY,g' -i include/unixconf.h
  46. fi
  47. # Adding source files for UIs
  48. if [ "$ROCKCFG_PKG_NETHACK_TTY" == "0" ] ; then
  49. winsrc=""
  50. winobj=""
  51. winlib=""
  52. else
  53. winsrc='$(WINTTYSRC)'
  54. winobj='$(WINTTYOBJ)'
  55. winlib='$(WINTTYLIB)'
  56. fi
  57. if [ "$ROCKCFG_PKG_NETHACK_X11" == "1" ] ; then
  58. winsrc="$winsrc "'$(WINX11SRC)'
  59. winobj="$winobj "'$(WINX11OBJ)'
  60. winlib="$winlib "'$(WINX11LIB)'
  61. fi
  62. if [ "$ROCKCFG_PKG_NETHACK_QT" == "1" ] ; then
  63. winsrc="$winsrc "'$(WINQTSRC)'
  64. winobj="$winobj "'$(WINQTOBJ)'
  65. winlib="$winlib "'$(WINQTLIB)'
  66. fi
  67. if [ "$ROCKCFG_PKG_NETHACK_GNO" == "1" ] ; then
  68. winsrc="$winsrc "'$(WINGNOMESRC)'
  69. winobj="$winobj "'$(WINGNOMEOBJ)'
  70. winlib="$winlib "'$(WINGNOMELIB)'
  71. fi
  72. sed -e "s,^WINSRC = \$(WINTTYSRC),WINSRC = $winsrc,g" \
  73. -e "s,^WINOBJ = \$(WINTTYOBJ),WINOBJ = $winobj tile.o,g" \
  74. -i src/Makefile
  75. # more common things
  76. sed -e 's,^# WINTTYLIB = -lncurses,WINTTYLIB = -lncurses,g' \
  77. -e 's,^WINTTYLIB = -ltermlib,#WINTTYLIB = -ltermlib,g' \
  78. -i src/Makefile
  79. # Use libXpm?
  80. if [ "$ROCKCFG_PKG_NETHACK_XPM" == "1" ] ; then
  81. sed -e 's,^WINX11LIB = -lXaw -lXmu -lXext -lXt -lX11,WINX11LIB = -L/usr/X11R6/lib -lXaw -lXmu -lXext -lXt -lX11 -lXpm,g' \
  82. -i src/Makefile
  83. fi
  84. # Tiles for Qt
  85. if [ "$ROCKCFG_PKG_NETHACK_QT" == "1" ] ; then
  86. sed -e 's,^VARDATND =,VARDATND = x11tiles rip.xpm nhsplash.xpm pet_mark.xbm,g' \
  87. -i ./Makefile
  88. fi
  89. # more User Interfaces
  90. if [ "$ROCKCFG_PKG_NETHACK_TTY" == "0" ] ; then
  91. sed -e 's,^#define TTY_GRAPHICS,/* #define TTY_GRAPHICS */,g' \
  92. -i include/config.h
  93. fi
  94. if [ "$ROCKCFG_PKG_NETHACK_X11" == "1" ] ; then
  95. sed -e 's,^/\* #define X11_GRAPHICS \*/.*,#define X11_GRAPHICS,g' \
  96. -i include/config.h
  97. fi
  98. if [ "$ROCKCFG_PKG_NETHACK_QT" == "1" ] ; then
  99. sed -e 's,^/\* #define QT_GRAPHICS \*/.*,#define QT_GRAPHICS,g' \
  100. -i include/config.h
  101. fi
  102. if [ "$ROCKCFG_PKG_NETHACK_GNO" == "1" ] ; then
  103. sed -e 's,^/\* #define GNOME_GRAPHICS \*/.*,#define GNOME_GRAPHICS,g' \
  104. -i include/config.h
  105. fi
  106. # Wizard name, logfile, news
  107. sed -e "s,define WIZARD_NAME \"wizard\",define WIZARD_NAME \"$ROCKCFG_PKG_NETHACK_WIZ\",g" \
  108. -e "s,define LOGFILE \"logfile\",define LOGFILE \"$ROCKCFG_PKG_NETHACK_LOG\",g" \
  109. -e "s,define NEWS \"news\", define NEWS \"$ROCKCFG_PKG_NETHACK_NEW\",g" \
  110. -i include/config.h
  111. # Compression
  112. if [ "$ROCKCFG_PKG_NETHACK_USE_COM" == "1" ] ; then
  113. if [ "$ROCKCFG_PKG_NETHACK_COM" != "/usr/bin/compress" ] ; then
  114. sed -e "s,define COMPRESS \"/usr/bin/compress\",define COMPRESS \"$ROCKCFG_PKG_NETHACK_COM\",g" \
  115. -i include/config.h
  116. fi
  117. if [ "$ROCKCFG_PKG_NETHACK_EXT" != ".Z" ] ; then
  118. sed -e "s,define COMPRESS_EXTENSION \".Z\",define COMPRESS_EXTENSION \"$ROCKCFG_PKG_NETHACK_COM_EXT\",g" \
  119. -i include/config.h
  120. fi
  121. else
  122. sed -e 's,#define COMPRESS.*,// #define COMPRESS "/usr/bin/compress",g' \
  123. -e 's,#define COMPRESS_EXTENSION.*, // #define COMPRESS_EXTENSION ".Z",g' \
  124. -i include/config.h
  125. fi
  126. # Max number of players
  127. if [ $ROCKCFG_PKG_NETHACK_MAX -gt 0 ] ; then
  128. sed -e "s, \\* #define MAX_NR_OF_PLAYERS 6, * */\\n#define MAX_NR_OF_PLAYERS $ROCKCFG_PKG_NETHACK_MAX\\n/*,g" \
  129. -i include/config.h
  130. fi
  131. # dungeon features
  132. if [ "$ROCKCFG_PKG_NETHACK_SINKS" == "0" ] ; then
  133. sed -e 's,^#define SINKS,/* #define SINKS */,g' \
  134. -i include/config.h
  135. fi
  136. if [ "$ROCKCFG_PKG_NETHACK_MAZES" == "0" ] ; then
  137. sed -e 's,^#define WALLIFIED_MAZE,/* #define WALLIFIED_MAZE */,g' \
  138. -i include/config.h
  139. fi
  140. if [ "$ROCKCFG_PKG_NETHACK_REINCARNATION" == "0" ] ; then
  141. sed -e 's,^#define REINCARNATION,/* #define REINCARNATION */,g' \
  142. -i include/config.h
  143. fi
  144. if [ "$ROCKCFG_PKG_NETHACK_KOPS" == "0" ] ; then
  145. sed -e 's,^#define KOPS,/* #define KOPS */,g' \
  146. -i include/config.h
  147. fi
  148. if [ "$ROCKCFG_PKG_NETHACK_SEDUCE" == "0" ] ; then
  149. sed -e 's,^#define SEDUCE,/* #define SEDUCE */,g' \
  150. -i include/config.h
  151. fi
  152. if [ "$ROCKCFG_PKG_NETHACK_STEED" == "0" ] ; then
  153. sed -e 's,^#define STEED,/* #define STEED */,g' \
  154. -i include/config.h
  155. fi
  156. if [ "$ROCKCFG_PKG_NETHACK_TOURIST" == "0" ] ; then
  157. sed -e 's,^#define TOURIST,/* #define TOURIST */,g' \
  158. -i include/config.h
  159. fi
  160. if [ "$ROCKCFG_PKG_NETHACK_ELBERETH" == "0" ] ; then
  161. sed -e 's,^#define ELBERETH,/* #define ELBERETH */,g' \
  162. -i include/config.h
  163. fi
  164. if [ "$ROCKCFG_PKG_NETHACK_EXP" == "0" ] ; then
  165. sed -e 's,^#define EXP_ON_BOTL,/* #define EXP_ON_BOTL */,g' \
  166. -i include/config.h
  167. fi
  168. if [ "$ROCKCFG_PKG_NETHACK_SCORE" == "1" ] ; then
  169. sed -e 's,^#define SCORE_ON_BOTL,/* #define SCORE_ON_BOTL */,g' \
  170. -i include/config.h
  171. fi
  172. if [ "$ROCKCFG_PKG_NETHACK_GOLD" == "1" ] ; then
  173. sed -e 's,^#define GOLDOBJ,/* #define GOLDOBJ */,g' \
  174. -i include/config.h
  175. fi
  176. # DLB, makes a less messy installation
  177. sed -e 's,/\* #define DLB \*/,#define DLB,g' -i include/config.h
  178. }
  179. runconf='0'
  180. prepatch="cd sys/unix/ ; sh setup.sh ; cd ../.."
  181. premake="nethack_premake"