move hiscore file to /var/games

This commit is contained in:
wilfried 2003-04-15 12:41:25 +00:00
parent c156526cc4
commit cd48ec7394
17 changed files with 301 additions and 29 deletions

View File

@ -0,0 +1,38 @@
$OpenBSD: patch-Scorelist_cc,v 1.1 2003/04/15 12:41:25 wilfried Exp $
--- Scorelist.cc.orig Thu Jan 23 17:22:50 1997
+++ Scorelist.cc Tue Apr 15 13:13:59 2003
@@ -2,7 +2,7 @@
FILE *Scorelist::open_file(char *mode) {
char file[255];
- sprintf (file, "%sscores", XBILL_HOME);
+ sprintf (file, "%sscores", "/var/games/xbill.");
return fopen (file, mode);
}
@@ -11,8 +11,14 @@ void Scorelist::read() {
int i;
if (scorefile) {
for (i=0; i<10; i++) {
- fgets (name[i], 21, scorefile);
- fscanf (scorefile, "%d%d\n", &(level[i]), &(score[i]));
+ char temp[40];
+ if (fgets (temp, sizeof(temp), scorefile)) {
+ strlcpy (name[i], temp, sizeof(name[0]));
+ sscanf (temp+21, "%d%d\n", &(level[i]), &(score[i]));
+ } else {
+ strcpy(name[i], "me");
+ level[i] = score[i] = 0;
+ }
}
fclose(scorefile);
}
@@ -48,7 +54,7 @@ void Scorelist::recalc (char *str) {
}
else break;
}
- strcpy (name[i], str);
+ strlcpy (name[i], str, sizeof(name[0]));
level[i] = game.level;
score[i] = game.score;
}

View File

@ -1,5 +1,5 @@
--- Imakefile.orig Thu Jan 23 17:38:35 1997
+++ Imakefile Fri Jun 2 18:42:21 2000
+++ Imakefile Mon Apr 14 18:44:18 2003
@@ -1,4 +1,4 @@
-XBILL_DIR = /var/lib/games/xbill/
+XBILL_DIR = /usr/local/share/xbill/
@ -15,14 +15,12 @@
CXX = g++ $(CCFLAGS)
CCC = $(CXX)
@@ -136,6 +136,7 @@ XBMS = bitmaps/apple.xbm \
@@ -136,6 +136,5 @@ XBMS = bitmaps/apple.xbm \
ComplexProgramTarget($(TARGET))
-InstallProgramWithFlags(scores, $(XBILL_DIR), -m 777)
-InstallMultiple ($(XPMS), $(XBILL_DIR)pixmaps)
-InstallMultiple ($(XBMS), $(XBILL_DIR)bitmaps)
+# need to pick something with "Flags", but Program ==> strip
+InstallMultipleFlags(scores,$(XBILL_DIR),-m 666)
+InstallMultiple ($(XPMS),$(XBILL_DIR)pixmaps)
+InstallMultiple ($(XBMS),$(XBILL_DIR)bitmaps)

25
games/xbill/pkg/DEINSTALL Normal file
View File

@ -0,0 +1,25 @@
#!/bin/sh
# $OpenBSD: DEINSTALL,v 1.1 2003/04/15 12:41:25 wilfried Exp $
#
# xbill de-installation
set -e
PATH=/bin:/usr/bin:/sbin:/usr/sbin
PREFIX=${PKG_PREFIX:-/usr/local}
SCORE_FILE=/var/games/xbill.scores
if [ -f $SCORE_FILE ]; then
echo
echo "+---------------"
echo "| To completely deinstall the $1 package you need to perform"
echo "| this step as root:"
echo "|"
echo "| rm -f $SCORE_FILE"
echo "|"
echo "| Do not do this if you plan on re-installing $1"
echo "| at some future time."
echo "+---------------"
echo
fi
exit 0

46
games/xbill/pkg/INSTALL Normal file
View File

