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

# --- ROCK-COPYRIGHT-NOTE-BEGIN ---
#
# This copyright note is auto-generated by ./scripts/Create-CopyPatch.
# Please add additional copyright information _after_ the line containing
# the ROCK-COPYRIGHT-NOTE-END tag. Otherwise it might get removed by
# the ./scripts/Create-CopyPatch script. Do not edit this copyright text!
#
# ROCK Linux: rock-src/package/blindcoder/nethack/nethack.conf
# ROCK Linux is Copyright (C) 1998 - 2006 Clifford Wolf
#
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation; either version 2 of the License, or
# (at your option) any later version. A copy of the GNU General Public
# License can be found at Documentation/COPYING.
#
# Many people helped and are helping developing ROCK Linux. Please
# have a look at http://www.rocklinux.org/ and the Documentation/TEAM
# file for details.
#
# --- ROCK-COPYRIGHT-NOTE-END ---
nethack_premake () {
#export ROCKCFG_PKG_GAMES_BINDIR='usr/games'
#export ROCKCFG_PKG_GAMES_DATADIR='usr/share'
#export ROCKCFG_PKG_GAMES_SCOREDIR='var/games/scores'
# ROCK configuration
sed -e "s,^/\* #define VAR_PLAYGROUND \"/var/lib/games/nethack\" \*/,#define VAR_PLAYGROUND \"/${ROCKCFG_PKG_GAMES_SCOREDIR}/${xpkg}\",g" -i include/unixconf.h
sed -e "s,^/\* #define LOCKDIR \"/usr/games/lib/nethackdir\" \*/,#define LOCKDIR \"/${ROCKCFG_PKG_GAMES_SCOREDIR}/${xpkg}\",g" -i include/unixconf.h
sed -e "s,define HACKDIR \"[^\"]*\",define HACKDIR \"/${ROCKCFG_PKG_GAMES_DATADIR}/${xpkg}\",g" -i include/config.h
sed -e "s,/\* #define SECURE \*/,#define SECURE,g" -i include/config.h
var_append makeopt " " "SHELLDIR=\"/${ROCKCFG_PKG_GAMES_BINDIR}\""
var_append makeopt " " "GAMEDIR=\"/${ROCKCFG_PKG_GAMES_DATADIR}/${xpkg}\""
var_append makeopt " " "VARDIR=\"/${ROCKCFG_PKG_GAMES_SCOREDIR}/${xpkg}\""
var_append makeinstopt " " "SHELLDIR=\"/${ROCKCFG_PKG_GAMES_BINDIR}\""
var_append makeinstopt " " "GAMEDIR=\"/${ROCKCFG_PKG_GAMES_DATADIR}/${xpkg}\""
var_append makeinstopt " " "VARDIR=\"/${ROCKCFG_PKG_GAMES_SCOREDIR}/${xpkg}\""
var_append makeopt " " "GAMEUID=root"
var_append makeopt " " "GAMEGRP=games"
var_append makeinstopt " " "GAMEUID=root"
var_append makeinstopt " " "GAMEGRP=games"
# yes, we are linux
sed -e 's,^/\* #define LINUX \*/.*,#define LINUX,g' -i include/unixconf.h
# Timed Delay
if [ "$ROCKCFG_PKG_NETHACK_DEL" == "1" ] ; then
sed -e 's,^/\* #define TIMED_DELAY \*/.*,#define TIMED_DELAY,g' -i include/unixconf.h
fi
# Adding source files for UIs
if [ "$ROCKCFG_PKG_NETHACK_TTY" == "0" ] ; then
winsrc=""
winobj=""
winlib=""
else
winsrc='$(WINTTYSRC)'
winobj='$(WINTTYOBJ)'
winlib='$(WINTTYLIB)'
fi
if [ "$ROCKCFG_PKG_NETHACK_X11" == "1" ] ; then
winsrc="$winsrc "'$(WINX11SRC)'
winobj="$winobj "'$(WINX11OBJ)'
winlib="$winlib "'$(WINX11LIB)'
fi
if [ "$ROCKCFG_PKG_NETHACK_QT" == "1" ] ; then
winsrc="$winsrc "'$(WINQTSRC)'
winobj="$winobj "'$(WINQTOBJ)'
winlib="$winlib "'$(WINQTLIB)'
fi
if [ "$ROCKCFG_PKG_NETHACK_GNO" == "1" ] ; then
winsrc="$winsrc "'$(WINGNOMESRC)'
winobj="$winobj "'$(WINGNOMEOBJ)'
winlib="$winlib "'$(WINGNOMELIB)'
fi
sed -e "s,^WINSRC = \$(WINTTYSRC),WINSRC = $winsrc,g" \
-e "s,^WINOBJ = \$(WINTTYOBJ),WINOBJ = $winobj tile.o,g" \
-i src/Makefile
# more common things
sed -e 's,^# WINTTYLIB = -lncurses,WINTTYLIB = -lncurses,g' \
-e 's,^WINTTYLIB = -ltermlib,#WINTTYLIB = -ltermlib,g' \
-i src/Makefile
# Use libXpm?
if [ "$ROCKCFG_PKG_NETHACK_XPM" == "1" ] ; then
sed -e 's,^WINX11LIB = -lXaw -lXmu -lXext -lXt -lX11,WINX11LIB = -L/usr/X11R6/lib -lXaw -lXmu -lXext -lXt -lX11 -lXpm,g' \
-i src/Makefile
fi
# Tiles for Qt
if [ "$ROCKCFG_PKG_NETHACK_QT" == "1" ] ; then
sed -e 's,^VARDATND =,VARDATND = x11tiles rip.xpm nhsplash.xpm pet_mark.xbm,g' \
-i ./Makefile
fi
# more User Interfaces
if [ "$ROCKCFG_PKG_NETHACK_TTY" == "0" ] ; then
sed -e 's,^#define TTY_GRAPHICS,/* #define TTY_GRAPHICS */,g' \
-i include/config.h
fi
if [ "$ROCKCFG_PKG_NETHACK_X11" == "1" ] ; then
sed -e 's,^/\* #define X11_GRAPHICS \*/.*,#define X11_GRAPHICS,g' \
-i include/config.h
fi
if [ "$ROCKCFG_PKG_NETHACK_QT" == "1" ] ; then
sed -e 's,^/\* #define QT_GRAPHICS \*/.*,#define QT_GRAPHICS,g' \
-i include/config.h
fi
if [ "$ROCKCFG_PKG_NETHACK_GNO" == "1" ] ; then
sed -e 's,^/\* #define GNOME_GRAPHICS \*/.*,#define GNOME_GRAPHICS,g' \
-i include/config.h
fi
# Wizard name, logfile, news
sed -e "s,define WIZARD_NAME \"wizard\",define WIZARD_NAME \"$ROCKCFG_PKG_NETHACK_WIZ\",g" \
-e "s,define LOGFILE \"logfile\",define LOGFILE \"$ROCKCFG_PKG_NETHACK_LOG\",g" \
-e "s,define NEWS \"news\", define NEWS \"$ROCKCFG_PKG_NETHACK_NEW\",g" \
-i include/config.h
# Compression
if [ "$ROCKCFG_PKG_NETHACK_USE_COM" == "1" ] ; then
if [ "$ROCKCFG_PKG_NETHACK_COM" != "/usr/bin/compress" ] ; then
sed -e "s,define COMPRESS \"/usr/bin/compress\",define COMPRESS \"$ROCKCFG_PKG_NETHACK_COM\",g" \
-i include/config.h
fi
if [ "$ROCKCFG_PKG_NETHACK_EXT" != ".Z" ] ; then
sed -e "s,define COMPRESS_EXTENSION \".Z\",define COMPRESS_EXTENSION \"$ROCKCFG_PKG_NETHACK_COM_EXT\",g" \
-i include/config.h
fi
else
sed -e 's,#define COMPRESS.*,// #define COMPRESS "/usr/bin/compress",g' \
-e 's,#define COMPRESS_EXTENSION.*, // #define COMPRESS_EXTENSION ".Z",g' \
-i include/config.h
fi
# Max number of players
if [ $ROCKCFG_PKG_NETHACK_MAX -gt 0 ] ; then
sed -e "s, \\* #define MAX_NR_OF_PLAYERS 6, * */\\n#define MAX_NR_OF_PLAYERS $ROCKCFG_PKG_NETHACK_MAX\\n/*,g" \
-i include/config.h
fi
# dungeon features
if [ "$ROCKCFG_PKG_NETHACK_SINKS" == "0" ] ; then
sed -e 's,^#define SINKS,/* #define SINKS */,g' \
-i include/config.h
fi
if [ "$ROCKCFG_PKG_NETHACK_MAZES" == "0" ] ; then
sed -e 's,^#define WALLIFIED_MAZE,/* #define WALLIFIED_MAZE */,g' \
-i include/config.h
fi
if [ "$ROCKCFG_PKG_NETHACK_REINCARNATION" == "0" ] ; then
sed -e 's,^#define REINCARNATION,/* #define REINCARNATION */,g' \
-i include/config.h
fi
if [ "$ROCKCFG_PKG_NETHACK_KOPS" == "0" ] ; then
sed -e 's,^#define KOPS,/* #define KOPS */,g' \
-i include/config.h
fi
if [ "$ROCKCFG_PKG_NETHACK_SEDUCE" == "0" ] ; then
sed -e 's,^#define SEDUCE,/* #define SEDUCE */,g' \
-i include/config.h
fi
if [ "$ROCKCFG_PKG_NETHACK_STEED" == "0" ] ; then
sed -e 's,^#define STEED,/* #define STEED */,g' \
-i include/config.h
fi
if [ "$ROCKCFG_PKG_NETHACK_TOURIST" == "0" ] ; then
sed -e 's,^#define TOURIST,/* #define TOURIST */,g' \
-i include/config.h
fi
if [ "$ROCKCFG_PKG_NETHACK_ELBERETH" == "0" ] ; then
sed -e 's,^#define ELBERETH,/* #define ELBERETH */,g' \
-i include/config.h
fi
if [ "$ROCKCFG_PKG_NETHACK_EXP" == "0" ] ; then
sed -e 's,^#define EXP_ON_BOTL,/* #define EXP_ON_BOTL */,g' \
-i include/config.h
fi
if [ "$ROCKCFG_PKG_NETHACK_SCORE" == "1" ] ; then
sed -e 's,^#define SCORE_ON_BOTL,/* #define SCORE_ON_BOTL */,g' \
-i include/config.h
fi
if [ "$ROCKCFG_PKG_NETHACK_GOLD" == "1" ] ; then
sed -e 's,^#define GOLDOBJ,/* #define GOLDOBJ */,g' \
-i include/config.h
fi
# DLB, makes a less messy installation
sed -e 's,/\* #define DLB \*/,#define DLB,g' -i include/config.h
}
runconf='0'
prepatch="cd sys/unix/ ; sh setup.sh ; cd ../.."
premake="nethack_premake"