summaryrefslogtreecommitdiff
path: root/extra/glhack
diff options
context:
space:
mode:
authorParabola <dev@list.parabolagnulinux.org>2011-04-05 14:26:38 +0000
committerParabola <dev@list.parabolagnulinux.org>2011-04-05 14:26:38 +0000
commit415856bdd4f48ab4f2732996f0bae58595092bbe (patch)
treeede2018b591f6dfb477fe9341ba17b9bc000fab9 /extra/glhack
Tue Apr 5 14:26:38 UTC 2011
Diffstat (limited to 'extra/glhack')
-rw-r--r--extra/glhack/ChangeLog12
-rw-r--r--extra/glhack/PKGBUILD50
-rw-r--r--extra/glhack/glhack.install24
3 files changed, 86 insertions, 0 deletions
diff --git a/extra/glhack/ChangeLog b/extra/glhack/ChangeLog
new file mode 100644
index 000000000..cc13a2560
--- /dev/null
+++ b/extra/glhack/ChangeLog
@@ -0,0 +1,12 @@
+2010-01-18 Eric Belanger <eric@archlinux.org>
+
+ * glhack 1.2-4
+ * Rebuilt for libpng 1.4 and libjpeg 8
+ * Fixed man page conflict with nethack (close FS#17226)
+
+2009-06-29 Eric Belanger <eric@archlinux.org>
+
+ * glhack 1.2-3
+ * Moved binaries to /usr/bin (close FS#15303)
+ * Moved saved games to /var
+ * Added ChangeLog
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"
+}
diff --git a/extra/glhack/glhack.install b/extra/glhack/glhack.install
new file mode 100644
index 000000000..78e1655bc
--- /dev/null
+++ b/extra/glhack/glhack.install
@@ -0,0 +1,24 @@
+post_install() {
+ touch var/games/glhack/{record,perm,logfile}
+ chown root:games var/games/glhack/{record,perm,logfile}
+ chmod 664 var/games/glhack/{record,perm,logfile}
+}
+
+pre_upgrade() {
+ install -d -m775 var/games/glhack
+ chown root:games var/games/glhack
+ [ -e usr/share/glhack/record ] && cp usr/share/glhack/record var/games/glhack
+ [ -e usr/share/glhack/perm ] && cp usr/share/glhack/perm var/games/glhack
+ [ -e usr/share/glhack/logfile ] && cp usr/share/glhack/logfile var/games/glhack
+ if [ -d usr/share/glhack/save ]; then
+ chmod g-s usr/share/glhack/save
+ mv usr/share/glhack/save var/games/glhack
+ else
+ install -d -m775 var/games/glhack/save
+ fi
+ chown root:games var/games/glhack/save
+}
+
+post_upgrade() {
+ post_install
+}