[arch-commits] CVS update of extra/games/maelstrom (4 files)

Jan de Groot jgc at archlinux.org
Wed Dec 26 14:38:47 EST 2007


    Date: Wednesday, December 26, 2007 @ 14:38:47
  Author: jgc
    Path: /home/cvs-extra/extra/games/maelstrom

   Added: Maelstrom.desktop (1.1) maelstrom-scores.patch (1.1)
          maelstrom.install (1.1)
Modified: PKGBUILD (1.6 -> 1.7)

upgpkg: maelstrom 3.0.6-2
Clean up PKGBUILD
Add license
Add desktop file
Move scores to /var/games
Preserve scores on upgrades
Depend on gcc-libs
Use same score permissions as gnome-games
Move files from /usr/games to /usr/share


------------------------+
 Maelstrom.desktop      |    9 ++++++++
 PKGBUILD               |   50 ++++++++++++++++++++++++++++++++---------------
 maelstrom-scores.patch |   38 +++++++++++++++++++++++++++++++++++
 maelstrom.install      |   18 ++++++++++++++++
 4 files changed, 100 insertions(+), 15 deletions(-)


Index: extra/games/maelstrom/Maelstrom.desktop
diff -u /dev/null extra/games/maelstrom/Maelstrom.desktop:1.1
--- /dev/null	Wed Dec 26 14:38:47 2007
+++ extra/games/maelstrom/Maelstrom.desktop	Wed Dec 26 14:38:47 2007
@@ -0,0 +1,9 @@
+[Desktop Entry]
+Comment=Maelstrom
+Exec=/usr/bin/Maelstrom
+Icon=/usr/share/Maelstrom/icon.xpm
+Name=Maelstrom
+StartupNotify=false
+Terminal=false
+Type=Application
+Categories=Game;
Index: extra/games/maelstrom/PKGBUILD
diff -u extra/games/maelstrom/PKGBUILD:1.6 extra/games/maelstrom/PKGBUILD:1.7
--- extra/games/maelstrom/PKGBUILD:1.6	Thu Mar 22 15:06:38 2007
+++ extra/games/maelstrom/PKGBUILD	Wed Dec 26 14:38:47 2007
@@ -1,25 +1,45 @@
-# $Id: PKGBUILD,v 1.6 2007/03/22 19:06:38 andyrtr Exp $
+# $Id: PKGBUILD,v 1.7 2007/12/26 19:38:47 jgc Exp $
 # Maintainer: dale <dale at archlinux.org>
 # Contributor: Tom Newsom <Jeepster at gmx.co.uk>
 
 pkgname=maelstrom
 pkgver=3.0.6
-pkgrel=1
-pkgdesc="Maelstrom is an excellent Asteroids-type game with sound and 3D objects"
+pkgrel=2
+pkgdesc="Asteroids-type game with sound and 3D objects"
 arch=('i686' 'x86_64')
-depends=('sdl' 'sdl_net')
-source=(http://www.devolution.com/~slouken/Maelstrom/src/Maelstrom-$pkgver.tar.gz
-	maelstrom-3.0.6-64bits.patch)
+license=('GPL')
+depends=('sdl_net' 'gcc-libs')
+backup=('var/games/Maelstrom.scores')
+install=maelstrom.install
+source=(http://www.devolution.com/~slouken/Maelstrom/src/Maelstrom-${pkgver}.tar.gz
+	maelstrom-3.0.6-64bits.patch
+	maelstrom-scores.patch
+	Maelstrom.desktop)
 url="http://www.devolution.com/~slouken/Maelstrom/"
-md5sums=('4fbeb6070eebdf161bd156b083b8804e' '471ef416576d1ba7dabfa12a4825e271')
+md5sums=('4fbeb6070eebdf161bd156b083b8804e'
+         '471ef416576d1ba7dabfa12a4825e271'
+         '131dc95ec8d23f510cdec2bb10dbb9b4'
+	 '4e9009d8c1b7afd68f54084565135d6c')
 
 build() {
-cd $startdir/src/Maelstrom-$pkgver
-if [ "$CARCH" = "x86_64" ]; then
-  patch -Np0 -i ../maelstrom-3.0.6-64bits.patch
-fi
-./configure --prefix=/usr
-make || return 1
-make prefix=$startdir/pkg/usr install
-}
+  cd ${startdir}/src/Maelstrom-${pkgver}
+  if [ "${CARCH}" = "x86_64" ]; then
+    patch -Np0 -i ../maelstrom-3.0.6-64bits.patch || return 1
+  fi
+  patch -Np0 -i ${startdir}/src/maelstrom-scores.patch || return 1
+  sed -i -e 's/games\/\$PACKAGE/share\/\$PACKAGE/g' configure
+  ./configure --prefix=/usr || return 1
+  make || return 1
+  make -j1 prefix=${startdir}/pkg/usr install || return 1
+
+  mkdir -p ${startdir}/pkg/usr/share/applications
+  install -m644 ${startdir}/src/Maelstrom.desktop ${startdir}/pkg/usr/share/applications/Maelstrom.desktop || return 1
 
