summaryrefslogtreecommitdiff
path: root/games/sokoban
diff options
context:
space:
mode:
authorMark Pulford <markp@FreeBSD.org>2002-06-05 09:59:57 +0000
committerMark Pulford <markp@FreeBSD.org>2002-06-05 09:59:57 +0000
commite56553d416ef479503e1d556a7670775cfc1bbbc (patch)
tree21c689d83062182b5dae7bd83665510dc60183ee /games/sokoban
parentUpdate to the latest, 0.21. This version contains many changes, (diff)
Improved high score handling
Prompted by PR: 37338
Notes
Notes: svn path=/head/; revision=60641
Diffstat (limited to 'games/sokoban')
-rw-r--r--games/sokoban/Makefile6
-rw-r--r--games/sokoban/files/patch-ab2
-rw-r--r--games/sokoban/pkg-install9
-rw-r--r--games/sokoban/pkg-plist1
4 files changed, 11 insertions, 7 deletions
diff --git a/games/sokoban/Makefile b/games/sokoban/Makefile
index ba898f311bba..e55efeed6aa0 100644
--- a/games/sokoban/Makefile
+++ b/games/sokoban/Makefile
@@ -26,10 +26,6 @@ do-install:
@ ${MKDIR} ${PREFIX}/share/sokoban/screens
@ ${CHOWN} root:games ${PREFIX}/share/sokoban/screens
@ ${INSTALL_DATA} ${WRKSRC}/screens/* ${PREFIX}/share/sokoban/screens
- @ if [ ! -f ${PREFIX}/share/sokoban/highscore ]; then \
- dd if=/dev/zero of=${PREFIX}/share/sokoban/highscore bs=1 count=2; \
- fi
- @ ${CHOWN} root:games ${PREFIX}/share/sokoban/highscore
- @ ${CHMOD} 0600 ${PREFIX}/share/sokoban/highscore
+ @ ${SH} pkg-install ${PKGNAME} POST-INSTALL
.include <bsd.port.mk>
diff --git a/games/sokoban/files/patch-ab b/games/sokoban/files/patch-ab
index ffdb5d958529..95e56f7e3de5 100644
--- a/games/sokoban/files/patch-ab
+++ b/games/sokoban/files/patch-ab
@@ -11,7 +11,7 @@
+ #define SCREENPATH PREFIX "/share/sokoban/screens"
+ #define SAVEPATH PREFIX "/share/sokoban"
+ #define LOCKFILE "/tmp/sok.tmp"
-+ #define SCOREFILE PREFIX "/share/sokoban/highscore"
++ #define SCOREFILE "/var/games/sokoban"
+ #else
+
/**/
diff --git a/games/sokoban/pkg-install b/games/sokoban/pkg-install
new file mode 100644
index 000000000000..9587d65b8106
--- /dev/null
+++ b/games/sokoban/pkg-install
@@ -0,0 +1,9 @@
+#!/bin/sh
+
+FILE="/var/games/sokoban"
+[ "$2" != "POST-INSTALL" -o -f "$FILE" ] && exit 0
+
+echo "===> Creating initial high score file $FILE"
+dd if=/dev/zero of=$FILE bs=1 count=2
+chmod 664 $FILE
+chown root.games $FILE
diff --git a/games/sokoban/pkg-plist b/games/sokoban/pkg-plist
index 7dd05002ac3c..2bb8ba417136 100644
--- a/games/sokoban/pkg-plist
+++ b/games/sokoban/pkg-plist
@@ -1,5 +1,4 @@
bin/sokoban
-share/sokoban/highscore
share/sokoban/screens/sokoban.help
share/sokoban/screens/screen.1
share/sokoban/screens/screen.2