aboutsummaryrefslogtreecommitdiffstats
path: root/games/sokoban
diff options
context:
space:
mode:
authormarkp <markp@FreeBSD.org>2002-06-05 17:59:57 +0800
committermarkp <markp@FreeBSD.org>2002-06-05 17:59:57 +0800
commit3f311db9c6a7e671c94918a6ce4de762de2328fe (patch)
tree3ec60c03a864f71d0338d1f494e517218ef1ca97 /games/sokoban
parent17acb0e134eaedd730ff5b855f1103825cc53833 (diff)
downloadfreebsd-ports-gnome-3f311db9c6a7e671c94918a6ce4de762de2328fe.tar.gz
freebsd-ports-gnome-3f311db9c6a7e671c94918a6ce4de762de2328fe.tar.zst
freebsd-ports-gnome-3f311db9c6a7e671c94918a6ce4de762de2328fe.zip
Improved high score handling
Prompted by PR: 37338
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