@ -0,0 +1,46 @@
#!/bin/sh
# $OpenBSD: INSTALL,v 1.1 2003/04/15 12:41:25 wilfried Exp $
#
# Pre/post-installation setup of xbill
# exit on errors, use a sane path and install prefix
#
set -e
PATH=/bin:/usr/bin:/sbin:/usr/sbin
PREFIX=${PKG_PREFIX:-/usr/local}
SCORE_FILE=/var/games/xbill.scores
# Function: install a blank file to be used as the xbill score file
#
do_install()
{
touch $SCORE_FILE
chown root:games $SCORE_FILE
chmod 664 $SCORE_FILE
}
# verify proper execution
#
if [ $# -ne 2 ]; then
echo "usage: $0 distname { PRE-INSTALL | POST-INSTALL }" >&2
exit 1
fi
# Verify/process the command
#
case $2 in
PRE-INSTALL)
: nothing to pre-install for this port
;;
POST-INSTALL)
if [ ! -f $SCORE_FILE ]; then
do_install $1
fi
;;
*)
echo "usage: $0 distname { PRE-INSTALL | POST-INSTALL }" >&2
exit 1
;;
esac
exit 0

View File

@ -1,5 +1,9 @@
@comment $OpenBSD: PLIST,v 1.3 2000/07/02 11:17:14 fgsch Exp $
@comment $OpenBSD: PLIST,v 1.4 2003/04/15 12:41:25 wilfried Exp $
@group games
@mode 2555
bin/xbill
@mode
@group
man/cat1/xbill.0
share/xbill/README
share/xbill/bitmaps/apple.xbm
@ -63,7 +67,6 @@ share/xbill/pixmaps/sun.xpm
share/xbill/pixmaps/suncpu.xpm
share/xbill/pixmaps/toaster.xpm
share/xbill/pixmaps/wingdows.xpm
share/xbill/scores
@dirrm share/xbill/pixmaps
@dirrm share/xbill/bitmaps
@dirrm share/xbill

View File

@ -1,11 +1,9 @@
$OpenBSD: patch-Imakefile,v 1.1 2000/06/02 18:47:25 espie Exp $
--- Imakefile.orig Fri Jun 2 20:40:32 2000
+++ Imakefile Fri Jun 2 20:40:40 2000
@@ -52,5 +52,5 @@ FontTarget($(FONT))
$OpenBSD: patch-Imakefile,v 1.2 2003/04/15 12:41:51 wilfried Exp $
--- Imakefile.orig Wed Feb 16 11:35:06 1994
+++ Imakefile Mon Apr 14 19:01:42 2003
@@ -52,5 +52,3 @@ FontTarget($(FONT))
all:: $(CFONT)
install::
- touch $(HSCORE_FILE)
- chmod a+w $(HSCORE_FILE)
+ touch $(DESTDIR)$(HSCORE_FILE)
+ chmod a+w $(DESTDIR)$(HSCORE_FILE)

View File

@ -0,0 +1,25 @@
#!/bin/sh
# $OpenBSD: DEINSTALL,v 1.1 2003/04/15 12:41:51 wilfried Exp $
#
# xjewel de-installation
set -e
PATH=/bin:/usr/bin:/sbin:/usr/sbin
PREFIX=${PKG_PREFIX:-/usr/local}
SCORE_FILE=/var/games/xjewel.scores
if [ -f $SCORE_FILE ]; then
echo
echo "+---------------"
echo "| To completely deinstall the $1 package you need to perform"
echo "| this step as root:"
echo "|"
echo "| rm -f $SCORE_FILE"
echo "|"
echo "| Do not do this if you plan on re-installing $1"
echo "| at some future time."
echo "+---------------"
echo
fi
exit 0

46
games/xjewel/pkg/INSTALL Normal file
View File

@ -0,0 +1,46 @@
#!/bin/sh
# $OpenBSD: INSTALL,v 1.1 2003/04/15 12:41:51 wilfried Exp $
#
# Pre/post-installation setup of xjewel
# exit on errors, use a sane path and install prefix
#
set -e
PATH=/bin:/usr/bin:/sbin:/usr/sbin
PREFIX=${PKG_PREFIX:-/usr/local}
SCORE_FILE=/var/games/xjewel.scores
# Function: install a blank file to be used as the xjewel score file
#
do_install()
{
touch $SCORE_FILE
chown root:games $SCORE_FILE
chmod 664 $SCORE_FILE
}
# verify proper execution
#
if [ $# -ne 2 ]; then
echo "usage: $0 distname { PRE-INSTALL | POST-INSTALL }" >&2
exit 1
fi
# Verify/process the command
#
case $2 in
PRE-INSTALL)
: nothing to pre-install for this port
;;
POST-INSTALL)
if [ ! -f $SCORE_FILE ]; then
do_install $1
fi
;;
*)
echo "usage: $0 distname { PRE-INSTALL | POST-INSTALL }" >&2
exit 1
;;
esac
exit 0

