1 # Maintainer : Tasos Latsas <tlatsas2000 at gmail dot com>
2 # Contributor : schuay <jakob.gruber@gmail.com>
3 # Contributor : kevin <kevin@archlinux.org>
4 # Contributor : Christian Schmidt <mucknert@gmx.net>
5 # Contributor : Markus Meissner <markus@meissna.de>
8 _patch="nh343-curses-beta3"
10 pkgver="${_nhver}beta3"
12 pkgdesc='Nethack with alternate text interface GUI'
13 arch=('i686' 'x86_64')
14 url="http://nethack-curses.wikia.com/wiki/NetHack_Curses_Interface_Wiki"
16 depends=('ncurses' 'gzip')
19 install="nethack-curses.install"
20 source=("http://downloads.sourceforge.net/nethack/${_nhver}/nethack-${_nhver//.}-src.tgz"
21 "http://nethack.edeca.net/karl/${_patch}.patch.gz"
23 md5sums=('21479c95990eefe7650df582426457f9'
24 '1c75ef45524ebbd490f68a9db1559f2e'
25 'f2601261949b5606d5d09a61527a2d49')
28 cd ${srcdir}/nethack-${_nhver}/
30 patch -Np1 -i ${srcdir}/${_patch}.patch
34 sed -e '/define HACKDIR/ s|/usr/games/lib/nethackdir|/usr/share/nethack/|' \
35 -e '/^#define COMPRESS\s/ s|/usr/bin/compress|/bin/gzip|' \
36 -e '/^#define COMPRESS_EXTENSION/ s|".Z"|".gz"|' \
37 -e 's|^/\* \(#define DLB\) \*/|\1|' -i include/config.h
39 sed -e 's|^/\* \(#define LINUX\) \*/|\1|' \
40 -e 's|^/\* \(#define TIMED_DELAY\) \*/|\1|' -i include/unixconf.h
42 sed -e 's|^# \(WINTTYLIB = -lncurses\)|\1|' \
43 -e 's|^WINTTYLIB = -ltermlib|#&|' -i src/Makefile
45 # we are setting up for setgid games, so modify all necessary permissions
46 # to allow full access for groups
48 sed -e '/^GAMEDIR\s*=/ s|/games/.*$|/share/$(GAME)|' \
49 -e '/^GAMEUID\s*=/ s|games|root|' \
50 -e '/^GAMEGRP\s*=/ s|bin|games|' \
51 -e '/^GAMEPERM\s*=/ s|04755|02755|' \
52 -e '/^FILEPERM\s*=/ s|0644|0664|' \
53 -e '/^DIRPERM\s*=/ s|0755|0775|' \
54 -e '/^SHELLDIR\s*=/ s|/games|/bin|' -i Makefile
56 sed -e "/^MANDIR\s*=/s|/usr/man/man6|$pkgdir/usr/share/man/man6|" -i doc/Makefile
63 cd ${srcdir}/nethack-${_nhver}/
65 install -dm755 $pkgdir/usr/share/{man/man6,doc/nethack}
67 make PREFIX=$pkgdir/usr install manpages
69 sed -e "s|HACKDIR=${pkgdir}/usr/|HACKDIR=/usr/|" \
70 -e 's|HACK=$HACKDIR|HACK=/usr/lib/nethack|' \
71 -i ${pkgdir}/usr/bin/nethack
73 install -dm755 ${pkgdir}/usr/lib/nethack
74 mv ${pkgdir}/usr/share/nethack/{nethack,recover} ${pkgdir}/usr/lib/nethack/
75 install -Dm644 doc/Guidebook.txt ${pkgdir}/usr/share/doc/nethack/Guidebook.txt
76 install -Dm644 ${srcdir}/nethackrc.proto ${pkgdir}/usr/share/doc/nethack
77 install -Dm644 dat/license ${pkgdir}/usr/share/licenses/${pkgname}/LICENSE