diff options
author | Eric Biggers | 2016-10-22 14:01:35 -0700 |
---|---|---|
committer | Eric Biggers | 2016-10-22 14:11:37 -0700 |
commit | 9ea3c83c0121c00bfc2f8f0c3e414e1b384aa357 (patch) | |
tree | 16f4f426bf856210b30c2055452c3d3b4854414b | |
download | aur-9ea3c83c0121c00bfc2f8f0c3e414e1b384aa357.tar.gz |
Initial commit
-rw-r--r-- | .SRCINFO | 21 | ||||
-rw-r--r-- | PKGBUILD | 81 | ||||
-rw-r--r-- | nethack.install | 12 |
3 files changed, 114 insertions, 0 deletions
diff --git a/.SRCINFO b/.SRCINFO new file mode 100644 index 000000000000..64c16920ce00 --- /dev/null +++ b/.SRCINFO @@ -0,0 +1,21 @@ +# Generated by mksrcinfo v8 +# Sat Oct 22 21:11:30 UTC 2016 +pkgbase = nethack-git + pkgdesc = A single player dungeon exploration game + pkgver = 3.6.0.r728.gf715224 + pkgrel = 1 + url = http://www.nethack.org/index.html + install = nethack.install + arch = i686 + arch = x86_64 + license = custom + depends = ncurses + depends = gzip + provides = nethack + conflicts = nethack + replaces = nethack + source = git://git.code.sf.net/p/nethack/NetHack#branch=NetHack-3.6.0 + md5sums = SKIP + +pkgname = nethack-git + diff --git a/PKGBUILD b/PKGBUILD new file mode 100644 index 000000000000..057870de2426 --- /dev/null +++ b/PKGBUILD @@ -0,0 +1,81 @@ +# +# PKGBUILD for the development version of NetHack +# Maintainer: Eric Biggers <ebiggers3@gmail.com> +# +# Based on the PKGBUILD for nethack 3.6.0 +# + +pkgname=nethack-git +pkgver=3.6.0.r728.gf715224 +pkgrel=1 +pkgdesc='A single player dungeon exploration game' +arch=('i686' 'x86_64') +url='http://www.nethack.org/index.html' +license=('custom') +depends=('ncurses' 'gzip') +install=nethack.install +source=('git://git.code.sf.net/p/nethack/NetHack#branch=NetHack-3.6.0') +md5sums=('SKIP') +conflicts=('nethack') +provides=('nethack') +replaces=('nethack') + +pkgver() { + cd NetHack + git describe --long --tags | \ + sed 's/NetHack-//;s/_Release//;s/\([^-]*-g\)/r\1/;s/-/./g' +} + +prepare() { + cd $srcdir/NetHack + + sed -e 's|^/\* \(#define LINUX\) \*/|\1|' -i include/unixconf.h + + # we are setting up for setgid games, so modify all necessary permissions + # to allow full access for groups + + sed -e '/^HACKDIR/ s|/games/lib/\$(GAME)dir|/var/games/nethack/|' \ + -e '/^SHELLDIR/ s|/games|/usr/bin|' \ + -e '/^VARDIRPERM/ s|0755|0775|' \ + -e '/^VARFILEPERM/ s|0600|0664|' \ + -e '/^GAMEPERM/ s|0755|02755|' \ + -e 's|\(DSYSCF_FILE=\)\\"[^"]*\\"|\1\\"/var/games/nethack/sysconf\\"|' \ + -e 's|\(DHACKDIR=\)\\"[^"]*\\"|\1\\"/var/games/nethack/\\"|' -i sys/unix/hints/linux + + sed -e 's|^#GAMEUID.*|GAMEUID = root|' \ + -e 's|^#GAMEGRP.*|GAMEGRP = games|' \ + -e '/^FILEPERM\s*=/ s|0644|0664|' \ + -e '/^DIRPERM\s*=/ s|0755|0775|' -i sys/unix/Makefile.top + + sed -e "/^MANDIR\s*=/s|/usr/man/man6|$pkgdir/usr/share/man/man6|" -i sys/unix/Makefile.doc +} + +build() { + cd $srcdir/NetHack/sys/unix + sh setup.sh hints/linux + + cd $srcdir/NetHack + make +} + +package() { + cd $srcdir/NetHack/ + + install -dm755 $pkgdir/usr/share/{man/man6,doc/nethack} + install -dm775 $pkgdir/var/games/ + make PREFIX=$pkgdir -j1 install manpages # Multi-threaded builds fail. + sed -e "s|HACKDIR=$pkgdir/|HACKDIR=/|" \ + -e 's|HACK=$HACKDIR|HACK=/usr/lib/nethack|' \ + -i $pkgdir/usr/bin/nethack + + install -dm755 $pkgdir/usr/lib/nethack + mv $pkgdir/var/games/nethack/{nethack,recover} $pkgdir/usr/lib/nethack/ + + # FS#43414: /var/games should be owned by root:games. + chown -R root:games $pkgdir/var/games/ + chown root:games $pkgdir/usr/lib/nethack/nethack + #chmod 02755 $pkgdir/usr/lib/nethack/nethack + + install -Dm644 doc/Guidebook.txt $pkgdir/usr/share/doc/nethack/Guidebook.txt + install -Dm644 dat/license $pkgdir/usr/share/licenses/nethack/LICENSE +} diff --git a/nethack.install b/nethack.install new file mode 100644 index 000000000000..66ec2aeb5014 --- /dev/null +++ b/nethack.install @@ -0,0 +1,12 @@ +pre_upgrade() { + if(test `vercmp '3.4.3-5' "$2"` -ge 0); then + mv /usr/share/nethack /tmp/nethack-backup + fi +} + +post_upgrade() { + if(test `vercmp '3.4.3-5' "$2"` -ge 0); then + rm -rf /var/games/nethack + mv /tmp/nethack-backup /var/games/nethack + fi +} |