[arch-commits] Commit in glhack/trunk (ChangeLog PKGBUILD glhack.install)

Eric Bélanger eric at archlinux.org
Fri Jul 10 20:36:03 EDT 2009


    Date: Friday, July 10, 2009 @ 20:36:03
  Author: eric
Revision: 45398

upgpkg: glhack 1.2-3
    Moved binaries to /usr/bin (close FS#15303), Moved saved games to /var, Added ChangeLog

Added:
  glhack/trunk/ChangeLog
  glhack/trunk/glhack.install
Modified:
  glhack/trunk/PKGBUILD

----------------+
 ChangeLog      |    6 ++++++
 PKGBUILD       |   37 +++++++++++++++++++++++++------------
 glhack.install |   24 ++++++++++++++++++++++++
 3 files changed, 55 insertions(+), 12 deletions(-)

Added: ChangeLog
===================================================================
--- ChangeLog	                        (rev 0)
+++ ChangeLog	2009-07-11 00:36:03 UTC (rev 45398)
@@ -0,0 +1,6 @@
+2009-06-29  Eric Belanger  <eric at archlinux.org>
+
+	* glhack 1.2-3
+	* Moved binaries to /usr/bin (close FS#15303)
+	* Moved saved games to /var
+	* Added ChangeLog

Modified: PKGBUILD
===================================================================
--- PKGBUILD	2009-07-10 22:25:10 UTC (rev 45397)
+++ PKGBUILD	2009-07-11 00:36:03 UTC (rev 45398)
@@ -4,26 +4,39 @@
 
 pkgname=glhack
 pkgver=1.2
-pkgrel=2
+pkgrel=3
 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')
-source=(http://downloads.sourceforge.net/$pkgname/$pkgname-$pkgver.tar.gz)
+install=glhack.install
+source=(http://downloads.sourceforge.net/${pkgname}/${pkgname}-${pkgver}.tar.gz)
 md5sums=('b4c68e3ab689610ca638b7660c1b05bd')
 
 build(){
-  cd $srcdir/$pkgname-$pkgver
-  sed -i -e 's|GAMEDIR  = $(PREFIX)/lib/games/$(GAME)|GAMEDIR  = $(PREFIX)/share/$(GAME)|g' Makefile || return 1
-  sed -i -e 's|SHELLDIR = $(PREFIX)/games|SHELLDIR = $(PREFIX)/bin|g' Makefile || return 1
-  sed -i -e 's|VARDIR   = /var/lib/games/glhack|VARDIR   = $(PREFIX)/share/$(GAME)|g' Makefile || return 1
+  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}
-  sed -i "s|/usr/man/man6|$pkgdir/usr/share/man/man6|" doc/Makefile || return 1
-  sed -i -e "s|PREFIX[\t]* = /usr|PREFIX   = $pkgdir/usr|g" Makefile || return 1
-  sed -i -e 's|s;/usr/games/lib/nethackdir;$(GAMEDIR);|s;/usr/games/lib/nethackdir;/usr/share/$(GAME);|g' Makefile || return 1
-  make install || return 1
-  install -D -m644 dat/license $pkgdir/usr/share/licenses/$pkgname/license
+  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"
+
+  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"
 }

Added: glhack.install
===================================================================
--- glhack.install	                        (rev 0)
+++ glhack.install	2009-07-11 00:36:03 UTC (rev 45398)
@@ -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
+}



More information about the arch-commits mailing list