+  chown root:games ${startdir}/pkg/usr/bin/Maelstrom || return 1
+  chmod 2555 ${startdir}/pkg/usr/bin/Maelstrom || return 1
+
+  mkdir -p ${startdir}/pkg/var/games
+  mv ${startdir}/pkg/usr/share/Maelstrom/Maelstrom-Scores ${startdir}/pkg/var/games/Maelstrom.scores || return 1
+  chown root:games ${startdir}/pkg/var/games/Maelstrom.scores || return 1
+  chmod 664 ${startdir}/pkg/var/games/Maelstrom.scores || return 1
+}
Index: extra/games/maelstrom/maelstrom-scores.patch
diff -u /dev/null extra/games/maelstrom/maelstrom-scores.patch:1.1
--- /dev/null	Wed Dec 26 14:38:47 2007
+++ extra/games/maelstrom/maelstrom-scores.patch	Wed Dec 26 14:38:47 2007
@@ -0,0 +1,38 @@
+--- scores.cpp.orig	2007-12-26 19:07:53.000000000 +0000
++++ scores.cpp	2007-12-26 19:08:30.000000000 +0000
+@@ -15,7 +15,7 @@
+ #include "load.h"
+ #include "dialog.h"
+ 
+-#define MAELSTROM_SCORES	"Maelstrom-Scores"
++#define MAELSTROM_SCORES	"/var/games/Maelstrom.scores"
+ #define NUM_SCORES		10		// Do not change this!
+ 
+ /* Everyone can write to scores file if defined to 0 */
+@@ -44,7 +44,7 @@
+ 	}
+ 	memset(&hScores, 0, sizeof(hScores));
+ 
+-	scores_src = SDL_RWFromFile(path.Path(MAELSTROM_SCORES), "rb");
++	scores_src = SDL_RWFromFile(MAELSTROM_SCORES, "rb");
+ 	if ( scores_src != NULL ) {
+ 		for ( i=0; i<NUM_SCORES; ++i ) {
+ 			SDL_RWread(scores_src, hScores[i].name,
+@@ -72,7 +72,7 @@
+ #ifdef unix
+ 	omask=umask(SCORES_PERMMASK);
+ #endif
+-	scores_src = SDL_RWFromFile(path.Path(MAELSTROM_SCORES), "wb");
++	scores_src = SDL_RWFromFile(MAELSTROM_SCORES, "wb");
+ 	if ( scores_src != NULL ) {
+ 		for ( i=0; i<NUM_SCORES; ++i ) {
+ 			SDL_RWwrite(scores_src, hScores[i].name,
+@@ -83,7 +83,7 @@
+ 		SDL_RWclose(scores_src);
+ 	} else {
+ 		error("Warning: Couldn't save scores to %s\n",
+-						path.Path(MAELSTROM_SCORES));
++						MAELSTROM_SCORES);
+ 	}
+ #ifdef unix
+ 	umask(omask);
Index: extra/games/maelstrom/maelstrom.install
diff -u /dev/null extra/games/maelstrom/maelstrom.install:1.1
--- /dev/null	Wed Dec 26 14:38:47 2007
+++ extra/games/maelstrom/maelstrom.install	Wed Dec 26 14:38:47 2007
@@ -0,0 +1,18 @@
+pre_upgrade() {
+  if [ -f usr/games/Maelstrom-Scores ]; then
+    mv usr/games/Maelstrom-Scores var/games/Maelstrom.scores.old
+  fi
+}
+
+post_upgrade() {
+  if [ -f var/games/Maelstrom.scores.old ]; then
+    mv var/games/Maelstrom.scores.old var/games/Maelstrom.scores
+    chown root:games var/games/Maelstrom.scores
+    chmod 664 var/games/Maelstrom.scores
+  fi
+}
+
+op=$1
+shift
+
+$op $*




More information about the arch-commits mailing list