#Maintainer: Cedric Durmont pkgname=nethack pkgver=3.4.3 pkgvnodot=343 pkgrel=1 zenver=54 arch=i486 sourcetemplate=http://durmont.free.fr/nethack/ source=(ftp://heanet.dl.sourceforge.net/pub/sourceforge/n/ne/nethack/$pkgname-$pkgvnodot-src.tgz nethack.desktop nethack.png) #extradepends=() #lessdepends=() docs=('AUTHORS' 'ChangeLog' 'COPYING' 'NEWS' 'README' 'TODO') url="http://nethack.org" slackdesc=\ ( #|-----handy-ruler------------------------------------------------------| "$pkgname - single player dungeon exploration game" "NetHack is an old but extremely rich (and hard) dungeon-hacking game." "Players can start with a variety of roles ranging from Barbarian to" "Tourist, races and alignment. " "Your goal in the game is basically to go down to the end of the" "dungeon, get the fabulous Amulet of Yendor and get out to offer it to" "your God. You already know it won't be that easy..." " see also: http://nethack.org/" ) build() { cd $startdir mkdir -p pkg/usr/share/applications/ mkdir -p pkg/usr/share/icons/hicolor/48x48/apps/ cp nethack.desktop pkg/usr/share/applications/ cp nethack.png pkg/usr/share/icons/hicolor/48x48/apps/ cd src/$pkgname-$pkgver/sys/unix chmod +x setup.sh chmod +x nethack.sh ./setup.sh cd ../.. # set configuration for config.h # set file compressor to gzip sed -i.orig -e 's#/usr/bin/compress#/usr/bin/gzip#;s#\.Z#.gz#;s#Lempel-Ziv#gzip#' include/config.h # define DLB option sed -i.orig -e 's|/\*\ #define\ DLB\ \*/|#define DLB|' include/config.h # define AUTOPICKUP_EXCEPTIONS option sed -i.orig -e 's|/\*#define\ AUTOPICKUP_EXCEPTIONS\ \*/|#define AUTOPICKUP_EXCEPTIONS|' include/config.h #set configuration for unixconf.h sed -i.orig -e 's|/\*\ #define\ LINUX\ \*/|#define LINUX|;s|/\*\ #define\ TIMED_DELAY\ \*/|#define TIMED_DELAY|' include/unixconf.h #set configuration for Makefile.src sed -i.orig -e 's|^CFLAGS\ =|#CFLAGS =|;s|^LFLAGS\ =|#LFLAGS =|' src/Makefile #remove default options sed -i.orig -e 's|#\ CC\ =\ gcc$|CC = gcc|;s|#\ LFLAGS\ =\ -L/usr/X11R6/lib|LFLAGS = -L/usr/X11R6/lib|;s|#\ CFLAGS\ =\ -O2\ -fomit-frame-pointer\ -I../include|CFLAGS = -O2 -march=i486 -mtune=i686 -fomit-frame-pointer -I../include|' src/Makefile # add more settings here for X11/gnome versions sed -i.orig -e 's|WINTTYLIB = -ltermlib|WINTTYLIB = -lncurses|' src/Makefile #set configuration for Makefile.utl sed -i.orig -e 's|^CFLAGS\ =|#CFLAGS =|;s|^LFLAGS\ =|#LFLAGS =|' util/Makefile sed -i.orig -e 's|#\ CC\ =\ gcc$|CC = gcc|;s|#\ LFLAGS\ =\ -L/usr/X11R6/lib|LFLAGS = -L/usr/X11R6/lib|;s|#\ CFLAGS\ =\ -O2\ -fomit-frame-pointer\ -I../include|CFLAGS = -O2 -march=i486 -mtune=i686 -fomit-frame-pointer -I../include|' util/Makefile sed -i.orig -e 's|^YACC\ \ \ \ \ =\ yacc|YACC = bison -y|;s|LEX\ \ \ \ \ \ =\ lex|LEX = flex|' util/Makefile #set configuration for Makefile.doc sed -i.orig -e "s|/usr/man/man6|${startdir}/pkg/usr/man/man6|" doc/Makefile # change location for default options file (quick-n-dirty) sed -i.orig -e 's|Sprintf(tmp_config,\ \"%s/%s\",\ envp,\ configfile|Sprintf(tmp_config, "/etc/nethack"|' src/files.c # create missing output folders mkdir -p ../../pkg/usr/man/man6 mkdir -p ../../pkg/etc # create the default options file cat <<"EOF" >"../../pkg/etc/nethack" # *** OPTIONS *** # # Visual options OPTIONS=eight_bit_tty,colour OPTIONS=hilite_pet # game preferences OPTIONS=autopickup,pickup_types:$"=/!?+ # interface options OPTIONS=time,number_pad:0,lit_corridor,silent # misc OPTIONS=suppress_alert:3.3.1,!toptenwin EOF # end of default options file #compile source cd src make cd .. #compile manpages cd doc make manpages cd .. #set configuration for Makefile.top sed -i.orig -e 's|GAMEUID\ \ =\ games|GAMEUID = root|;s|GAMEGRP\ \ =\ bin|GAMEGRP = games|;s|GAMEPERM\ =\ 04755|GAMEPERM = 02755|;s|FILEPERM\ =\ 0644|FILEPERM = 0664|;s|DIRPERM\ \ =\ 0755|DIRPERM = 0775|' Makefile sed -i.orig -e "s|PREFIX = /usr|PREFIX = ${startdir}/pkg/usr|" Makefile sed -i.orig -e 's|SHELLDIR\ =\ \$(PREFIX)/games|SHELLDIR = $(PREFIX)/bin|' Makefile sed -i.orig -e "s|sed -e 's;/usr/games/lib/nethackdir;\$(GAMEDIR);'|sed |" Makefile # add more settings here for X11/gnome versions #build the remaining part & install make all make install }