summaryrefslogtreecommitdiff
path: root/extra/glhack/PKGBUILD
diff options
context:
space:
mode:
Diffstat (limited to 'extra/glhack/PKGBUILD')
-rw-r--r--extra/glhack/PKGBUILD50
1 files changed, 50 insertions, 0 deletions
diff --git a/extra/glhack/PKGBUILD b/extra/glhack/PKGBUILD
new file mode 100644
index 000000000..27ef966e4
--- /dev/null
+++ b/extra/glhack/PKGBUILD
@@ -0,0 +1,50 @@
+# $Id: PKGBUILD 63897 2010-01-19 01:01:11Z eric $
+# Maintainer: Eric Belanger <eric@archlinux.org>
+# Contributor : Markus Meissner <markus@meissna.de>
+
+pkgname=glhack
+pkgver=1.2
+pkgrel=4
+pkgdesc="A port of Nethack, a single player dungeon exploration game in 2D"
+arch=('i686' 'x86_64')
+url="http://glhack.sourceforge.net/"
+license=('custom')
+depends=('sdl' 'libpng' 'mesa')
+options=('!makeflags')
+install=glhack.install
+source=(http://downloads.sourceforge.net/${pkgname}/${pkgname}-${pkgver}.tar.gz)
+md5sums=('b4c68e3ab689610ca638b7660c1b05bd')
+sha1sums=('7dc46e6bd4a3c2ec10ab4d314acfbb30cefc6eae')
+
+build(){
+ cd "${srcdir}/${pkgname}-${pkgver}"
+
+ sed -i 's|/usr/lib/games|/usr/share|' include/config.h || return 1
+ sed -i 's|/var/lib/games/glhack|/var/games/glhack|' include/unixconf.h || return 1
+ sed -i -e 's|PREFIX = /usr|PREFIX = $(DESTDIR)/usr|' Makefile || return 1
+ sed -i -e 's|VARDIR = /var/lib/games/glhack|VARDIR = $(DESTDIR)/var/games/glhack|' Makefile || return 1
+ sed -i -e 's|/usr/man/man6|$(DESTDIR)/usr/share/man/man6|' doc/Makefile || return 1
+ sed -i -e 's|GAMEDIR = $(PREFIX)/lib/games/$(GAME)|GAMEDIR = $(PREFIX)/share/$(GAME)|' Makefile || return 1
+
+ make || return 1
+ install -d "${pkgdir}"/usr/share/man/man{5,6}
+ make DESTDIR="$pkgdir" install || return 1
+ install -D -m644 dat/license "${pkgdir}/usr/share/licenses/${pkgname}/license"
+
+# Renaming man pages which conflicts with nethack
+ cd "${pkgdir}/usr/share/man/man6"
+ for manpage in dgn_comp dlb lev_comp nethack recover; do
+ mv $manpage.6 $manpage-glhack.6
+ done
+ cd "${srcdir}/${pkgname}-${pkgver}"
+
+ mv "${pkgdir}/usr/share/glhack/glhack" "${pkgdir}/usr/bin/glhack"
+ mv "${pkgdir}/usr/share/glhack/recover_glhack" "${pkgdir}/usr/bin/recover_glhack"
+
+ chown -R root:root "${pkgdir}/usr/share/glhack"
+
+ rm -r "${pkgdir}"/var/games/glhack
+ install -d "${pkgdir}/var/games/glhack/save"
+ chmod -R 775 "${pkgdir}/var/games"
+ chown -R root:games "${pkgdir}/var/games"
+}