View File

@ -1,7 +1,10 @@
@comment $OpenBSD: PLIST,v 1.3 2002/04/07 01:54:49 naddy Exp $
@comment $OpenBSD: PLIST,v 1.4 2003/04/15 12:41:51 wilfried Exp $
bin/xjewel
@group games
@mode 2555
bin/xjewel_
lib/xjewel.scores
@mode
@group
lib/xjewel.font/fonts.dir
lib/xjewel.font/seven_seg.pcf.gz
man/cat6/xjewel.0

View File

@ -7,7 +7,7 @@ sed -e s/snf/pcf.gz/ <Imakefile.orig>Imakefile
cat >> Imakefile <<END
HSCORE_FILE = $PREFIX/lib/xjewel.scores
HSCORE_FILE = /var/games/xjewel.scores
USERDEFS = -DICON_WINDOW -DUSE_SELECT -DGETPWENT
BINDIR = $PREFIX/bin
MANDIR = $PREFIX/man/cat6

View File

@ -1,4 +1,4 @@
# $OpenBSD: Makefile,v 1.14 2002/10/26 20:44:40 naddy Exp $
# $OpenBSD: Makefile,v 1.15 2003/04/15 12:42:31 wilfried Exp $
COMMENT= "X11 version of the popular board game"
@ -17,9 +17,7 @@ CONFIGURE_STYLE=imake noman
post-patch:
@/usr/bin/perl -pi.bak -e "s|\@XSCRABBLEDIR\@|${PREFIX}/lib/X11/xscrabble|;" \
${WRKSRC}/Imakefile
@/usr/bin/perl -pi.bak -e "s|\@XSCRABBLEDIR\@|${PREFIX}/lib/X11/xscrabble|;" \
${WRKSRC}/XScrabble.ad
${WRKSRC}/Imakefile ${WRKSRC}/XScrabble.ad ${WRKSRC}/src/main.c
NO_REGRESS= Yes

View File

@ -1,13 +1,10 @@
$OpenBSD: patch-aa,v 1.3 2003/04/15 12:42:31 wilfried Exp $
--- Imakefile.orig Tue Mar 11 06:56:29 1997
+++ Imakefile Sun Jul 27 10:43:53 1997
@@ -9,3 +9,10 @@
+++ Imakefile Mon Apr 14 14:49:03 2003
@@ -9,3 +9,6 @@ DependSubdirs($(SUBDIRS))
MakeLintLibSubdirs($(SUBDIRS))
MakeLintSubdirs($(SUBDIRS),install.ln,install.ln)
+InstallNamedNonExec(XScrabble.ad,XScrabble,$(LIBDIR)/app-defaults)
+InstallNonExecFile(OSPD3.gz,@XSCRABBLEDIR@)
+InstallNonExecFile(scrabble_permutations,@XSCRABBLEDIR@)
+InstallNonExecFile(xscrabble.scores,@XSCRABBLEDIR@)
+
+install::
+ @chmod a+rw $(DESTDIR)@XSCRABBLEDIR@/xscrabble.scores

View File

@ -1,5 +1,6 @@
$OpenBSD: patch-ab,v 1.2 2003/04/15 12:42:31 wilfried Exp $
--- XScrabble.ad.orig Tue Mar 11 06:57:16 1997
+++ XScrabble.ad Sun Jul 27 09:53:56 1997
+++ XScrabble.ad Mon Apr 14 14:50:27 2003
@@ -1,9 +1,9 @@
! *** XScrabble resource file ***
@ -9,7 +10,7 @@
-XScrabble.scorefile: /usr/local/lib/xscrabble.scores
+XScrabble.dictfile: @XSCRABBLEDIR@/OSPD3
+XScrabble.permfile: @XSCRABBLEDIR@/scrabble_permutations
+XScrabble.scorefile: @XSCRABBLEDIR@/xscrabble.scores
+XScrabble.scorefile: /var/games/xscrabble.scores
! version string, to make sure correct resource file is loaded
XScrabble*version: 100

