Commit 964a8909 authored by chaves's avatar chaves
Browse files

'nethack' imported from Arch Linux.

parent a72c6d0a
#
# Games Packages for Chakra, part of chakra-project.org
#
# Maintainer: Adrián Chaves Fernández (Gallaecio) <adriyetichaves gmail.com>
# include global config
source ../_buildscripts/${current_repo}-${_arch}-cfg.conf
pkgname=nethack
pkgver=3.4.3
_pkgver=343
pkgrel=1
pkgdesc='A single player dungeon exploration game.'
arch=('i686' 'x86_64')
url="http://www.nethack.org/index.html"
license=('custom:NetHack GPL')
depends=('ncurses' 'gzip')
source=("http://downloads.sourceforge.net/$pkgname/$pkgname-$_pkgver-src.tgz")
md5sums=('21479c95990eefe7650df582426457f9')
build(){
cd $srcdir/$pkgname-$pkgver/
sh sys/unix/setup.sh
sed -e '/define HACKDIR/ s|/usr/games/lib/nethackdir|/usr/share/nethack/|' \
-e '/^#define COMPRESS\s/ s|/usr/bin/compress|/bin/gzip|' \
-e '/^#define COMPRESS_EXTENSION/ s|".Z"|".gz"|' \
-e 's|^/\* \(#define DLB\) \*/|\1|' -i include/config.h
sed -e 's|^/\* \(#define LINUX\) \*/|\1|' \
-e 's|^/\* \(#define TIMED_DELAY\) \*/|\1|' -i include/unixconf.h
sed -e 's|^# \(WINTTYLIB = -lncurses\)|\1|' \
-e 's|^WINTTYLIB = -ltermlib|#&|' -i src/Makefile
# we are setting up for setgid games, so modify all necessary permissions
# to allow full access for groups
sed -e '/^GAMEDIR\s*=/ s|/games/.*$|/share/$(GAME)|' \
-e '/^GAMEUID\s*=/ s|games|root|' \
-e '/^GAMEGRP\s*=/ s|bin|games|' \
-e '/^GAMEPERM\s*=/ s|04755|02755|' \
-e '/^FILEPERM\s*=/ s|0644|0664|' \
-e '/^DIRPERM\s*=/ s|0755|0775|' \
-e '/^SHELLDIR\s*=/ s|/games|/bin|' -i Makefile
sed -e "/^MANDIR\s*=/s|/usr/man/man6|$pkgdir/usr/share/man/man6|" -i doc/Makefile
make
}
package() {
cd $srcdir/$pkgname-$pkgver/
install -dm755 $pkgdir/usr/share/{man/man6,doc/nethack}
make PREFIX=$pkgdir/usr install manpages
sed -e "s|HACKDIR=$pkgdir/usr/|HACKDIR=/usr/|" \
-e 's|HACK=$HACKDIR|HACK=/usr/lib/nethack|' \
-i $pkgdir/usr/bin/nethack
install -dm755 $pkgdir/usr/lib/nethack
mv $pkgdir/usr/share/nethack/{nethack,recover} $pkgdir/usr/lib/nethack/
install -Dm644 doc/Guidebook.txt $pkgdir/usr/share/doc/nethack/Guidebook.txt
install -Dm644 dat/license $pkgdir/usr/share/licenses/$pkgname/LICENSE
}
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment