Sun Feb 15 21:53:40 2009 UTC ()
Improve scorefile handling.
Add patches for two problems with python-2.5/64-bit.
Convert to user-destdir.

Bump PKGREVISION.


(wiz)
diff -r1.6 -r1.7 pkgsrc/games/monsterz/Makefile
diff -r1.2 -r1.3 pkgsrc/games/monsterz/distinfo
diff -r1.1.1.1 -r1.2 pkgsrc/games/monsterz/patches/patch-aa
diff -r0 -r1.1 pkgsrc/games/monsterz/patches/patch-ab

cvs diff -r1.6 -r1.7 pkgsrc/games/monsterz/Makefile (expand / switch to unified diff)

--- pkgsrc/games/monsterz/Makefile 2009/02/09 22:56:24 1.6
+++ pkgsrc/games/monsterz/Makefile 2009/02/15 21:53:40 1.7
@@ -1,19 +1,30 @@ @@ -1,19 +1,30 @@
1# $NetBSD: Makefile,v 1.6 2009/02/09 22:56:24 joerg Exp $ 1# $NetBSD: Makefile,v 1.7 2009/02/15 21:53:40 wiz Exp $
2# 2#
3 3
4DISTNAME= monsterz-0.7.1 4DISTNAME= monsterz-0.7.1
5PKGREVISION= 1 5PKGREVISION= 2
6CATEGORIES= games 6CATEGORIES= games
7MASTER_SITES= http://sam.zoy.org/monsterz/ 7MASTER_SITES= http://sam.zoy.org/monsterz/
8 8
9MAINTAINER= wiz@NetBSD.org 9MAINTAINER= wiz@NetBSD.org
10HOMEPAGE= http://sam.zoy.org/monsterz/ 10HOMEPAGE= http://sam.zoy.org/monsterz/
11COMMENT= Puzzle game similar to the famous Bejeweled or Zookeeper 11COMMENT= Puzzle game similar to the famous Bejeweled or Zookeeper
12 12
13DEPENDS+= ${PYPKGPREFIX}-game-[0-9]*:../../devel/py-game 13DEPENDS+= ${PYPKGPREFIX}-game-[0-9]*:../../devel/py-game
14DEPENDS+= ${PYPKGPREFIX}-Numeric-[0-9]*:../../math/py-Numeric 14DEPENDS+= ${PYPKGPREFIX}-Numeric-[0-9]*:../../math/py-Numeric
15 15
16PYTHON_PATCH_SCRIPTS= monsterz.py 16PYTHON_PATCH_SCRIPTS= monsterz.py
17 17
 18PKG_DESTDIR_SUPPORT= user-destdir
 19
 20MAKE_ENV+= GAMEOWN=${GAMEOWN:Q}
 21MAKE_ENV+= GAMEGRP=${GAMEGRP:Q}
 22MAKE_ENV+= VARBASE=${VARBASE:Q}
 23
 24SETGIDGAME= yes
 25CONF_FILES_PERMS+= /dev/null ${VARBASE}/games/monsterz \
 26 ${GAMES_USER} ${GAMES_GROUP} ${GAMEDATAMODE}
 27SPECIAL_PERMS= bin/monsterz ${SETGID_GAMES_PERMS}
 28
18.include "../../lang/python/application.mk" 29.include "../../lang/python/application.mk"
19.include "../../mk/bsd.pkg.mk" 30.include "../../mk/bsd.pkg.mk"

cvs diff -r1.2 -r1.3 pkgsrc/games/monsterz/distinfo (expand / switch to unified diff)