View File

@ -0,0 +1,20 @@
$OpenBSD: patch-src_main_c,v 1.1 2003/04/15 12:42:31 wilfried Exp $
--- src/main.c.orig Mon Mar 10 07:41:24 1997
+++ src/main.c Mon Apr 14 14:50:09 2003
@@ -57,13 +57,13 @@ static XtResource resources[] =
XtRImmediate,(XtPointer) 0},
{"dictfile","Dictfile",XtRString,sizeof(String),
XtOffsetOf(struct AppData,dictfile),XtRImmediate,
- "/usr/local/lib/OSPD3"},
+ "@XSCRABBLEDIR@/OSPD3"},
{"permfile","Permfile",XtRString,sizeof(String),
XtOffsetOf(struct AppData,permfile),XtRImmediate,
- "/usr/local/lib/scrabble_permutations"},
+ "@XSCRABBLEDIR@/scrabble_permutations"},
{"scorefile","Scorefile",XtRString,sizeof(String),
XtOffsetOf(struct AppData,scorefile),XtRImmediate,
- "/usr/local/lib/xscrabble.scores"},
+ "/var/games/xscrabble.scores"},
};
/* resource options */

View File

@ -0,0 +1,25 @@
#!/bin/sh
# $OpenBSD: DEINSTALL,v 1.1 2003/04/15 12:42:31 wilfried Exp $
#
# xscrabble de-installation
set -e
PATH=/bin:/usr/bin:/sbin:/usr/sbin
PREFIX=${PKG_PREFIX:-/usr/local}
SCORE_FILE=/var/games/xscrabble.scores
if [ -f $SCORE_FILE ]; then
echo
echo "+---------------"
echo "| To completely deinstall the $1 package you need to perform"
echo "| this step as root:"
echo "|"
echo "| rm -f $SCORE_FILE"
echo "|"
echo "| Do not do this if you plan on re-installing $1"
echo "| at some future time."
echo "+---------------"
echo
fi
exit 0

View File

@ -0,0 +1,46 @@
#!/bin/sh
# $OpenBSD: INSTALL,v 1.1 2003/04/15 12:42:31 wilfried Exp $
#
# Pre/post-installation setup of xscrabble
# exit on errors, use a sane path and install prefix
#
set -e
PATH=/bin:/usr/bin:/sbin:/usr/sbin
PREFIX=${PKG_PREFIX:-/usr/local}
SCORE_FILE=/var/games/xscrabble.scores
# Function: install a blank file to be used as the xscrabble score file
#
do_install()
{
touch $SCORE_FILE
chown root:games $SCORE_FILE
chmod 664 $SCORE_FILE
}
# verify proper execution
#
if [ $# -ne 2 ]; then
echo "usage: $0 distname { PRE-INSTALL | POST-INSTALL }" >&2
exit 1
fi
# Verify/process the command
#
case $2 in
PRE-INSTALL)
: nothing to pre-install for this port
;;
POST-INSTALL)
if [ ! -f $SCORE_FILE ]; then
do_install $1
fi
;;
*)
echo "usage: $0 distname { PRE-INSTALL | POST-INSTALL }" >&2
exit 1
;;
esac
exit 0

View File

@ -1,8 +1,11 @@
@comment $OpenBSD: PLIST,v 1.2 2002/04/07 01:54:50 naddy Exp $
@comment $OpenBSD: PLIST,v 1.3 2003/04/15 12:42:31 wilfried Exp $
@group games
@mode 2555
bin/xscrab
bin/xscrabble
@mode
@group
lib/X11/app-defaults/XScrabble
lib/X11/xscrabble/OSPD3.gz
lib/X11/xscrabble/scrabble_permutations
lib/X11/xscrabble/xscrabble.scores
@dirrm lib/X11/xscrabble