From 68b7938bb87c6e91d54e4f35f0223c7237fa53e1 Mon Sep 17 00:00:00 2001 From: root Date: Tue, 16 Aug 2011 23:14:31 +0000 Subject: Tue Aug 16 23:14:31 UTC 2011 --- community/nethack/PKGBUILD | 19 +++++++++++-------- community/nethack/nethack.install | 12 ++++++++++++ 2 files changed, 23 insertions(+), 8 deletions(-) create mode 100644 community/nethack/nethack.install (limited to 'community/nethack') diff --git a/community/nethack/PKGBUILD b/community/nethack/PKGBUILD index fafecfd18..a3da43710 100644 --- a/community/nethack/PKGBUILD +++ b/community/nethack/PKGBUILD @@ -1,17 +1,19 @@ -# $Id: PKGBUILD 36702 2011-01-06 09:48:20Z schuay $ +# $Id: PKGBUILD 54249 2011-08-15 09:38:46Z schuay $ # Maintainer : schuay # Contributor : kevin # Contributor : Christian Schmidt # Contributor : Markus Meissner +# Contributor : Nick Erdmann pkgname=nethack pkgver=3.4.3 -pkgrel=5 +pkgrel=6 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=("http://downloads.sourceforge.net/$pkgname/$pkgname-${pkgver//.}-src.tgz") md5sums=('21479c95990eefe7650df582426457f9') @@ -19,7 +21,7 @@ build(){ cd $srcdir/$pkgname-$pkgver/ sh sys/unix/setup.sh - sed -e '/define HACKDIR/ s|/usr/games/lib/nethackdir|/usr/share/nethack/|' \ + sed -e '/define HACKDIR/ s|/usr/games/lib/nethackdir|/var/games/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 @@ -33,13 +35,13 @@ build(){ # 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)|' \ + sed -e '/^GAMEDIR\s*=/ s|/games/.*$|/var/games/$(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 + -e '/^SHELLDIR\s*=/ s|/games|/usr/bin|' -i Makefile sed -e "/^MANDIR\s*=/s|/usr/man/man6|$pkgdir/usr/share/man/man6|" -i doc/Makefile @@ -50,13 +52,14 @@ 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/|" \ + install -dm775 $pkgdir/var/games/ + make PREFIX=$pkgdir install manpages + 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/usr/share/nethack/{nethack,recover} $pkgdir/usr/lib/nethack/ + mv $pkgdir/var/games/nethack/{nethack,recover} $pkgdir/usr/lib/nethack/ install -Dm644 doc/Guidebook.txt $pkgdir/usr/share/doc/nethack/Guidebook.txt diff --git a/community/nethack/nethack.install b/community/nethack/nethack.install new file mode 100644 index 000000000..66ec2aeb5 --- /dev/null +++ b/community/nethack/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 +} -- cgit v1.2.3-54-g00ecf