--- pkgsrc/games/monsterz/distinfo 2008/01/13 16:03:48 1.2
+++ pkgsrc/games/monsterz/distinfo 2009/02/15 21:53:40 1.3
@@ -1,6 +1,7 @@ @@ -1,6 +1,7 @@
1$NetBSD: distinfo,v 1.2 2008/01/13 16:03:48 wiz Exp $ 1$NetBSD: distinfo,v 1.3 2009/02/15 21:53:40 wiz Exp $
2 2
3SHA1 (monsterz-0.7.1.tar.gz) = 8fb1933b7141a058e7b55f85537873e65568cb00 3SHA1 (monsterz-0.7.1.tar.gz) = 8fb1933b7141a058e7b55f85537873e65568cb00
4RMD160 (monsterz-0.7.1.tar.gz) = 6497b3c561f4a7c31b903a380d916778e44de5b8 4RMD160 (monsterz-0.7.1.tar.gz) = 6497b3c561f4a7c31b903a380d916778e44de5b8
5Size (monsterz-0.7.1.tar.gz) = 1879537 bytes 5Size (monsterz-0.7.1.tar.gz) = 1879537 bytes
6SHA1 (patch-aa) = 59d0e33054001e57c107a92554a77b684b4c60f0 6SHA1 (patch-aa) = 307d5c07baf9a6f84da9c79561c8f3fece188ca0
 7SHA1 (patch-ab) = e8349bb09699ed38ee578f341b1bf6794a8cc0cb

cvs diff -r1.1.1.1 -r1.2 pkgsrc/games/monsterz/patches/patch-aa (expand / switch to unified diff)

--- pkgsrc/games/monsterz/patches/patch-aa 2006/12/17 10:33:11 1.1.1.1
+++ pkgsrc/games/monsterz/patches/patch-aa 2009/02/15 21:53:40 1.2
@@ -1,13 +1,46 @@ @@ -1,13 +1,46 @@
1$NetBSD: patch-aa,v 1.1.1.1 2006/12/17 10:33:11 wiz Exp $ 1$NetBSD: patch-aa,v 1.2 2009/02/15 21:53:40 wiz Exp $
2 2
3--- Makefile.orig 2006-05-12 18:39:38.000000000 +0200 3--- Makefile.orig 2007-12-17 22:05:00.000000000 +0000
4+++ Makefile 4+++ Makefile
5@@ -1,6 +1,6 @@ 5@@ -1,9 +1,9 @@
6  6
7-prefix = /usr/local 7-prefix = /usr/local
8-gamesdir = ${prefix}/games 8-gamesdir = ${prefix}/games
9+prefix = ${PREFIX} 9+prefix = ${PREFIX}
10+gamesdir = ${prefix}/bin 10+gamesdir = ${prefix}/bin
11 datadir = ${prefix}/share 11 datadir = ${prefix}/share
12 pkgdatadir = $(datadir)/games/monsterz 12 pkgdatadir = $(datadir)/games/monsterz
13 scoredir = /var/games 13-scoredir = /var/games
 14+scoredir = ${VARBASE}/games
 15 scorefile = $(scoredir)/monsterz
 16
 17 VERSION = 0.7.1
 18@@ -40,18 +40,17 @@ graphics/logo.png: graphics/graphics.svg
 19 $(INKSCAPE) graphics/graphics.svg -a 810:858:1220:1075 -w380 -h180 -e graphics/logo.png
 20
 21 install: all
 22- mkdir -p $(DESTDIR)$(gamesdir)
 23- cp monsterz $(DESTDIR)$(gamesdir)/
 24- chown root:games $(DESTDIR)$(gamesdir)/monsterz
 25- chmod g+s $(DESTDIR)$(gamesdir)/monsterz
 26- mkdir -p $(DESTDIR)$(pkgdatadir)/graphics
 27- mkdir -p $(DESTDIR)$(pkgdatadir)/sound
 28- cp monsterz.py $(DESTDIR)$(pkgdatadir)/
 29- cp $(BITMAP) $(DESTDIR)$(pkgdatadir)/graphics/
 30- cp $(SOUND) $(MUSIC) $(DESTDIR)$(pkgdatadir)/sound/
 31- mkdir -p $(DESTDIR)$(scoredir)
 32+ ${BSD_INSTALL_GAME_DIR} $(DESTDIR)$(gamesdir)
 33+ ${BSD_INSTALL_GAME} monsterz $(DESTDIR)$(gamesdir)/
 34+ ${BSD_INSTALL_GAME_DIR} $(DESTDIR)$(pkgdatadir)/graphics
 35+ ${BSD_INSTALL_GAME_DIR} $(DESTDIR)$(pkgdatadir)/sound
 36+ ${BSD_INSTALL_SCRIPT} monsterz.py $(DESTDIR)$(pkgdatadir)/
 37+ ${BSD_INSTALL_GAME_DATA} $(BITMAP) $(DESTDIR)$(pkgdatadir)/graphics/
 38+ ${BSD_INSTALL_GAME_DATA} $(SOUND) $(MUSIC) $(DESTDIR)$(pkgdatadir)/sound/
 39+ ${BSD_INSTALL_GAME_DIR} $(DESTDIR)$(scoredir)
 40+ ${BSD_INSTALL_GAME_DIR} $(DESTDIR)$(scoredir)
 41 test -f $(DESTDIR)$(scorefile) || echo "" > $(DESTDIR)$(scorefile)
 42- chown root:games $(DESTDIR)$(scorefile)
 43+ chown ${GAMEOWN}:${GAMEGRP} $(DESTDIR)$(scorefile)
 44 chmod g+w $(DESTDIR)$(scorefile)
 45
 46 uninstall:

File Added: pkgsrc/games/monsterz/patches/patch-ab
$NetBSD: patch-ab,v 1.1 2009/02/15 21:53:40 wiz Exp $

Fix 64-bit alignment issue with Python 2.5.
http://sam.zoy.org/cgi-bin/viewcvs.cgi/monsterz.py?root=monsterz&rev=137&r1=135&r2=137

Fix blit crash, using patch from Fedora:
http://cvs.fedoraproject.org/viewvc/devel/monsterz/monsterz-0.7.1-blit-crash.patch?view=log

--- monsterz.py.orig	2007-12-17 22:05:00.000000000 +0000
+++ monsterz.py
@@ -1,4 +1,4 @@
-#!/usr/bin/env python
+#!/usr/pkg/bin/python2.5
 # -*- coding: utf-8 -*-
 
 """
@@ -108,7 +108,9 @@ def semi_grayscale(surf):
                 M = int(max(r, g, b))
                 m = int(min(r, g, b))
                 val = (2 * M + r + g + b) / 5
-                p[:] = (val + r) / 2, (val + g) / 2, (val + b) / 2
+		p[0] = (val + r) / 2
+		p[1] = (val + g) / 2
+		p[2] = (val + b) / 2
                 if alpha[y][x] >= 250:
                     alpha[y][x] = 255 - (M - m) * 3 / 4
         del pixels
@@ -129,7 +131,9 @@ def semi_transp(surf):
                 r, g, b = p
                 M = int(max(r, g, b))
                 m = int(min(r, g, b))
-                p[:] = (m + r) / 2, (m + g) / 2, (m + b) / 2
+		p[0] = (m + r) / 2
+		p[1] = (m + g) / 2
+		p[2] = (m + b) / 2
                 if alpha[y][x] >= 250:
                     alpha[y][x] = 255 - M * 2 / 3
         del pixels
@@ -829,10 +833,10 @@ class Game:
             pass
         else:
             for x in range(4):
-                for y, p in enumerate(alpha[x]):
-                    alpha[x][y] = p * x / 4
-                for y, p in enumerate(alpha[406 - x - 1]):
-                    alpha[406 - x - 1][y] = p * x / 4
+                for y in range(len(alpha[x])):
+                    alpha[x][y] = alpha[x][y] * x / 4
+                for y in range(len(alpha[406 - x - 1])):
+                    alpha[406 - x - 1][y] = alpha[406 - x - 1][y] * x / 4
             for col in alpha:
                 l = len(col)
                 for y in range(4):
@@ -1287,10 +1291,10 @@ class Monsterz:
             pass
         else:
             for x in range(10):
-                for y, p in enumerate(alpha[x]):
-                    alpha[x][y] = p * x / 12
-                for y, p in enumerate(alpha[406 - x - 1]):
-                    alpha[406 - x - 1][y] = p * x / 12
+                for y in range(len(alpha[x])):
+                    alpha[x][y] = alpha[x][y] * x / 12
+                for y in range(len(alpha[406 - x - 1])):
+                    alpha[406 - x - 1][y] = alpha[406 - x - 1][y] * x / 12
             del alpha
             scroll.unlock()
         system.blit(scroll, (13, 437))